stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.23k stars 255 forks source link

[iOS] payment sheet not closing after Swish completion #1675

Open ottob opened 1 month ago

ottob commented 1 month ago

Describe the bug After a successful payment using Swish and user is returned to app, the payment sheet is not closed.

It works fine for other providers using redirects (like klarna), it works fine in the iOS simulator. It does not work in TestFlight/App Store version.

To Reproduce Steps to reproduce the behavior:

  1. Click Payment button from payment sheet
  2. Open swish app, this opens bankid app (this can not be recorded, that's why there is two videos below).
  3. Press Open in app button.
  4. Sheet stays open and nothing happens

Expected behavior The payment sheet should disappear.

I also expected the handleURLCallback function to return true. It does in simulator (when sheet is closed), but not in the TestFlight/prod version, there it returns false.

They return url of the app is: myapp://stripe-redirect?payment_intent=pi_3POEQ8FVh2i3IPYO0pQbV9zw&payment_intent_client_secret=pi_3POEQ8FVh2i3IPYO0pQbV9zw_secret_MOouimBCcf3rD1raHkasnZUam&redirect_status=succeeded

Videos If applicable, add videos to help explain your problem.

https://github.com/stripe/stripe-react-native/assets/67104/c0b61db1-0387-446a-b361-cd96054b6cc8

https://github.com/stripe/stripe-react-native/assets/67104/eff450f7-a858-4383-97ad-c25aa865cff1

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here. expo, using "@stripe/stripe-react-native": "0.37.2"

simonbengtsson commented 1 week ago

We started seeing the same thing recently. Can reproduce every time with live payments using Swish with both version 0.37.3 and now with the latest 0.38.1.

For the user it looks like the payment was cancelled since the payment sheet is not closed, but it is actually successful when you check the intent in the stripe dashboard. When user try to pay again an error is thrown however (likely since payment intent already marked as successful).

Additional information

ottob commented 1 week ago

We received an email about a week ago from stripe that said that reliability issues with swish hade been resolved in iOS SDK version 23.27.6

But afaik this react native library is still using 23.27.0.

So @seanzhang-stripe, can you please bump the IOS sdk here and perhaps this will be resolved?

simonbengtsson commented 1 week ago

I checked now and already had the latest 23.27.6 iOS SDK. Stripe react native has '~> 23.27.0' as version constraint on so pod update will get you the latest 23.27.6. So 23.27.6 does not resolve this issue.

ottob commented 1 week ago

Thanks for checking. We are using expo so I cannot fiddle with pod update.

I hope they can find another solution then.