Passing custom variables to paypal IPN

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.


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:

  • Send the data serialized, and deserialize on return.
  • Write the data to the database in form.php (with status notpaid) and send the id. In ipn.php catch the id and set status = paid / error / whatever happened in the database.

You can pass other information via the notify_url field, for example doing http://www.yoursite.com/notify?myvariable=value

Tags:

Php

Paypal