Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Credit Card: Improve Stripe error handling #35315

Merged
merged 2 commits into from
Aug 14, 2019

Commits on Aug 12, 2019

  1. CreditCardForm: Handle stripe errors specially

    If there is a stripe error, often the error code or message will not be
    useful to the user. A secondary issue is that if the setup intent is
    created, used, and an error happens, the setup intent must be re-created
    to submit the form again.
    
    This change handles stripe errors with special logic, displaying a
    generic message and causing the setup intent to be recreated.
    sirbrillig committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    5a47426 View commit details
    Browse the repository at this point in the history
  2. lib/stripe: Add setStripeError to withStripe

    This exports a new function as part of `useStripeConfiguration`, and
    includes it as a prop added by `withStripe`. If called, it will force
    the stripe configuration to be reloaded. The main purpose of this is to
    re-create a setup intent that has already been used.
    sirbrillig committed Aug 12, 2019
    Configuration menu
    Copy the full SHA
    4a49a3a View commit details
    Browse the repository at this point in the history