【发布时间】: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