flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
940 stars 518 forks source link

P24 not showing up on IOS #796

Closed juliuszmandrosz closed 2 years ago

juliuszmandrosz commented 2 years ago

Hi, I am creating payment intent with card and P24 as payment methods. On Android everything works fine and I can see P24 method, however on IOS it is not showing up, I will be grateful for any help!

image image image image

To Reproduce Steps to reproduce the behavior:

  1. Add P24 to payment methods creating payment intent in API
  2. Present payment sheet on client side

Expected behavior Payment sheet should show P24 payment method

remonh87 commented 2 years ago

Thank you for the excellent problem description. I can reproduce the behavior and I see a crash on iOS related to this. I will create a ticket on the stripe sdk repo.

grzesebe commented 2 years ago

Hi, I have exact same issue using https://github.com/capacitor-community/stripe I've changed stripe pod version to 21.13.0. It should be compatible with p24 but it didn't help.

Only using p24

remonh87 commented 2 years ago

So I got it working when you specify a return url in the initPaymentSheet parameters. This is a required for the P24 method but it should not crash so thats why I keep it open.

Example:

await Stripe.instance.initPaymentSheet(
        paymentSheetParameters: SetupPaymentSheetParameters(
          // Main params
          paymentIntentClientSecret: data['paymentIntent'],
          merchantDisplayName: 'Flutter Stripe Store Demo',
          // Customer params
          customerId: data['customer'],
          returnURL: 'flutterstripe://safepay',
}
juliuszmandrosz commented 2 years ago

Thank you, it works perfectly. By the way, what this parameter is responsible for? The documentation does not explain much about it

remonh87 commented 2 years ago

The return url is: to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. For example on P24 and also iDeal you will enter an external web page where the customer handles the payment. When completed you ideally want to close the webview and make the user return to your app.

juliuszmandrosz commented 2 years ago

Thanks for explanation, however now I am facing another issue with return url provided. I used deep link to return back to my app after the successful payment, but when I am trying to authorize payment on P24 test page, I am not redirected back to the application but payment is being fulfilled in the background, I will be grateful for any help in this case.

remonh87 commented 2 years ago

Did you also add the deeplink in flutter like: https://docs.flutter.dev/development/ui/navigation/deep-linking ?

juliuszmandrosz commented 2 years ago

Yes, I did it, but the problem is not with the app itself, when payment is successful I can just see infinite loader on P24 page

remonh87 commented 2 years ago

last versions (try 5.0.0) incorporated some fixes for deeplinking if the issue still persists ping me and I will further investigate it.