在PayPal沙盒付款期间INSTRUMENT_DECLINED

时间:2017-11-05 07:34:22

标签: javascript paypal paypal-sandbox

我正在使用 PayPal 快速结帐按钮

测试网络应用

我点击立即付款,我使用我的沙箱帐户登录并使用Paypal支付付款,但付款结果并不理想,我收到了400错误:{"ack":"contingency","contingency":"INSTRUMENT_DECLINED","meta":...

我的代码是

 paypal.button.render({
    env: 'sandbox',
    client: {
        sandbox:    'AAAAAAAAAAA',
        production: '<????>'
    },

    locale: 'en_US',                
    commit: true, // Show a 'Pay Now' button
    style: {
        size:'medium',
        color: 'silver',
        label: 'pay',
    },
    payment: function(data, actions) {
        return actions.payment.create({
            payment: {
                transactions: [
                    {
                        amount: { total: ctrl.amount, currency: 'EUR' }
                    }
                    ]
            },
            experience: {
                input_fields: {
                    no_shipping: 1
                }
            },
        });
    },

    onAuthorize: function(data, actions) {
        return actions.payment.execute().then(function(payment) {
            alert("Payment completed!");
            paymentCompleted();

        });
    },

    onCancel: function(data, actions) {
        alert("Payment doesn't end well :-(");
        location.href=location.href;
    }


}, '#paypal-button');

我注意到interactive demo中的相同行为,我可以登录,付款,但由于INSTRUMENT_DECLINED,我们不接受付款。

有关问题可能在哪里? 我尝试创建不同的沙箱帐户,但没有任何变化。

0 个答案:

没有答案