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.
- Button in PayPal Payments Standard
- System error for my Paypal button after years of correct working in PayPal Payments Standard
- Change the button from Sandbox to Production in PayPal Payments Standard
- Paypal Pay button generates GENERIC_ERROR in PayPal Payments Standard
- Seller "Buy now" button - unable to edit a button in PayPal Payments Standard