Smart Button - Redirect Not Working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
We have the following within our Smart Button code, but it isn't redirecting to the URL on success, it's defaulting to the success message that shows on the page. This poses us a problem in relation to how we track conversions, so we'd very much like to figure out how to get it to redirect to a different URL.
Any help appreciated!
Dan
---------------------
onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
// Go to another URL:
actions.redirect('https://propertysummits.com/ticket-success/');
// Or show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h1>Success!</h1><p>Thank you for buying tickets to our November event.<br>We look forward to meeting you in person on the day.<br><br>You will receive a confirmation email from Paypal shortly.<br>A member of the team will also supply event attendance information.</p>';

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Things don’t appear to be working at the moment in PayPal Payments Standard
- How to enable on-demand / recurring payments to existing PayPal checkout? in SDKs
- Paypal buttons and redirects in PayPal Payments Standard
- PayPal Pay buttons a mysterious process in PayPal Payments Standard
- credit is not eligible unless vault=true in SDKs