#keval_best-practices

1 messages · Page 1 of 1 (latest)

meager nexusBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1326861255767621642

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sturdy veldt
#

Hi, let me help you with this.

#

Client-side errors (Elements, Checkout and mobile SDKs) can be localized, since they're designed to be shown to customers directly. However, the error messages for the requests made on the backend (e.g. create a PaymentIntent), are only displayed in English. They are intended just for developers to be able to fix their integration. You should show a more general error message to your customers in this case.

grave verge
#

@sturdy veldt Thanks for the help!
To clarify, I’m trying to set the locale at the Stripe initialization level (e.g., locale: 'auto' when initializing the Stripe instance). However, as I’m using Stripe SDK v17.5.0, I encountered an error because locale doesn’t exist in the StripeConfig type for initialization.

I understand now that the locale option isn’t supported directly at the initialization level. Could anyone confirm how to handle localization for error messages properly with this version, or if there’s a recommended way to handle it at the API call level when creating payment intents or sessions?

Thanks again for the guidance!

sturdy veldt
#

Which Stripe SDK are you using exactly?

grave verge
#

I am using Stripe SDK v17.5.0, for my node js project .