您应该将从 IPN 获得的哪些信息保存在您的本地数据库中?
$_POST['txn_id']
字段是否是确保您重新追踪来自 paypal 的所有交易信息所需的唯一字段?还是插入从 IPN/PDT 回发中获得的所有信息更好?
基本上,我试图弄清楚我需要存储哪些信息以防出现交易问题和/或用户投诉。
最佳答案
不,txn_id
还不够。根据 PayPal 在其 Introducing 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 进行审计的信息也是一个好主意。
关于database - 我应该在本地数据库中存储从 Paypal 交易中获得的什么样的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19404358/