【发布时间】:2021-09-26 15:34:39
【问题描述】:
我正在使用 paypal 结帐(在 php 中)制作付款页面,当我处于沙盒模式时一切正常,但是当我上线时,付款后出现此错误...
Fatal error: Uncaught PayPal\Exception\PayPalConnectionException: Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token. in www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:207
Stack trace: #0 www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php(252): PayPal\Core\PayPalHttpConnection->execute('grant_type=clie...')#1 www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php(280): PayPal\Auth\OAuthTokenCredential->getToken(Array, 'qsdqsdqsdqsd', 'qdsqdsdqsdsqd', 'grant_type=clie...')#2 www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php(216): PayPal\Auth\OAuthTokenCredential->generateAccessToken(Array, NULL)#3 www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Auth/OAuthTokenCredential.php(166): PayPal\Auth\OAuthTokenCredential->updateAccessToken(Array)#4 www/src/package/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php on line 207
你能帮我吗? 谢谢
【问题讨论】:
-
Got Http response code 401 when accessing https://api.sandbox.paypal.com该错误表明您仍在使用沙盒版本的贝宝。确保您将所有内容从沙盒版本更改为实时版本。