What kind of data obtained from a paypal transaction I should store inside my local database?

旧时模样 提交于 2021-02-10 09:30:27

问题


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:


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.



来源:https://stackoverflow.com/questions/19404358/what-kind-of-data-obtained-from-a-paypal-transaction-i-should-store-inside-my-lo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!