Get (localized) payment source registration errors

2019-08-20 08:00发布

I'm trying to localize error messages occurring during the registration of payment sources and am looking for an easy way out: Is it possible to let stripe do the complete validation of a card directly via the stripe.js api and get a localized error message as a result before I send the token to my server (and then to stripe)? Some errors are caught by the card element, e.g. an incorrect checksum (CC No. 4242424242424241) and returned localized by the js library, giving me hope that I have just missed the right configuration option.

Background: One of our customers triggered a "Your card has insufficient funds." error during card registration (we only issue a charge at a later time) and we weren't able to show a helpful error message because we didn't have a localization for this error and I can't find a complete list of possible error (codes).

1条回答
姐就是有狂的资本
2楼-- · 2019-08-20 08:04

I answered this your other question as well, but this gem might be useful for you here: https://github.com/ekosz/stripe-i18n

You can also find the API errors here: https://stripe.com/docs/api#errors

查看更多
登录 后发表回答