0

I'm using PDT, when the payment_status is Completed, I update my database and exchange the amount to credit. For example, 30 USD to 30 minutes of service.

I worry that someone make a payment and with payment_status pending, in that case my application would not perform this exchange. So, what will happen when payment is finally completed?

  1. PayPal will send me a notification?
  2. Should I constantly asking to PayPal for payment?

On the other hand, what if my application will meterito falls and can not process a payment made in PayPal, there's some way to tell PayPal "Hey, I've already process the payment, save it"?

Thanks.

4

1 回答 1

2

使用与 PDT 非常相似的IPN,不同之处在于 PayPal 的服务器只是将数据发布到您提供的侦听器 URL,而不是返回 URL。

无论用户是否将其返回到您的返回 URL(这是首先使用它而不是 PDT 的另一个原因),每次 PayPal 交易都会触发 IPN。

如果付款最初处于待处理状态,您将获得一个 payment_status 为待处理的 IPN,因此您可以更新您的数据库并相应地发送电子邮件通知。

当付款清除(或失败)时,您将获得另一个具有相同 txn_id 的 IPN,但有一个新的 payment_status,因此您的 IPN 脚本可以相应地采取行动。

于 2016-04-15T03:35:17.230 回答