gpt4 book ai didi

node.js - Paypal [错误 : ACK Failure: Security header is not valid]

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:20 26 4
gpt4 key购买 nike

我想集成 paypal 上下文结账体验,但我遇到了一个错误,它似乎与我的凭据有关。我仔细检查了所有内容,但仍然无法解决问题。

在我的 index.html 文件中:

<form id="myContainer" action='/checkout' METHOD='POST'></form>
<script>
window.paypalCheckoutReady = function () {
console.log('paypalCheckoutReady');
paypal.checkout.setup('K9FXC5VWR963Q', {
environment: 'sandbox',
container: 'myContainer'
});

};
</script>
<script src="https://www.paypalobjects.com/api/checkout.js" async></script>

然后在我的 server.js 文件中,我的所有配置如下:

var paypal = require('paypal-express-checkout').init('username', 'password', 'signature', 'return url', 'cancel url', [debug]);

当我用谷歌搜索问题时,最常见的解决方案是确保我的用户名、密码和签名正确无误。我已经这样做了,但仍然无法连接到 API。我的终端给我这个错误:

{ TIMESTAMP: '2016-03-12T20:30:06Z',
CORRELATIONID: 'e1fda77960187',
ACK: 'Failure',
VERSION: '52.0',
BUILD: '18316154',
L_ERRORCODE0: '10002',
L_SHORTMESSAGE0: 'Security error',
L_LONGMESSAGE0: 'Security header is not valid',
L_SEVERITYCODE0: 'Error' }

最佳答案

是的。 10002 错误表示 API 凭据不正确。

如果您想测试沙箱 API,请从 https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run 获取 API 凭证通过沙箱帐户登录后。

如果您想调用实时 API,请从 https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run 获取 API 凭证登录后。

请确保您没有在代码中混用沙箱和实时环境。谢谢!

关于node.js - Paypal [错误 : ACK Failure: Security header is not valid],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35962979/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com