-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
Changing locale (switching language in the storefront) passed to createStripePaymentIntent after payment intent is generated causes this error:
Keys for idempotent requests can only be used with the same parameters they were first used with. Try using a key other than 'TDU7BNTV66K1MU65_5200' if you meant to execute a different request.
I think the issue could be: the idempotent key does not change but the language code does (here in the code) which I think causes this.
To Reproduce
Steps to reproduce the behavior:
- Make an order and go to checkout
- Run
createStripePaymentIntent
to get a new payment intent - Switch storefront locale (in my case /sk/pokladna -> /en/checkout), which causes page to refresh and generate the paymentIntent once again, but this time with a different locale
?languageCode=${locale}
passed in the URL - Gets the error above
Expected behavior
I expect this to not error, similarly as when I get to the payment step, generate payment intent, and then refresh the page myself (without changing language) - it works just fine (as, I suspect, no metadata has changed). Or if I change the content of my order lines (but in this case the idempotency key changes, so no error) and then come back to the payment stage.
Environment (please complete the following information):
- @vendure/core version: 3.2.4
- Nodejs version: v22.14.0
- Database (mysql/postgres etc): postgres 16
Additional context
Add any other context about the problem here.