【发布时间】:2015-03-01 02:51:50
【问题描述】:
我已在沙盒环境中成功生成 PayPal 访问令牌。但是,当我将沙箱更改为实时并将 clientId/clientSecret 更新为实时代码时,我收到以下异常:
Fatal error: Uncaught exception 'PayPal\Exception\PPConnectionException' with message 'Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token.' in /home/hbooking/includes/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Core/PPHttpConnection.php:159
由于某种原因,它仍在尝试访问code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token
除了模式和凭据之外,还有什么需要更改的吗?
$sdkConfig = array("mode" => "live");
$clientId = 'removedClientId';
$clientSecret = 'removedClientSecret';
$cred = new OAuthTokenCredential($clientId, $clientSecret, $sdkConfig);
$cred->accessToken = $cred->getAccessToken($sdkConfig);
print $cred;
我正在使用PayPal-PHP-SDK。我已将文件夹解压缩到我的 Web 服务器目录中。但是,我没有作曲家,这是个问题吗?
【问题讨论】: