直接从 Stripe Elements 获取(本地化)支付源注册错误 [英] Get (localized) payment source registration errors directly from Stripe Elements
问题描述
我正在尝试本地化在支付来源注册期间发生的错误消息,并且正在寻找一种简单的方法:是否可以让 stripe 直接通过 stripe.js api 对卡进行完整验证并获得一个在我将令牌发送到我的服务器(然后是条带化)之前,结果是本地化的错误消息?一些错误被卡片元素捕获,例如不正确的校验和(CC 编号 4242424242424241
)并由 js 库本地化返回,让我希望我刚刚错过了正确的配置选项.
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).
推荐答案
我也回答了你的另一个问题,但这个 gem 可能对你有用:https://github.com/ekosz/stripe-i18n
I answered this your other question as well, but this gem might be useful for you here: https://github.com/ekosz/stripe-i18n
您还可以在此处找到 API 错误:https://stripe.com/docs/api#错误
You can also find the API errors here: https://stripe.com/docs/api#errors
这篇关于直接从 Stripe Elements 获取(本地化)支付源注册错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!