Skip to content

Conversation

@rquartararo
Copy link
Member

@rquartararo rquartararo commented Jan 15, 2026

The type of this PR is: Feat/Refactor

This PR solves EMI-3019

Description

  • Refactors to use context step errors
  • Does not show error banner for payment element errors shown in the payment element UI
  • Fixes scroll to error for offer step
  • Scroll to payment element for payment element errors
  • Scroll to error banner for banner errors
  • Fixes no selected payment method error
Screenshot 2026-01-14 at 3 42 30 PM Screenshot 2026-01-14 at 3 42 50 PM
Screen.Recording.2026-01-14.at.3.44.40.PM.mov

@rquartararo rquartararo self-assigned this Jan 15, 2026
const handlePaymentElementError = useCallback(
// do not setStepErrorMessage since the error is being handled by the PaymentElement
(error: StripeError) => {
paymentElementRef.current?.scrollIntoView({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 scrolling to the entire payment element UI should be sufficient!

if (submitError) {
logger.error(submitError)
handleError(submitError)
handlePaymentElementError(submitError)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think elements.submit() raises validation errors, but I'm not 100% sure if Stripe would always highlight a particular input. I wonder if there would be a case where we do still want to show the error message in our UI. Non-blocking if we can't easily verify.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me try to verify in the docs. I'll merge this as is for now.

starsirius
starsirius previously approved these changes Jan 15, 2026
Copy link
Member

@starsirius starsirius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a question about errors from elements.submit(); otherwise LGTM!

@relativeci
Copy link

relativeci bot commented Jan 16, 2026

#6023 Bundle Size — 9.53MiB (+2.01%).

09bae0a(current) vs 4af6329 main#6021(baseline)

Warning

Bundle contains 34 duplicate packages – View duplicate packages

Warning

Bundle introduced 2 new packages: @swc/helpers, regenerator-runtime – View changed packages

Bundle metrics  Change 8 changes Regression 3 regressions
                 Current
#6023
     Baseline
#6021
Regression  Initial JS 3.71MiB(+1.39%) 3.66MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 100% 40.9%
Change  Chunks 102(+3.03%) 99
Change  Assets 105(+2.94%) 102
Change  Modules 5956(+0.74%) 5912
Regression  Duplicate Modules 597(+6.61%) 560
Change  Duplicate Code 4.14%(+8.38%) 3.82%
Regression  Packages 297(+0.68%) 295
No change  Duplicate Packages 33 33
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#6023
     Baseline
#6021
Regression  JS 9.39MiB (+1.99%) 9.2MiB
Regression  Other 144.17KiB (+3.29%) 139.59KiB

Bundle analysis reportBranch rquartararo/payment-errorsProject dashboard


Generated by RelativeCIDocumentationReport issue

@rquartararo rquartararo merged commit ea23e25 into main Jan 16, 2026
13 checks passed
@rquartararo rquartararo deleted the rquartararo/payment-errors branch January 16, 2026 20:30
@artsy-peril artsy-peril bot mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants