gpt4 book ai didi

localization - 可以在Stripe中使用非英语文本吗?

转载 作者:行者123 更新时间:2023-12-03 10:45:36 27 4
gpt4 key购买 nike

成功将Stripe集成到我的在线商店中,我完全无法获得有关是否/如何配置Stripe以德语(而不是英语)返回错误消息的信息。

所以我的问题是:

使用客户端API“https://js.stripe.com/v2”时,是否有本地化的错误消息的方法?

更新2014-05-03

我在Twitter和他们的一名工作人员(我想)told me that this is currently not possible以及他们的TODO列表中都问过同样的问题。

最佳答案

进一步引用:

虽然您不能在 strip 错误上使用人工消息来直接在本地化页面上显示,但您可以利用response.error.code提供自己的翻译。

var errorMessages = {
incorrect_number: "The card number is incorrect.",
invalid_number: "The card number is not a valid credit card number.",
invalid_expiry_month: "The card's expiration month is invalid.",
invalid_expiry_year: "The card's expiration year is invalid.",
invalid_cvc: "The card's security code is invalid.",
expired_card: "The card has expired.",
incorrect_cvc: "The card's security code is incorrect.",
incorrect_zip: "The card's zip code failed validation.",
card_declined: "The card was declined.",
missing: "There is no card on a customer that is being charged.",
processing_error: "An error occurred while processing the card.",
rate_limit: "An error occurred due to requests hitting the API too quickly. Please let us know if you're consistently running into this error."
};


function stripeHandler( status, response ){
if ( response.error && response.error.type == 'card_error' ){
$( '.errors' ).text( errorMessages[ response.error.code ] );
}

else {
// do other stuff (and handle api/request errors)
}
}

代码列表 is documented here(当前在“代码”部分的右列)。

关于localization - 可以在Stripe中使用非英语文本吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23437439/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com