flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

[stripe_checkout] Webview doesn't handle correctly intent:// when customer attempt to pay with iDeal

Open nerder opened this issue 3 years ago • 2 comments

Describe the bug

When the customer chooses iDeal as the payment method they will be redirected to their bank app in order to confirm the payment, but when the webview receives a link with intent:// as the protocol fails with net:ERR_UNKNOWN_URL_SCHEME

To Reproduce

Is not easy to reproduce with the entire iDeal flow because in test mode stripe doesn't actually redirect to the bank mobile app.

Steps to reproduce the behavior:

  1. Inside navigationDelegate hardcode a URL that starts with "intent://"

Expected behavior

I expect to be able to open the customer's bank mobile app, and let them successfully pay

Smartphone / tablet

  • Device: Samsun s10+
  • OS: Android 12]
  • Package version: 5.0.0
  • Flutter version 3.3.2

cc @jamesblasco What's your take on this? I'm not sure what should be the correct way to handle this. Maybe simply replace every intent:// with https://?

nerder avatar Sep 29 '22 01:09 nerder

Let me take a look into it tomorrow 👍🏻. Thanks for some much detailed info

jamesblasco avatar Sep 29 '22 14:09 jamesblasco

No rush, thank you so much! 🙏🏼

nerder avatar Sep 29 '22 14:09 nerder

Hey folks, I've had a chat with the Stipe dev help and they actually suggest not to use this approach on lunching the checkout session in a webview.

The webview is a very limited browser not suited for handling complex use cases such as this one. So this approach should be dropped entirely.

I'll leave this open for reference, but I'm rooting for deprecating stripe_checkout instead of using the normal "native" PaymentSheet implementation. This is what I'm going to do now in order to fix this issue.

Let me know your thoughts,

cc @jamesblasco

nerder avatar Oct 31 '22 17:10 nerder

Hey! I have discussed also internally and think the best approach is to migrate stripe_checkout. Stripe has also deprecated the related apis in order to replace this feature with Payment Links. I am working now in adding support for the Payment Element for web, that would support similar features as PaymentSheet on native. After that we will probably will deprecate stripe_checkout.

Please reach me out if you have any trouble migrating to the PaymentSheet

jamesblasco avatar Nov 01 '22 16:11 jamesblasco

That makes a lot of sense. I'll start the migration in a couple of weeks, and I'll let you know if I encounter any issues.

Thank you so much for this update!

PS: I'll close my draft PR and also this issue since we have a clear path

nerder avatar Nov 01 '22 16:11 nerder