QuickTip: PayPal IPN - Complex Pass Through Data

Send complex data in the custom field that you use to match a payment with a customer, order or whatever you need.

If you already rely on the PayPal IPN, or are in the process of implementing it I'm sure you're ready to use the available "Custom" field to match a payment to orders, customer or whatnot in your own system. At one point or another you'll come to the conclusion that it would be nice with a couple of more of those "Custom" fields.

But actually, you only need one. And I'm not talking about using some weird comma-separated list of values and stuff it in the field.

Hint

It's really simple though, and you'll think "Doh! Why didn't I think of that!!". Here are the steps required, and I already assume you know how to do these steps in your own preferred language.

  • Create a dummy class containing all fields that you would like to pass.
    Example (You should really not be needing exactly these fields, because if your db is set up correctly you would only need OrderId to be able to figure out the rest) :
        class PaymentData
        {
          public int CustomerId {get; set; }
          public int OrderId {get; set;}
          public List Products {get; set;}: 
        } 
      
  • Create an Instance of PaymentData and assign all fields to the values you wish to persist during the payment process.
  • Encode the instance of PaymentData to Json, and stuff it in the custom field. Yaaay!
  • Whenever you get an IPN notification you can decode the Json and read the data through the class instance in a structured and easy to read manner.

 

Until next time.

 DroidXplorer big in China?

According to an email DroidXplorer will be preinstalled on devices, and be featured on a set of app stores. For free.

 QuickTip: PayPal IPN - Complex Pass Through Data

Send complex data in the custom field that you use to match a payment with a customer, order or whatever you need.

 PayPal IPN - Take control over your incoming payments!

I'm sure you've heard all about the simplicity of using a payment processor service to sell your items online, but don't miss out on the ones who prefer using Paypal.

 About

A little about me, and what this page will be about from now on.

Page 1 / 1

 PayPal IPN - Take control over your incoming payments!

I'm sure you've heard all about the simplicity of using a payment processor service to sell your items online, but don't miss out on the ones who prefer using Paypal.

 QualityApp.net App Review Index

Having your app reviewed is a great way to boost your downloads! Read more on how QualityApp can help you find your mentions..

 DroidStop Android Apps

Despite popular belief, creating mobile apps and games is NOT the quick way to the millions!

 Internet Explorer 9, JScript Error c00c023f

Ajax and Error c00c023f

After updating to Internet Explorer 9, a previously working ajax driven site of mine stopped working sporadically.

In this short article you will see how to reproduce, and how to solve the problem.

 Would this interest you?

Page 2 / 11