【问题标题】:paypal error messages not in correct language贝宝错误消息的语言不正确
【发布时间】:2014-01-16 16:08:39
【问题描述】:

我们进行快速结帐(在沙盒上),并在创建定期付款资料中设置“zh_CN”

    CreateRecurringPaymentsProfileRequestType reqType = new CreateRecurringPaymentsProfileRequestType();
    reqType.setVersion(VERSION);
    reqType.setErrorLanguage(getLangCode());

我们也碰巧在请求paypal token api以及两个地方设置了它(因为paypal网站显示为中文)...

    setExpressCheckoutRequestDetails.setReturnURL(url);
    setExpressCheckoutRequestDetails.setCancelURL(url2);
    setExpressCheckoutRequestDetails.setPaymentDetails(paymentDetailsList);
            //This is the first place which works!!!! as the paypal GUI shows up in chinese...
    setExpressCheckoutRequestDetails.setLocaleCode(getLangCode());
    setExpressCheckoutRequestDetails.setBuyerEmail(user.getEmail());

    SetExpressCheckoutRequestType setExpressCheckoutRequest = new SetExpressCheckoutRequestType(setExpressCheckoutRequestDetails);
    setExpressCheckoutRequest.setVersion(VERSION);  
            //This is the second location which probably doesn't work though this request has never failed :( and I don't know how to force a failure :( as putting amount 105.37 on negative testing did not work
    setExpressCheckoutRequest.setErrorLanguage(getLangCode());

然后我们注释掉计费周期的开始日期以导致失败,因为负面测试不起作用(请参阅帖子 how to simulate payment denial in paypal sandbox )。这会导致失败,但返回的错误是英文而不是中文,说“需要开始日期”和长消息“需要订阅开始日期”错误代码 11549。

为什么这不起作用? (我们只是简单地显示贝宝错误,因为它似乎太多,无法一直翻译,但语言不正确)。

谢谢, 院长

【问题讨论】:

    标签: java paypal paypal-sandbox


    【解决方案1】:

    您指的是 API 响应,对吧?这些只是(美国)英语。
    最好将 PayPal API 错误响应映射到您端的适当的面向客户的消息(当然可以是您喜欢的任何语言)。

    我不建议将 PayPal API 错误响应直接暴露给客户。

    【讨论】:

    • 那么 setErrorLanguage 函数是干什么用的?
    猜你喜欢
    • 2011-03-12
    • 2013-10-18
    • 2015-10-29
    • 2014-07-11
    • 2012-01-13
    • 1970-01-01
    • 2010-12-27
    • 2014-08-25
    • 2015-09-14
    相关资源
    最近更新 更多