PayPal Checkout.js:身份验证由于无效的身份验证凭证或丢失的授权标题而失败
我们一直在多个客户帐户上成功通过PayPal Checkout.js进行付款,但自昨天以来,我们注意到客户在客户单击“使用PayPal付款”按钮时收到以下错误(在控制台)结帐:
"Authentication failed due to invalid authentication credentials or a missing Authorization header"
仔细检查其实时客户端ID和沙盒客户ID凭据,一切看起来都正确。 该错误仅在沙盒模式下显示,仅在现场模式下显示。
作为参考,控制台中的整个日志是:
checkout.js:6484 Uncaught Error: Request to post https://www.paypal.com/v1/payment-experience/web-profiles failed with 401 error. Correlation id: f5501848d84a8
{
"name": "AUTHENTICATION_FAILURE",
"debug_id": "f5501848d84a8",
"message": "Authentication failed due to invalid authentication credentials or a missing Authorization header",
"information_link": "https://developer.paypal.com/docs/api/payment-experience/#errors",
"details": []
}
有趣的是,如果我们将实时客户端ID更改为不正确的事物,则返回的错误会更改为:
checkout.js:7123 Uncaught Error: Error: Request to post https://www.paypal.com/v1/oauth2/token failed with 401 error. Correlation id: f633416cb9298
{
"error": "invalid_client",
"error_description": "Client Authentication failed"
}
这将暗示该错误在原始错误中指出的“丢失的授权标头” ,但据我所知,paypal.button.render
js呼叫不允许直接编辑或传递标头,仅将“客户端”参数发送给Sandbox和Production Client ID。
由于几天前的运行良好,而且我们使用的是与工作时相同的确切代码和凭据,所以我猜想外部的事情正在引起这一点。我们错过了PayPal按钮API最近发生的某些东西吗? 任何帮助将不胜感激!
谢谢,
迈克尔
We've been running payments through PayPal Checkout.js successfully for about 5 years on several client accounts, but since yesterday we've noticed clients receiving the following error (in the console) when their customers click the "pay with PayPal" button at checkout:
"Authentication failed due to invalid authentication credentials or a missing Authorization header"
Double-checking their Live Client ID and Sandbox Client ID credentials, everything looks correct. The error does NOT show in Sandbox mode, only in Live mode.
For reference, the entire log in the console is:
checkout.js:6484 Uncaught Error: Request to post https://www.paypal.com/v1/payment-experience/web-profiles failed with 401 error. Correlation id: f5501848d84a8
{
"name": "AUTHENTICATION_FAILURE",
"debug_id": "f5501848d84a8",
"message": "Authentication failed due to invalid authentication credentials or a missing Authorization header",
"information_link": "https://developer.paypal.com/docs/api/payment-experience/#errors",
"details": []
}
Interestingly, if we change the Live Client ID to something incorrect, the error returned changes to:
checkout.js:7123 Uncaught Error: Error: Request to post https://www.paypal.com/v1/oauth2/token failed with 401 error. Correlation id: f633416cb9298
{
"error": "invalid_client",
"error_description": "Client Authentication failed"
}
This would hint that the error lies with "a missing Authorization header" as noted in the original error, but as far as I know the paypal.Button.render
JS call doesn't allow editing or passing headers directly, only sending the "client" parameter with the sandbox and production client IDs.
Since this was working fine a couple of days ago, and we are using the same exact code and credentials as when it was working, I'm guessing something external is causing this. Could it be that something in the PayPal button API changed recently that we missed? Any help would be greatly appreciated!
Thanks,
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这最终是提供商的问题,两天后由PayPal确定。问题和修复程序的完整线程位于这里: https://www.paypal-community.com/t5/sandbox-environment/authentication-failed-due-due-to-invalid-authentication-credentical-credentical-credenticals/mp/2954476
This ended up being an issue by the provider and was fixed by PayPal two days later. The full thread on the issue and the fix is located here: https://www.paypal-community.com/t5/Sandbox-Environment/Authentication-failed-due-to-invalid-authentication-credentials/m-p/2954476