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 client_secret provided does not match the client_secret associated with the PaymentIntent. #348

Open
3 of 8 tasks
divyesh-savaliya opened this issue Apr 12, 2024 · 3 comments

Comments

@divyesh-savaliya
Copy link

divyesh-savaliya commented Apr 12, 2024

Platform

  • Web
  • iOS
  • Android

Describe the bug
If a previous request failed due to an error, attempting to make a payment again result in the following message: "The client_secret provided does not match the client_secret associated with the PaymentIntent."

To Reproduce

  1. Make a payment using a real card while keeping the Stripe key in test mode.
  2. This should result in a failed payment due to the mismatch between the live card and the test environment.
  3. After the failed payment, attempt to call collectPaymentMethod with a new payment intent ID.
  4. You should encounter an error message indicating that the client secret provided does not match the client secret associated with the PaymentIntent.

Another way to reproduce

  1. Connect to tap to pay
  2. Put app in background and then open the app
  3. Now try to make the payment
  4. It throws the error

Expected behavior
It should open new payment sheet with new payment intent id.

Additional context
Clear previous payment intent info if its failed.

Using Function:

  • Payment Sheet / Payment Flow
  • Apple Pay
  • Google Pay
  • Identity (@capacitor-community/stripe-identity)
  • Terminal(@capacitor-community/stripe-terminal)
@rdlabo
Copy link
Member

rdlabo commented Apr 13, 2024

After the failed payment, attempt to call collectPaymentMethod with a new payment intent ID.

If failed, another card can be tried in succession. If change collectPaymentMethod with PaymentIntent, you should run cancelCollectPaymentMethod before collectPaymentMethod.

@rdlabo
Copy link
Member

rdlabo commented Apr 13, 2024

Another way to reproduce

There does not appear to be a problem at this time. For longer periods of time, the Secret Key is likely to change and a revert algorithm will be required.

734688327.633573.mp4

@rdlabo
Copy link
Member

rdlabo commented Apr 14, 2024

@divyesh-savaliya Has this solved the problem? If so, close the Issue.

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

No branches or pull requests

2 participants