我应该在本地数据库中存储从贝宝交易中获得的哪种数据?

问题描述:

您应该保留从IPN那里获得的哪些信息?

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

$ _ POST ['txn_id'] 字段是否是确保您从Paypal重新跟踪所有交易信息所需的唯一字段?还是插入从IPN/PDT回发中获得的所有信息更好?

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.

否, txn_id 是不够的.根据PayPal在其引入IPN href ="https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/" rel ="nofollow">a>页面

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

验证IPN不是重复项.为此,请保存每个IPN消息中的交易ID和最后付款状态数据库,并验证这些字段的当前IPN值是否为该数据库中尚未存在.注意:您不能依赖交易ID单独筛选出重复项,如下图所示:1)PayPal向您发送IPN,通知您有待付款.2)稍后再使用PayPal向您发送第二个IPN,告诉您付款已完成.但是,两个IPN都包含相同的交易ID.因此,如果你只是使用交易ID来识别IPN,您将已完成付款" IPN作为重复项.

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.

至少,您需要根据此故事说明交易ID 最近的付款状态.如果您收到的付款与您认为应该收到的付款有出入,那么存储您可能需要根据PayPal进行审核的信息也是一个好主意.

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.