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

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?

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?

有帮助吗?

解决方案

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

其他提示

in addition to Aaron answer, you can use ExpressCheckout REST api to set a LOCALE see https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/

you can pass locale parameter using the PayPal REST APIS as mentioned here - https://developer.paypal.com/docs/api/payments/v1/

Example

"application_context":{
    "locale":"en_IN",
    "brand_name":"MY BRAND",
    "landing_page":"Billing"
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top