尝试让我的 paypal REST api 网站上线。它在沙箱模式下运行良好,并具有经过验证的传输。
当我将沙箱切换为实时客户端 ID 和密钥时,出现错误
{"error":"invalid_client","error_description":"Client Authentication failed"}
我检查并确保我的代码应该上线
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
PP_CLIENT_ID , // ClientID
PP_CLIENT_SECRET // ClientSecret
)
);
// setting mode to live
// https://github.com/paypal/PayPal-PHP-SDK/wiki/Going-Live
$apiContext->setConfig([
'mode' => 'live',
]);
通过 wp_ajax 运行它
任何帮助,将不胜感激!谢谢!
2/5/2019:似乎其他人也遇到了这个问题:https://github.com/paypal/PayPal-PHP-SDK/issues/435 https://github.com/paypal/PayPal-PHP-SDK/issues/435
我错过了 StackOverflow 上同样的问题……也没有答案。PayPal 应用程序作为沙箱完美运行,实时客户端身份验证失败:要检查的步骤列表? https://stackoverflow.com/questions/49830063/paypal-app-works-perfectly-as-sandbox-client-authentication-failed-on-live-lis?rq=1
https://developer.paypal.com/docs/api/overview/#api-requests https://developer.paypal.com/docs/api/overview/#api-requests
使用实时凭据时
网址应该是https://api.paypal.com https://api.paypal.com反而https://api.sandbox.paypal.com https://api.sandbox.paypal.com
参考https://github.com/paypal/PayPal-PHP-SDK/issues/435#issuecomment-462133355 https://github.com/paypal/PayPal-PHP-SDK/issues/435#issuecomment-462133355
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)