#candy_cane
1 messages · Page 1 of 1 (latest)
Hello! We don't provide localized error messages in the API. You would need to display your own error message as desired instead of using ours.
Oh, okay. Thanks.
Also, error messages on Stripe.js api are localised, for example stripe.confirmCardPayment retruns loacalised result?.error?.message .
Okay, thanks.
Is it possible to somehow check for errors such as insufficient funds on client side using Stripe js and get localized error messagem
You could set the payment_behavior on the Subscription to default_incomplete when you create the Subscription, then confirm the first Invoice's Payment Intent client-side.
That is what I am doing already.
But subscriptions.create raises the exception with the error message.
Can you give me a request ID showing that error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_XNez5voaLXgfBV
That's a request to attach a Payment Method to a Customer, not a request to create a Subscription.
You should not be attaching Payment Methods directly to Customers, by the way.
You should be using a Setup Intent or a Payment Intent with setup_future_usage to set up the Payment Method for future use and attach.
Okay, thanks. I will give that a try!
If I used etup Intent or a Payment Intent with setup_future_usage to set up the Payment Method for future use and attach would it still raise the exception?
You would ideally confirm the Intent client-side, so the error would be raised there and you'd get the localized error from Stripe.js.