#mjbc
1 messages · Page 1 of 1 (latest)
Hi there
Nope you can't achieve this. Locales are supported in frontend (like stripe.js) you can't customize webhooks response to each customer locale.
ok, what about a way to ask stripe.js to get an error in the user locale?
Nope that's not supported also,
yeah... feels like an oversight. I know stripe tries to force people into the Elements flow, but it's not ideal for everyone.
Webhooks responses should be handled by your backend and should be treated in async way. You should provide your customer on your frontend with more explicit messages.
yeah, that's why I'm trying to get the same message Stripe.js displays, but can't, because stripe.js doesn't provide it for me, unless in their flow.
I'll have to translate all the possible errors, in all the possible languages, because I can't use the Elements flow.
I use stripe.js, I have the error code, I should be able to ask stripe.js for the error message
I think I'm not understanding you here, why you want to display webhook responses to your Customer?
Could you please share an example flow ?
I don't want to display webhook responses. But a possible error is a wrong CVC.
Could you please describe a complete flow example and why you are relying on webhooks to display this kind of error ?
Just want to know more about your integration, to see if I can help you better
Our flow is (we have other payment methods, other than Stripe):
- the user chooses the payment method, let's say Card:
- we display the card fields;
- the user fills the fields;
- the user submits the form which will, on our backend, create an Order and attach a Payment (which for Stripe payments will create a PaymentIntent)
- our backend will send a ClientSecret back;
- we confirm the cardPayment with stripe.js;
- at this point we already have the Order in our system, even if the operation fails, so the client can pay it later;
- If the user closes the tab, or reloads, a "Finished Order" page will show the state of the payment, if all goes well, it says their order is finished blah blah blah. If an error occurred, it has to show the error and ask for the user to provide new values (since I can't fill in the provided card details)
since I can't rely only solely on the stripe.js on the new page (or the order's page) I have to rely on what the webhook reports as the error
I don't have to rely on the webhook message
but if I can't ask stripe.js for the message with the error code, i can only translate them myself
Well I don't see webhooks in the flow described above.
Meanwhile, Cards payments are synhronious, so when you confirm the payment, the error response is displayed by stripe.js already.
- at this point we already have the Order in our system, even if the operation fails, so the client can pay it later;
They just can pay later
for the "wrong CVC" example you showd, is handled by elements
yeah, the webhooks will Update the Payment (and StripePayment objects)
the "Finished Order" page will display messages depending on the State of the Payment (and StripePayment) objects
if the webhook reports and error, the Payment will have an error State, and an error code
I have to display that info to the user, on the Finished Order page or the Payment Page for the order (same info)
for card payment there is no need for webhooks, because it's sync payments.
But if you want to rely on webhook responses (which is for backend interraction not frontend) then you need to manage the transalation by your own yes.
yes, it's sync'ed, but if the user refreshes the page? or visits the page later on? The payment failed and how do I tell the User why did it failed?
other than capture what Stripe.js reports and send it back to my backend to save that info (something that I didn't need since I already have that info reported by the Webhook and only need a way to Translate the error code/get the error code in the language of the client)
You shouldn't show/persiste previous customer errors, just ask the customer to reattempt their payments, but if you want this, then yeah you need to manage the translation by your integration
why shouldn't I show the previous error while displaying a "payment failed" page to the user?
seem like the thing to do, so the user know why the payment failed
I would rely solely on the Stripe.js flow if I could, but I can't
I guess I'll have to translate the messages for all the possible errors, for all the possible languages we might have in our cms/e-commerce platform.
doesn't seem like something that dificult for stripe.js to provide, since it already has the errors translated, but ok.
thank you for your time.
You're welcome, don't hesitate to come back if you have any follow up questions 🙂