2

Which informations obtained from IPN you should keep inside your local Database ?

Is the $_POST['txn_id'] field the only field needed to assure you a retrack of all the transaction informations from paypal? Or is it better to insert all informations obtained from the IPN/PDT postback?

Basically i'm trying to figure out wich info I need to store in case of a transaction problem and/or a user complaint.

1
  • Paypal integration manual will help.Store payment reference information, corresponding user information. Well, it's up to you Commented Oct 16, 2013 at 13:20

1 Answer 1

0

No, the txn_id isn't enough. According to the documentation PayPal provides on their Introducing IPN page

Verify that the IPN is not a duplicate. To do this, save the transaction ID and last payment status in each IPN message in a database and verify that the current IPN's values for these fields are not already in this database. Note: You can't rely on transaction ID alone to screen out duplicates, as this scenario shows: 1) PayPal sends you an IPN notifying you of a pending payment. 2) PayPal later sends you a second IPN telling you that the payment has completed. However, both IPNs contain the same transaction ID; therefore, if you were using just transaction ID to identify IPNs, you would to treat the "completed payment" IPN as a duplicate.

At a minimum, according to this you need to story the transaction ID and last payment status. It's also a good idea to store information you may need to audit against PayPal if there is ever a discrepancy payments you receive versus what you think you should receive.

1
  • Thank you for your answer, according to paypal docs and your answer I'm implementing a system that stores the data of every IPN I receive and relate it to the specific user purchase, when the status of a transaction changes to completed or other statuses then I proceed to update the relative user local data. This allows me to track every transaction update for every user and have a complete overview of the pending/completed transactions. Commented Oct 17, 2013 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.