-
Notifications
You must be signed in to change notification settings - Fork 214
feat(payment): add checkout locale to Stripe elements #3088
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
Conversation
|
|
||
| this._stripeUPEClient = await this._stripeUPEScriptLoader.getStripeClient( | ||
| initializationData, | ||
| state.config.getLocale(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locale should be fetched from cart and not from config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locale should be fetched from cart and not from config.
But it seems that paymentIntegrationService get locale from config?
checkout-sdk-js/packages/core/src/payment-integration/create-payment-integration-selectors.ts
Line 13 in 8bad2f4
| getLocale, |
And I don't see locale in cart selector and Cart interface, or I missed something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for multi lang cart locale will be the source of truth. So this will be not the correct product behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for multi lang cart locale will be the source of truth. So this will be not the correct product behaviour.
But am I correct that we don't have any solution to get locale from cart on checkout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PavlenkoM @animesh1987 each storefront might have one or multiple locales enabled. When it's multiple locales, e.g. EN, FR and DE if I as a shopper selected FR and was browsing storefront in FR, we need to display experience in FR all the way through cart, checkout and post order experience.
In order to do so, we are passing shopper preferred locale to checkout and it gets propagated to downstream services (order, emails) from there.
And we need the same locale to be passed to payment providers (Stripe) to make sure the experience is consistent for the shopper across all the touch points. @PavlenkoM config would only give you info that the storefront (channel) has 3 locales EN, FR and DE but will not tell you that shopper was browsing storefront in FR.
This info can be parced from either storefront or checkout.
But am I correct that we don't have any solution to get locale from cart on checkout?
It can be fetched from get cart request afaik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kristinapototska for clarification.
About solution it was a question to @animesh1987 . Did I miss something and we already has checkout logic for this, or I need to create this functionality for core part of checkout? He answered in the another comment. Thanks.
fc42ec8 to
84056ba
Compare
packages/stripe-integration/src/stripe-ocs/stripe-ocs-payment-strategy.ts
Show resolved
Hide resolved
animesh1987
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to get locale from cart. Feel free to create a method in integrations to get the locale.
69ae597 to
0fa25fc
Compare
Hi @animesh1987 |
42af972 to
3b22333
Compare
What/Why?
Broadcast checkout locale to Stripe components to display Stripe fields with the same language as the whole page
Rollout/Rollback
Rollback this PR
Testing
Stripe UPE
en-fr.mov
Screen.Recording.2025-11-25.at.15.08.32.mov
Stripe OCS
Screen.Recording.2025-11-25.at.16.09.11.mov