【发布时间】:2021-04-26 06:01:09
【问题描述】:
我一直在尝试集成 PayPal Payouts (https://developer.paypal.com/docs/payouts/),但即使通过简单的设置来显示“使用 Paypal 登录”按钮,它似乎也无法正常工作。我正在尝试设置此https://developer.paypal.com/docs/payouts/features/set-up-assisted-account-creation 以获取payer_id。我会将payer_id 存储在数据库中,然后我将使用 PayPal Payouts 批处理来处理这些 ID 以向用户付款。
这是最简单的设置 -
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PayPal Payouts</title>
<script src="https://www.paypalobjects.com/payouts/js/payouts_aac.js"></script>
<script>
paypal.PayoutsAAC.render({
// Use sandbox for testing
env: 'sandbox',
clientId: {
// production: '<production clientId>',
sandbox: '**************************************************************'
},
merchantId: '*************',
pageType: 'login',
onLogin: function (response) {
if (response.err) {
console.log(response.err)
} else {
console.log(response.body.code)
}
}
}, '#paypal')
</script>
</head>
<body>
<div id="paypal"></div>
</body>
</html>
它只是暂时出现。只有在第一页加载时它才会出现然后消失。 消失后,它在控制台上产生错误-
main.js:596 Uncaught TypeError: Parameter `locale` must be a string, not undefined `undefined`
at o (main.js:596)
at i (main.js:596)
at new t (main.js:596)
at Object.createHandler (main.js:614)
at t.init (main.js:1389)
at Object../bootstrap.js (main.js:1257)
at i (main.js:1)
at Object../render.js (main.js:1353)
at i (main.js:1)
at HTMLDocument.<anonymous> (main.js:1323)
【问题讨论】:
标签: paypal paypal-sandbox paypal-ipn paypal-rest-sdk paypal-adaptive-payments