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

Cancelling payment sheet with custom flow doesn't send error, if customer has saved cards

Open ehaycox opened this issue 1 year ago • 8 comments

Describe the bug If you create a payment sheet with custom flow, and initialize it with a customer that has stripe cards, the payment sheet selects a card by default. This means if you cancel out of the payment sheet, the card is already selected, so it doesn't throw a Cancelled error, it counts it as having selected a payment method.

I think this relates to: https://github.com/stripe/stripe-react-native/pull/975

To Reproduce Steps to reproduce the behavior:

  1. Create payment sheet with custom flow
  2. When call initPaymentSheet, fill in stripe customer and ephemeral key for a stripe customer that has saved cards.
  3. Open the payment sheet, a card should be selected by default
  4. Click the cross on the payment sheet, but presentPaymentSheet returns a null error, and non-null paymentOption with default card.

Expected behavior Should return a cancel error, or at least a null paymentOption

Smartphone (please complete the following information):

  • Android: OnePlus Nord / OS: 11
  • IOS: IPhone 11 / IOS: 16.5

ehaycox avatar Jun 16 '23 09:06 ehaycox

I was fixing an issue in our flutter repo and I can confirm above scenario.

Furthermore there is an inconsistency in propagating result objects between android and iOS. For the following scenario:

  1. init payment sheet and after that use present payment sheet (no user so it will only show the Apple Pay or google pay option )
  2. When choosing select payment method press cancel.
  3. Behaviour android: it provides an error with cancelled. Behaviour iOS : it defaults to the Apple Pay payment option and we can continue.

remonh87 avatar Jun 26 '23 20:06 remonh87

1+

When will this be fixed??

ChurikiTenna avatar Dec 01 '23 05:12 ChurikiTenna

any update bro?

paul-testec avatar Jan 24 '24 04:01 paul-testec

can we get an update on this?

rjsrikureja avatar Feb 20 '24 22:02 rjsrikureja

+1 getting same issue. When using custom flow, pressing out of the payment sheet or clicking on X button to close it, returns selected default payment option and does not throw any error.

marlene89 avatar Apr 11 '24 16:04 marlene89

any update?

amin79 avatar May 24 '24 07:05 amin79

Facing the same issue in react-native stripe sdk, any update on this? or any work around for this?

Resource-4 avatar Jun 06 '24 13:06 Resource-4

I had to switch from custom flow due to this error. I recommend other people do the same if it’s possible in your design.

rjsrikureja avatar Jun 07 '24 16:06 rjsrikureja