简体   繁体   English

PayPal Express Checkout-错误400错误的请求

[英]PayPal Express Checkout - error 400 bad request

I am trying to integrate Paypal button to my website. 我正在尝试将Paypal按钮集成到我的网站。 Paypal giving me this error after logging in for payment using sandbox credentials 使用沙盒凭据登录以进行付款后,贝宝给我这个错误

Failed to load resource: the server responded with a status of 400 (Bad Request) 加载资源失败:服务器响应状态为400(错误请求)

I want track what is wrong in my request. 我想跟踪我的请求出了什么问题。 Is there any way to get more details about errors? 有什么方法可以获取有关错误的更多详细信息?

在此处输入图片说明

link to button page - link 链接到按钮页面- 链接

code: 码:

<!DOCTYPE html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://www.paypalobjects.com/api/checkout.js"></script>
</head>

<body>
    <div id="paypal-button-container"></div>
    <script>
        paypal.Button.render({
            env: 'sandbox',
            client: {
                sandbox:    'AUI0tgjgg1Iipb0wwjDuXgmVpu2NG81xJvarBKhugpcpXhF8ECRzrUlNr_Dbpev0Rz5HKglbY5434Gkt',
                production: '<insert production client id>'
            },
            commit: true,
            payment: function(data, actions) {
                return actions.payment.create({
                    payment: {
                        transactions: [
                            {
                                amount: { total: '0.01', currency: 'USD' }
                            }
                        ]
                    }
                });
            },
            onAuthorize: function(data, actions) {
                return actions.payment.execute().then(function() {
                    window.alert('Payment Complete!');
                });
            }
        }, '#paypal-button-container');
    </script>
</body>

Can you please a new sandbox business account, then use the newly created sandbox account for processing payments. 您能否请一个新的沙盒企业帐户,然后使用新创建的沙盒帐户来处理付款。 Let us know if you still encounter the same issue with the new account also. 让我们知道您是否仍然在使用新帐户时遇到相同的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM