Search code examples
paypalpaypal-ipnpaypal-rest-sdk

Paypal IPN vs PDT vs REST API app webhooks vs NVP/SOAP API webhooks


I'm using Paypal IPN since years to send email after a transaction, and it works good, but I see 4 similar methods:

Question: in which case use the one or the other, especially the 2 last ones?

enter image description here


Partial answer about the 2 first ones: with PDT, your site is notified immediately when a customer completes payment. With IPN, however, there is a material lag between the time a customer completes payment and the time your site receives notification of this event. But the latter can be more reliable; the doc says indeed:

PDT has a major weakness: it sends order confirmations once and only once. As a result, when PDT sends a confirmation, your site must be running; otherwise, it will never receive the message. With IPN, in contrast, delivery of order confirmations is virtually guaranteed since IPN resends a confirmation until your site acknowledges receipt. For this reason, PayPal recommends that you implement IPN rather than PDT.


Last thing:

  • I have tried to enable the REST API app webhooks, I have enabled it Live (not Sandbox), checked that All events are registered, tested my listener script on my server with the webhook simulator (working), but ... sadly "Live" transactions don't generate any webhook event (so the problem doesn't even come from my listener script, it's Paypal which doesn't fire the webhook event...).

    enter image description here

  • I have noticed you can create Webhooks both in the Manage NVP/SOAP Webhooks tab or inside a REST API app that you need to create first, what's the difference? Note: I see "accountBasedWebhooks" in the URL of the former, so does it mean that certain webhooks are general for the account, and certain webhooks are specific for an app (what is really an app in this context then?)?


Solution

  • Partial answer:

    • when setting up a Webhook for a REST API app, events will only be fired if it's linked to this app (in my case it never happened!)

    • if you want Webhooks to be fired for all your account, you have to use NVP/SOAP API Webhooks: https://developer.paypal.com/developer/accountBasedWebhooks/create, so in my case this was the option to use.