2014-05-07 20 views
2

我工作的貝寶REST API與PHP官方SDK:https://github.com/paypal/rest-api-sdk-phpPaypal REST API - 如何控制顯示語言?

不過,我注意到REST調用點我簽出頁面(沙箱模式)在中國的語言環境,任何想法如何控制顯示器語言爲英語?

我發現了同樣的問題被問了一年之前,但沒有答案:REST Api integration - how to force payment page's language?

或者任何一個解決方案是在經典的API提供基礎,貌似並不適用於REST API: How can I control the language displayed in the Paypal Sandbox?

回答

3

有沒有LOCALE您可以傳遞給REST API的選項,但是,如果您爲交易設置送貨地址,它應該自動更新。您可以使用下面的調用進行測試。

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

您的解決方案完美的作品給我!非常感謝!順便說一句我剛剛檢查REST API只支持直接信用卡付款(我想這意味着輸入CC信息付款時,其重定向到PayPal ..)與美國和英國....你會知道這也:)?我發現我的香港信用卡在Sandbox模式下通過,可能只是沙盒模式.. –

+0

這確實很棒,但如果您沒有送貨地址,該怎麼辦?就像數字產品一樣? – t1gor