I am trying to pass custom variables to paypal IPN. I can manage to pass one variable. But i don\'t know how to pass multiple variables.
My Process is something like
You can pass other information via the notify_url field, for example doing http://www.yoursite.com/notify?myvariable=value
I am not sure, if it is even possible with Paypal to send and receive multiple variables. If it is not possible due to Paypal's restrictions, you could use one of the following approaches:
If it is just to pas a variable that is not pertinent to paypal but more pertinent to you when it comes back, you can use the value ['custom'] to submit to paypal, paypal will simply pass it back to yuo once things are done on their side.
Yes, you can! You can use 'custom' variable and add in your form
<INPUT TYPE="hidden" name="custom" value="user_id=1&uname=jj">
And in your IPN.php:
$custom = $_POST['custom'];
And extract the variables from string
Haven't tested, but according to documentation, you could use multiple hidden inputs with name item_number_X
(X=number) inside paypal form to store variables:
<INPUT TYPE="hidden" name="item_number_1" value="value1">
<INPUT TYPE="hidden" name="item_number_2" value="value2">
From paypal docs:
Recordkeeping with passthrough variables
Some variables are exclusively for your own use, such as order management. PayPal returns the values that you send through Instant Payment Notification exactly as you sent them. For this reason, they are called passthrough variables. Their values are not recorded or used by PayPal.
The following are passthrough variables:
A vague memory tells me there are two options for sending data to PayPal. The command x_click and i thought there was something like an upload parameter. When the upload parameter is set to 1 you can send multiple lines to paypal.
Update PayPal information about this