Search code examples
htmlpaypalpayment

Dynamic redirect url for PayPal Buy Now button


I have integrated a PayPal Buy Now button on my site as follows:

<form name="_xclick" action="https://www.paypal.com/uk/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="RECEIVER@RECEIVER.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="description here">
<input type="hidden" name="amount" value="100">
<input type="image" src="https://www.paypalobjects.com/en_US/NL/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

Upon a succesfull purchase, I would like to redirect the user to a certain page (not known in advance - dynamic). How can this be achieved?


Solution

  • You will need to set "return" field in your form. Like this:

    <input type="hidden" name="return" value="URLspecificToThisTransaction">
    

    For more information please visit the documentation here