Search code examples
phptwitter-bootstrapdrupaldelaypaypal-ipn

How to Handle PayPal IPN Delay


We designed 1 Bootstrap website with a one-time purchase option using PayPal and, so far, the IPN responds quickly with no problem.

Then, we have another Bootstrap website that uses a recurring subscription and the IPN is always delayed. We also developed 2 other recurring subscription based Drupal websites using the 'PayPal Roles' module and the IPN is always delayed on those websites as well.

When the customer/user is returned to any of our subscription websites after completing payment, our confirmation page returns a "You are not authorized to view this page..." error because the IPN is delayed and has not yet been received from PayPal. Usually, if we wait about 5-10 seconds and refresh the page, the IPN catches up, updates the database, the error goes away, and the user is able to access our website. However, there was one time during testing when it took 10 minutes for the IPN to arrive.

On the PayPal Developer website, I read that the IPN is not a real-time solution, but there does not seem to be a solution offered to work around this issue. So what is the best solution to work around a potential IPN delay? Since the majority of payments are successful, we would like our customers to receive immediate access to our website after payment is completed. If the payment does fail for some reason, we could just manually update the customer account.


Solution

  • I managed reached PayPal technical support and I thought I would share that there is an alternative to the IPN option, which is called PDT (Payment Data Transfer).

    PDT will return transaction data immediately and is useful for sites that need to provide an immediate response to customers like a store offering a digital product or service.

    PDT does not allow guest checkout though and it will only send transaction data one time. It will not re-attempt sending notices if your site is down and it will not send other future notices about chargebacks, refunds, etc.

    PayPal generally recommends the IPN, but openly states that it can have delays.