1

在他们处理 IPN 的 PHP 代码中的 PayPal 网站上,他们做了一些小的检查,然后就下一步做什么发表了一些评论。

其中一条评论是

// check that txn_id has not been previously processed

表示如果已处理,则有问题。

当 payment_status 从“Pending”变为“Completed”时会发生什么,它肯定会发送相同的 txn_id 不是吗?您将如何识别交易并更新数据库中的记录以及为该特定 IPN 消息发布的“txn_type”是什么?

IPN 已经存在多年,但在大多数地方,文档仍然非常模糊和解释不清。它们让您猜测在许多情况下会发生什么,而不是详细解释。

任何帮助都会非常感谢。

4

1 回答 1

1

Transaction ID should be the unique id of the transaction that occurred, the logic that you noted is to make sure that the transaction is not duplicated (eg. not inserted more than once in the system), transaction updates should have the same transaction id. So you should check if the transaction id exists, if so update according fields if you see fit.

于 2013-11-06T18:18:40.597 回答