PayPal REST PHP SDK API 仍在访问沙盒,即使使用实时凭据也是如此
PayPal REST PHP SDK API is still accessing Sandbox, even with Live credentials
我在切换到 Live 时遇到问题。我已将我的凭据更改为 https://developer.paypal.com 应用程序面板上实时选项卡中的凭据。我可以看到以下错误:
Got Http response code 401 when accessing
https://api.sandbox.paypal.com/v1/oauth2/token.
具有沙箱凭据的相同代码运行良好。所以它仍在尝试访问沙箱并被拒绝,因为在沙箱中实时凭据当然不正确。
奇怪的问题,求助
假设您使用的是 PayPal PHP SDK,这非常简单,您所要做的就是为您的 apiContext 对象设置一些配置。
根据这里 url :Setting PayPal configuration
您可以使用以下代码 php。
$apiContext->setConfig(
array(
...
'mode' => 'live',
...
)
);
希望这对您有所帮助。
我在切换到 Live 时遇到问题。我已将我的凭据更改为 https://developer.paypal.com 应用程序面板上实时选项卡中的凭据。我可以看到以下错误:
Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token.
具有沙箱凭据的相同代码运行良好。所以它仍在尝试访问沙箱并被拒绝,因为在沙箱中实时凭据当然不正确。
奇怪的问题,求助
假设您使用的是 PayPal PHP SDK,这非常简单,您所要做的就是为您的 apiContext 对象设置一些配置。
根据这里 url :Setting PayPal configuration
您可以使用以下代码 php。
$apiContext->setConfig(
array(
...
'mode' => 'live',
...
)
);
希望这对您有所帮助。