如何从 Stripe 获取本地化的错误消息 [英] How can I get localized error messages from Stripe

查看:35
本文介绍了如何从 Stripe 获取本地化的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一位客户触发了您的卡资金不足".卡注册期间出现错误(我们只在以后收费)并且我们无法显示有用的错误消息,因为我们没有针对此错误的本地化.虽然我的兄弟问题 显示(本地化)支付源注册直接在 Stripe Elements 中的错误 试图通过避免必须显示错误来解决这个问题,在我们的支付流程中还有其他地方我们的后端必须处理支付错误(例如向用户发送一个说明付款失败原因的邮件).

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. While my sibling-question Show (localized) payment source registration errors directly in Stripe Elements tries to work around the issue by avoiding to have to display the error at all, there are other places in our payment flow where our backend has to deal with payment errors (e.g. to send the user a mail stating the reason for the payment failure).

是否可以从条带中获取本地化的错误文本,或者是否有可能的错误代码的完整列表以便我们自己本地化消息?(如果相关,我们正在使用条纹红宝石宝石.)

Is it possible to get a localized error text from stripe or is there a complete list of possible error codes so we can localize the messages ourselves? (We are using the stripe ruby gem, if that is of relevance.)

推荐答案

这个 gem 可能对你有用:https://github.com/ekosz/stripe-i18n

This gem might be useful for you here: https://github.com/ekosz/stripe-i18n

这篇关于如何从 Stripe 获取本地化的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆