我复制了代码:
<body>
<div id="paypal-button"></div>
<script>
paypal.Button.render({
env: 'production', // Or 'sandbox',
commit: true, // Show a 'Pay Now' button
style: {
color: 'gold',
size: 'small'
},
payment: function(data, actions) {
/*
* Set up the payment here
*/
},
onAuthorize: function(data, actions) {
/*
* Execute the payment here
*/
},
onCancel: function(data, actions) {
/*
* Buyer cancelled the payment
*/
},
onError: function(err) {
/*
* An error occurred during the transaction
*/
}
}, '#paypal-button');
在onAuthorize上,我想在付款完成后下载我项目文件夹中指定的文件。有没有办法做到这一点?到目前为止,当我完成付款时,交易被批准并发送了资金,我希望下载操作。