贝宝:客户端身份验证失败 [英] Paypal: Client Authentication Failed

查看:251
本文介绍了贝宝:客户端身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试启用我的Paypal REST API网站.它在沙盒模式下运作良好,传输已通过验证.

Trying to take my paypal REST api site live. It works well in sandbox mode, with verified transfers.

当我将沙箱切换为实时客户端ID和密码时,会收到错误消息

When I switch my sandbox for live client ID and secret, I get the error

{"error":"invalid_client","error_description":"Client Authentication failed"}   

我检查并确保我的代码可以上线

I checked and made sure that my code should go live

$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运行它

running this via wp_ajax

任何帮助将不胜感激!谢谢!

Any help would be appreciated! Thanks!

2019/2/5:似乎其他人遇到了此问题: https: //github.com/paypal/PayPal-PHP-SDK/issues/435

2/5/2019: Seems other people got this problem: https://github.com/paypal/PayPal-PHP-SDK/issues/435

我错过了关于StackOverflow的相同问题...也没有答案. PayPal App完美运行作为沙箱,实时客户端身份验证失败:要检查的步骤列表?

Also the same question on StackOverflow that I missed ... that also had no answer. PayPal App works perfectly as Sandbox, Client Authentication failed on Live: list of steps to check?

推荐答案

尝试更改 return new SandboxEnvironment($clientId, $clientSecret);

return new ProductionEnvironment($clientId, $clientSecret); 在您的PayPalClient.php类中

return new ProductionEnvironment($clientId, $clientSecret); in your PayPalClient.php class

这篇关于贝宝:客户端身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆