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

[TapToPay] Inconsistent error code when user cancel the payment depending on the platform

Open eeynard opened this issue 11 months ago • 2 comments

Describe the bug After calling collectPaymentMethod, the TapToPay UX appears and if the user cancel the payment, we receive different error codes depending on the platform :

  • iOS: { code: 'Canceled' } as described in the enum CommonError.Canceled so that's ok 👍🏻
  • Android: { code: 'USER_ERROR.CANCELED' } => should it be CommonError.Canceled too ?

To Reproduce Steps to reproduce the behavior:

  1. Setup tap to pay on your app
  2. Create a payment intent
  3. Call collectPaymentMethod
  4. Cancel de payment on the phone
  5. Check the error code

Expected behavior Android Only : The error code returned when the payment is canceled should be Canceled (enum: CommonError.Canceled) and not USER_ERROR.CANCELED

Screenshots N/A

Stripe Terminal React Native SDK version

  • 0.0.1-beta.15

Smartphone (please complete the following information):

  • Device: One Plus 7T
  • OS: Android

Additional context N/A

eeynard avatar Mar 11 '24 14:03 eeynard

Ran into the same thing today when canceling discoverReaders. There's a clear workaround to handle both but would be nice to be aligned.

rachelanordgren avatar Mar 12 '24 16:03 rachelanordgren

Wait so you guys are using tap to pay with react native all from this library? Do you use expo?

CarlMenke avatar Mar 20 '24 08:03 CarlMenke