Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal webhook events not received

I'm implementing a simple payment workflow using paypal REST API. I first create a payment, redirect the user to the URL returned by this call, and execute the payment upon approval. To make it more reliable, I'd like to use webhook notifications.
And this is when it starts being a problem: I don't receive any notification.

Given the different Q&A I read so far, here are my remarks:

  1. The whole payment process is working, I'm able to communicate with Paypal and to validate a payment.
  2. It works fine while using the webhook simulator so I know my system is ok.
  3. I subscribed to all events. I'd expect to receive at least "PAYMENT.AUTHORIZATION.CREATED" and "PAYMENT.SALE.COMPLETED" notifications (or "PAYMENT.SALE.DENIED" if the payment is denied). I checked that they are listed in the supported event type list.
  4. I'm still using the sandbox environment, but I saw nothing specifying it should not work in this context.
  5. "Sandbox Webhooks Events" is empty, but I'm not sure whether they should appear here anyway.
  6. I've no clue where this correlation ID/debug ID is supposed to be.
    EDIT: from answer, correlationID is to be found in the response header. Here are mines:
    • aa25ee518487a // webhook creation
    • 1fbf78ce3a034 // payment creation
    • 7a5d3c34daa5d // payment execution

Is there something more I should do to make it works? Or is there something more I could do to debug it?
Bonus: Am I right to expect "PAYMENT.AUTHORIZATION.CREATED" and "PAYMENT.SALE.COMPLETED/DENIED" notifications in my case?

EDIT2: So after one month, I'm coming back to this issue. I can now see the webhook event in the dashboard (no clue what changed), and its status is PENDING. Its transaction-id is 4396a630-78bc-11e6-8890-77339302725b. Any idea how I could get more details about why it's pending?

like image 593
ZaX Avatar asked Oct 30 '22 00:10

ZaX


1 Answers

From PayPal tech support:
"I see that you have payment review enabled on the test account. Can you please disable it and submit some transactions and ensure that they have completed, then check for the webhook notifications."
This setting can be found in Sandbox > accounts. Then for each account you use, in profile > settings, set "Payment Review" to off.

That solved my problem.

Note: In my understanding, after executing a payment, if the status is "approved", the payment was completed. It is not the case, since payment might be automatically put to review. If like me you need to have a complete control over the state of a payment, you might need to switch to payment with intent="authorize". You will need another step after execution, which is capturing the payment. You can then subscribe to:

  • PAYMENT.CAPTURE.COMPLETED
  • PAYMENT.CAPTURE.DENIED
  • PAYMENT.CAPTURE.PENDING
  • PAYMENT.CAPTURE.REVERSED"

to monitor its actual state.

Regarding "PAYMENT.AUTHORIZATION.CREATED" webhook event, it is triggered after a payment has been executed.

like image 189
ZaX Avatar answered Nov 08 '22 03:11

ZaX