stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

Failed redirect when using confirmSetupIntent bugs future calls

Open DaltonPelkey opened this issue 2 years ago • 0 comments

Describe the bug Attempting to add a card that requires redirection, but not handling the redirection properly prevents using the function for x-amount of time.

To Reproduce Steps to reproduce the behavior: In my test Stripe environment I am:

  1. Creating a new payment method using createPaymentMethod and <CardField>
  2. Sending to an endpoint which fetches the new payment method, verifies it is not a duplicate for the customer, creates a setup intent attached to a customer ID, and returns the client_secret
  3. Pass the client_secret to confirmSetupIntent
  4. Try to add the test card 4000 0027 6000 3184 without proper redirect handling in the app
  5. For roughly the next 1-2 hours, with any attempt to run the above steps, confirmSteupIntent immediately returns with the error The current action is not yet completed. STPPaymentHandler does not support concurrent calls to its API.

Expected behavior Not being prevented from adding a card after a failed redirect

Screenshots I can provide a video if needed on an old revision

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser n/a
  • Version n/a

Smartphone (please complete the following information):

  • Device: iPhone 14 Pro Max
  • OS: 17
  • Browser n/a
  • Version n/a

Additional context Expo managed workflow Expo CLI 0.10.11 Expo SDK 49.0.5 stripe-react-native 0.30.0

I'm using initStripe All payment methods created using createPaymentMethod are set up for off-session usage

For clarification: I have tested that adding proper redirection following Expo's guide here prevents the issue from happening again, but preventing adding a card for a couple hours after a failed redirect (accident or not) does not seem desirable or intended.

I have chatted with Stripe Developer Support on Discord and it was recommended to submit an issue here.

DaltonPelkey avatar Aug 10 '23 22:08 DaltonPelkey