You are viewing the PayPal Community Archives. This content may be old or outdated. Leave the Archive
Hi All,
is there a way to set a return url with Smart Payment Buttons?
It's really unclear for the user that the thank you page is the same of the order page.
Thank you,
Luca
Hi @Imengine
Thanks for reaching out to us,
Here, you can find an example of how to do this on Smart Buttons.
There is an object called: redirect_urls
return actions.payment.create({
payment: {
transactions: [{
amount: {
total: '0.01',
currency: 'USD'
}
}],
redirect_urls: {
return_url: 'https://example.com',
cancel_url: 'https://example.com'
}
}
});
},
You could also set up a "cancel" URL.
I hope this helps,
Thanks,
Thank you.
It works also with Subscriptions?
This is my script
<script>
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': '<?=$paypal_plan_id;?>'
});
},
onApprove: function(data, actions) {}
}).render('#paypal-button-container');
</script>
Best,
Luca
Hi,
Did you get this to work? I am also looking for this solution with Smart Buttons and Subscriptions. I can't find any info on how to do this!
©1999-2022 PayPal, Inc. All rights reserved.