#candy_cane

1 messages · Page 1 of 1 (latest)

tardy micaBOT
warped wraith
#

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.

scenic totem
#

Oh, okay. Thanks.

#

Also, error messages on Stripe.js api are localised, for example stripe.confirmCardPayment retruns loacalised result?.error?.message .

warped wraith
#

Yep, that's correct

#

We do localize those errors.

scenic totem
#

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

warped wraith
#

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.

scenic totem
#

That is what I am doing already.

#

But subscriptions.create raises the exception with the error message.

warped wraith
scenic totem
#

req_XNez5voaLXgfBV

warped wraith
#

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.

scenic totem
#

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?

warped wraith
#

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.