How to customize & set an auto-return URL

Raveling
New Community Member

Hello Everyone,

Complete newbie here.  Could anybody tell me how to modify the Paypal button HTML to auto return to a custom url?

I'm using the standard button for a single product.  I want to tweak the code so the customer  autoreturns to a url I specify.   

I want to direct them to a specific Calendly booking event url after receiving their payment.

My guess is that it goes in this section but I neither know how to have it auto return, nor send them to a specified url.

 // Show a success message within this page, e.g.

            const element = document.getElementById('paypal-button-container');

            element.innerHTML = '';

            element.innerHTML = '<h3>Thank you for your payment!</h3>';

 

            // Or go to another URL:  actions.redirect('thank_you.html');

I'm as clueless & new as I probably sound, so please don't assume any HTML knowledge,  just English literacy;-)

Thanks in advance,
                               Tim

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello @Raveling 

Thank you for posting to the PayPal Community.

If you are using PayPal Standard you can enable auto return inside of your PayPal Account:

The Auto Return feature for PayPal Payments Standard redirects buyers back to your website after completing the payment.

https://www.paypal.com/us/cshelp/article/how-do-i-use-paypals-auto-return-feature-help197

Here's how to enable Auto Return

  1. Return from the PayPal website:
  2. Go to your Account Settings.
  3. Click Website payments.
  4. Click Update across from "Website preferences."
  5. Click On under "Auto Return."
  6. In the Return URL field, enter the URL where you want to send your buyer after the payment.
  7. The Return URL is applied to all Auto Return payments unless otherwise specified within the payment button or link.
  8. Click Save.

As long as your integration is PayPal Standard, and you are not sending a return url in your code, your PayPal buyers will be returned to the URL that you indicated in your PayPal Account.

 

Thank you,

Jennifer

MTS

PayPal

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.