Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal Button - Adding Variable to return URL

Tags:

paypal

I am trying to add a simple PayPal button to a website. What I am wanted to do is set up the button to include "options" that need to be selected. This is not a problem, I have the button created and the option select box shows.

What I want to do is return to a URL on my own domain, but have the URL include the selected option from the drop down box that was selected before payment.

so I start at mydomain.com , select an option and after finishing payment have it redirect back to mydomain.com/complete.php?option=theoption

is this possible?

like image 285
Lawrence Cooke Avatar asked Apr 04 '11 10:04

Lawrence Cooke


1 Answers

in php you can add this hidden input in your button

<INPUT TYPE="hidden" NAME="return" value="<?php echo 'mydomain.com/complete.php?option='.$theoption ?>">

where $theoption is the value of theoption that you want to be appended on the return url. Take note that you have to disable payment review so that paypal will automatically redirect back to you website

like image 119
ianace Avatar answered Sep 19 '22 07:09

ianace