Paypal REST API-如何控制显示语言? [英] Paypal REST api - How to control the display language?

查看:153
本文介绍了Paypal REST API-如何控制显示语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用官方PHP SDK开发PayPal REST API: https: //github.com/paypal/rest-api-sdk-php

I'm working on the PayPal REST API with the official PHP SDK: https://github.com/paypal/rest-api-sdk-php

但是我发现REST呼叫使我指向中文区域设置的签出页面(沙盒模式),知道如何将显示语言控制为英语吗?

However I notice the REST call point me to a check out page (Sandbox mode) in Chinese locale, any idea how to control the display language as English?

我发现一年前有人问过同样的问题,但没有答案:

I found the same question is asked a year before but no answer: REST Api integration - how to force payment page's language?

或者基于经典API提供了任何一种解决方案,看起来不适用于REST API: 如何控制在Paypal中显示的语言沙盒?

Or either solution are provided base on Classic API, looks like not applicable on REST API: How can I control the language displayed in the Paypal Sandbox?

推荐答案

没有可传递给REST API的LOCALE选项,但是,如果设置了交易的收货地址,则该地址会自动更新.您可以通过以下电话进行测试.

There are no LOCALE options you can pass to the REST API, however, if you set the shipping address for the transaction it should update automatically. You can test with the call below.

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."
    }
  ]
}'

这篇关于Paypal REST API-如何控制显示语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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