我做了以下示例:
<script>
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
amount: {
value: '1.00'
}
}]
});
},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
//actions.redirect();
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
});
}
}).render('#paypal-button-container');
//This function displays Smart Payment Buttons on your web page.
</script>
但是我想在交易批准后将用户转到其他页面。
我尝试使用:
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
actions.redirect("<url>");
});
}
没有成功。
关于如何设置重定向网址的任何想法?
答案 0 :(得分:2)
您尝试过使用此功能吗?
document.location.href = "www.your-redirect-page.com"