【问题标题】:PayPal client-side? What is minimum code required for multiple buttons?贝宝客户端?多个按钮所需的最少代码是多少?
【发布时间】:2017-06-02 16:15:29
【问题描述】:

我正在使用 .Net,尝试实现多个按钮。

我从 PayPal 获得了答复(付款 ID、付款人 ID 等),但一切都是客户端。如何在服务器端查看付款?

我需要为每个按钮实现所有这些代码吗?

<script>
paypal.Button.render({

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

    client: {
        sandbox:    'xxxxxxxxx',
        production: 'xxxxxxxxx'
    },

    payment: function() {

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

        return paypal.rest.payment.create(env, client, {
            transactions: [
                {
                    amount: { total: '1.00', currency: 'USD' }
                }
            ]
        });
    },

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

    onAuthorize: function(data, actions) {

        // Optional: display a confirmation page here

        return actions.payment.execute().then(function() {
            // Show a success page to the buyer
        });
    }

}, '#paypal-button');
</script>

【问题讨论】:

    标签: paypal


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2011-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-18
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多