stripe: Payment flow never cancel

Platform

  • Web
  • iOS
  • Android

Describe the bug When you call Stripe.presentPaymentFlow() it opens a closable modal sheet. Unfortunately, the return of this function is inconsistent as it’s not able to distinguish between the modal sheet being closed or a credit card being selected. Actually if you close it with the cross, you get the cardNumber of the default selected credit card and the PaymentFlowEventsEnum.Completed event is triggered instead of PaymentFlowEventsEnum.Canceled. This is not what’s expected.

To Reproduce Steps to reproduce the behavior:

  1. Call Stripe.presentPaymentFlow()
  2. Press the cross to close the modal
  3. See the PaymentFlowEventsEnum.Completed being triggered and the function return the default selected card.

Expected behavior The PaymentFlowEventsEnum.Canceled being triggered on cancel.

Edit I tested with the iOS Simulator and that doesn’t work either. The default selected payment method is returned.

Here is a screenshot taken right after presentPaymentFlow(). Pressing the cross is equivalent to pressing on Google Pay or on the credit card already registered, depending on the default selected payment method. Screenshot_2022-07-06-08-19-26-14_cd9790fdd8d7837e7a7940c8e2b868ec

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 22 (13 by maintainers)

Most upvoted comments

countryCode is only use on Google Pay method. So if google pay is disabled, countryCode don’t set in plugin: https://github.com/capacitor-community/stripe/blob/master/android/src/main/java/com/getcapacitor/community/stripe/paymentsheet/PaymentSheetExecutor.java#L85

OK I though it was used to preset the country when entering credit card detail. My bad.

Thanks.

I released v3.9.1-0. Please try in PaymentSheet method. Thanks.

@cyrilfr

perform a payment at this point

Ok, I understand completely. But looking at the Android logs, there doesn’t seem to be a difference between submit and close. Please give me some time to discuss this with the stripe team.

Oh, I see. I misunderstood to your issue. Please give me some time. This is my first time, so I will investigate from 0.

Thanks.