Reputation: 113
I did the example explained at:
<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>
But i want to send the user to other page after the transaction is approved.
i try to use:
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>");
});
}
Without success.
Any idea about how to set the redirection url?
Upvotes: 2
Views: 1348
Reputation: 71
Have you tried using this?
document.location.href = "www.your-redirect-page.com"
Upvotes: 3