如何整合PayPal Payouts AAC?

问题描述

我一直在尝试集成 PayPal Payouts (https://developer.paypal.com/docs/payouts/),但即使通过简单的设置来显示 Login with 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)

我附上一个 console.log 截图 -

enter image description here

这是第一次页面加载截图 -

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)