flutter-stripe / flutter_stripe

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

The future of intentCreationCallback method never completes #1949

Open limonadev opened 1 week ago

limonadev commented 1 week ago

Describe the bug After showing the users the PaymentSheet to enter their card details, I call await Stripe.instance.intentCreationCallback inside the confirmHandler, but that await never finishes so the app is stuck there.Also, there is no exceptions nor logs sent by the method.

To Reproduce Steps to reproduce the behavior:

  1. Call Stripe.instance.initPaymentSheet with the mode as IntentMode.setupMode, currencyCode as 'USD' and setupFutureUsage as IntentFutureUsage.OnSession.
  2. Inside the confirmHandler get the clientSecret and try to call await Stripe.instance.intentCreationCallback() with that secret.
  3. Add a break point after that call.

Expected behavior The break point should be reached after Stripe finishes the processing of intentCreationCallback method.

Smartphone / tablet

Additional context This was tested only on dev environment, as part of a migration from the old stripe_payment package to flutter_stripe, but all the configurations related to the new package were already done.

remonh87 commented 5 days ago

hmm it looks like we do not set the confirmhandler correct. @jonasbark it looks like the completer on android never yield a resutt back to the method channel even though the method is invoked from dart.