Skip to content
New issue

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

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

Already on GitHub? # to your account

Payment Sheet | Error when using payment intent created by an invoice #901

Closed
parkerbo opened this issue Apr 22, 2022 · 4 comments
Closed

Comments

@parkerbo
Copy link

Describe the bug
I am trying to pay a one off invoice for a customer with the mobile payment element.
I initialize the payment sheet with a payment intent that I received off the finalized invoice (the invoice is set to not automatically proceed and attempt payment)
This flow works fine when a customer does not have a default payment method on their account.
If there is a default payment method, the payment intent on the invoice has that default payment method attached to it, which seems to cause an error when presenting the payment sheet.

To Reproduce
Steps to reproduce the behavior:

  1. Create a finalized invoice for a customer that has a default payment method associated with their account.
  2. Initialize a payment sheet that utilizes the payment intent client secret from the finalized invoice's payment intent.
  3. Present the payment sheet
  4. See error. The payment sheet fails to load and produces an error with an empty message

Expected behavior
I expect the payment sheet to present and allow the customer to choose the payment method to charge for the invoice.

Screenshots
Video

Error on Frontend

Object {
  "code": "Failed",
  "declineCode": null,
  "localizedMessage": null,
  "message": null,
  "stripeErrorCode": null,
  "type": null,
}

Smartphone (please complete the following information):

  • Device: iPhone, Google Pixel 2
  • OS: all current versions of iOS and Android
  • Browser : React Native App, built using expo sdk44
  • Version : Expo SDK44, stripe-react-native v 0.2.3

Additional context
This flow works if the customer doesnt have a default payment method, since in that case, the payment intent created by the invoice does NOT have a payment method attached to it. The payment sheet presents just fine and the invoice gets paid properly

@charliecruzan-stripe
Copy link
Collaborator

Version : Expo SDK44, stripe-react-native v 0.2.3

my thinking is that this could be fixed in a newer version since we've made lots of updates since then. Could you try this with eas build and use a newer version of stripe-react-native?

@parkerbo
Copy link
Author

@charliecruzan-stripe This works, thanks! I did get a warning

Some dependencies are incompatible with the installed expo package version:

  • @stripe/stripe-react-native - expected version: 0.2.3 - actual version installed: 0.7.0
    Your project may not work correctly until you install the correct versions of the packages.

Though everything works as intended. Is there a risk here having a new package that isn't recognized as compatible with expo SDK 44?

@parkerbo
Copy link
Author

Looks like this build failed on android, probably due to the version incompatibility.

Is there an expected time when V0.7.0 will be supported by expo sdk 44

@charliecruzan-stripe
Copy link
Collaborator

You cannot use a newer version in the Expo Go app, but you should be fine using a newer version with EAS Build.

Looks like this build failed on android, probably due to the version incompatibility.

It's probably this issue, you'll need to update the android sdk versions: #812

Is there an expected time when V0.7.0 will be supported by expo sdk 44

It will be supported by a future Expo SDK, but not by 44

Closing since the bug is fixed in newer versions

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants