Paypal javascript button - how to specify browser success URL?

I am creating a prototype through PayPal and lingering on how to specify the URL that the browser should redirect / link after payment.

<script src=" paypal-button.min.js?merchant=stan-facilitator@merkwelt.com " data-button="buynow" data-name="New Bot" data-quantity="1" data-amount="0.99" data-shipping="0" data-tax="0" data-callback="http://www.merkwelt.com/people/stan/paypal/success.html" data-env="sandbox" ></script> 

I am aware of the difference between a callback (for reporting) and a callback URL (what happens in the browser). I like the way the browser redirects back to my site after payment. How can i do this?

It seems like I'm missing something because this should be the default setting for those using these buttons.

+4
source share
1 answer

After receiving this URL, you can specify data-return .

 <script src=" paypal-button.min.js?merchant=stan-facilitator@merkwelt.com " data-button="buynow" data-name="New Bot" data-quantity="1" data-amount="0.99" data-shipping="0" data-tax="0" data-callback="http://www.merkwelt.com/people/stan/paypal/callback" data-return="http://www.merkwelt.com/people/stan/paypal/success.html" data-env="sandbox" ></script> 

via https://github.com/paypal/JavaScriptButtons/issues/48#issuecomment-17439860

+4
source

Source: https://habr.com/ru/post/1479166/


All Articles