【发布时间】:2016-06-28 01:00:01
【问题描述】:
我想集成 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' }
【问题讨论】:
标签: node.js paypal-sandbox paypal