tech
tech

Reputation: 115

How do you log PayPal IPN messages?

From PayPal's documentation: "PayPal returns related variables for each kind of IPN message. Not all variables are returned for each type of transaction."

I was initially planning to create a table in the database with the message fields but now after I read this it doesn't seem like a good a idea anymore (esp. that I see a lot of fields in their IPN documentation).

I have a few ideas (e.g. using tabs and new lines character separate fields and values. Or, saving the the whole thing in XML in the database) but just wondering how you handle logging IPN messages?

Upvotes: 4

Views: 2094

Answers (3)

Jobert Enamno
Jobert Enamno

Reputation: 4461

I faced the same challenges when I integrate PayPal adaptive Payment. The fastest way I did is to store the IPN details (when PayPal calls the IPN handler that I did) to static variable so that the values can be shown regardless of browsers I used.

Upvotes: 0

sdcoder
sdcoder

Reputation: 496

I'd agree with the previous comment. IPN messages can be quite variable, and can be about 40-50 fields per submission. Just pull the few fields you need for your application (amount, customer info, etc) and drop the rest into an XML or TEXT field just in case you need it later.

Upvotes: 0

Jere.Jones
Jere.Jones

Reputation: 10123

What I do is save it to a database table with columns for information that is important to me along with a "raw" column. I take the form parameters collection and serialize it like a query string and push it in. That way all of the original information is available if I should need it but my database schema remains simple and reflects the information that is important to me.

Upvotes: 7

Related Questions