![](/img/trans.png)
[英]PayPal REST API - Express Checkout - How to change default language?
[英]Paypal REST api - How to control the display language?
我正在使用官方的PHP SDK开发PayPal REST API: https : //github.com/paypal/rest-api-sdk-php
但是,我注意到REST呼叫将我指向中文区域设置的签出页(沙盒模式),您知道如何将显示语言控制为英语吗?
我发现一年前有人问过同样的问题,但没有答案: REST Api集成-如何强制支付页面的语言?
还是基于经典API提供了两种解决方案,似乎不适用于REST API: 如何控制Paypal Sandbox中显示的语言?
没有可以传递给REST API的LOCALE
选项,但是,如果您设置了交易的收货地址,则该地址会自动更新。 您可以通过以下电话进行测试。
curl -v https://api.sandbox.paypal.com/v1/payments/payment -H 'Content-Type: application/json' -H 'Authorization: Bearer {ACCESS_TOKEN}' \
-d '{
"intent":"sale",
"redirect_urls":{
"return_url":"http://localhost",
"cancel_url":"http://localhost"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
},
"item_list":{
"shipping_address":{
"recipient_name":"Test Test",
"type":"business",
"line1":"187 Alameda Santos",
"city":"Sao Paulo",
"country_code":"BR",
"postal_code":"01119",
"state":"Condominio Edificio Platinum"
}
},
"description":"This is the payment transaction description."
}
]
}'
除了Aaron答案外,您还可以使用ExpressCheckout REST api来设置LOCALE,请参阅https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
您可以按照此处所述使用PayPal REST APIS传递语言环境参数-https: //developer.paypal.com/docs/api/payments/v1/
例
"application_context":{
"locale":"en_IN",
"brand_name":"MY BRAND",
"landing_page":"Billing"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.