Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The future of intentCreationCallback method never completes #1949

Closed
limonadev opened this issue Oct 2, 2024 · 3 comments
Closed

The future of intentCreationCallback method never completes #1949

limonadev opened this issue Oct 2, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@limonadev
Copy link

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

  • Device: iPhone 15 (Simulator)
  • OS: iOS 17
  • Package version: 11.1.0
  • Flutter version 3.19.6

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.

@limonadev limonadev added the needs triage Needs triage label Oct 2, 2024
@remonh87 remonh87 self-assigned this Oct 8, 2024
@remonh87 remonh87 added bug Something isn't working and removed needs triage Needs triage labels Oct 8, 2024
@remonh87
Copy link
Member

remonh87 commented Oct 8, 2024

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.

@jonasbark
Copy link
Member

I tested the payment_sheet_deffered_screen.dart example where this is being used and have not experienced any issues - maybe I'm missing something here?

@limonadev
Copy link
Author

@jonasbark this future never completes. If you add a print after the await, the print is never executed

jonasbark added a commit that referenced this issue Nov 1, 2024
remonh87 pushed a commit that referenced this issue Nov 17, 2024
jonasbark added a commit that referenced this issue Nov 19, 2024
* Sync with Stripe React Native 0.39.0

* fix #1949

* feat: add customer session client secret to payment sheet

* feat: add onbehalfof to cardfield

* fix formatting

* update changelog, version

---------

Co-authored-by: Jonas Bark <[email protected]>
Co-authored-by: Remon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants