PayPal Express结账 - 似乎没有成功运行

时间:2016-11-19 10:45:24

标签: paypal paypal-sandbox

所以,我试图解决这个问题,但似乎无法做到这一点。

我正在尝试将paypal express集成到网站上。我有沙盒环境,包括辅导员和买家帐户。

我粘贴示例代码并更改客户端值和事务详细信息等......如下所示:

paypal.Button.render({

                        env: 'sandbox', // Optional: specify 'sandbox' environment

                        client: {
                            sandbox: 'My Client ID here'
                        },

                        payment: function () {

                            var env = this.props.env;
                            var client = this.props.client;

                            return paypal.rest.payment.create(env, client, {
                                intent: "sale",
                                payer: { payment_method: "paypal" },
                                transactions: [
                                    {
                                        amount: { total: '14.00', currency: 'GBP' },
                                        description: "This is a payment description"
                                    },
                                ],
                                redirect_urls: {
                                    return_url: "http://somesite.com/success",
                                    cancel_url: "http://somesite.com/cancel"
                                }
                            });
                        },

                        commit: true, // Optional: show a 'Pay Now' button in the checkout flow

                        onAuthorize: function (data, actions) {

                            // Optional: display a confirmation page here
                            alert('confirmation here');
                            return actions.payment.execute().then(function () {
                                // Show a success page to the buyer
                                alert('success here');
                            });
                        }
                    }, '#paypal-button');

我面临的问题是,当你点击paypal按钮时 - 在弹出窗口中我看不到金额。

然后在继续时,我从javascript中得到错误:

JavaScript runtime error: Error: Payment Api response error:



{

    "name": "INTERNAL_SERVICE_ERROR",

    "message": "An internal service error has occurred",

    "information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",

    "debug_id": "a9ceebeb96bab"

}

Error: Payment Api response error:



{

    "name": "INTERNAL_SERVICE_ERROR",

    "message": "An internal service error has occurred",

    "information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",

    "debug_id": "a9ceebeb96bab"

}

   at Anonymous function (https://www.paypalobjects.com/api/checkout.js:8325:17)

   at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

   at SyncPromise.prototype.dispatch (https://www.paypalobjects.com/api/checkout.js:1542:17)

   at SyncPromise.prototype.resolve (https://www.paypalobjects.com/api/checkout.js:1480:13)

   at Anonymous function (https://www.paypalobjects.com/api/checkout.js:1533:25)

   at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

   at SyncPromise.prototype.dispatch (https://www.paypalobjects.com/api/checkout.js:1542:17)

   at SyncPromise.prototype.resolve (https://www.paypalobjects.com/api/checkout.js:1480:13)

   at Anonymous function (https://www.paypalobjects.com/api/checkout.js:1533:25)

   at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

那么我怎么知道错误是什么?

第二个问题:希望当这一切都在你的帮助下工作时,我怎样才能收回回复并确定付款的成功与否以及详细信息以便在我的网站上登录并显示给用户?那么自定义变量如我的网站生成的paymentID呢?我可以收回这些信息吗?

谢谢

1 个答案:

答案 0 :(得分:1)

您遗漏了API的一些重要信息。 像AMOUNT {}等等。

https://developer.paypal.com/docs/integration/direct/create-process-order/

我也有这个问题,我可以到actions.payment.execute(),我得到一个错误,_loop2等等。

相关问题