0
因此,我一直在研究PayPal REST API應用程序,在沙箱環境中工作得很好,但現在是切換到Live的時候了,我遇到了一些問題。我已將我的ClientID和Secret從Sandbox更改爲Live,但應用程序仍嘗試點擊api.sandbox.paypal.com
端點而不是api.paypal.com
端點。更改PayPal REST端點
這導致401錯誤:
object(PayPal\Exception\PayPalConnectionException)#24 (9){
[
"url": "PayPal\Exception\PayPalConnectionException":private
] => string(46) "https://api.sandbox.paypal.com/v1/oauth2/token" [
"data": "PayPal\Exception\PayPalConnectionException":private
] => string(77) " {
"error":"invalid_client",
"error_description":"Client Authentication failed"
} " [" message":protected
]=> string(89) "Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token."[
"string": "Exception":private
如果我在沙盒標識切換回來,它工作正常。我是否需要在某處手動設置端點?我覺得API會理解哪些是SandboxId和LiveId。