5

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?

ZaX
  • 193
  • 1
  • 12
  • I am also looking for a solution to a similar problem. I don't want to rely on the payer being rerouted to the success redirect url and therefore would like to execute the payment based on a webhook event. Maybe this is not possible with the REST API and we're supposed to rely on the redirect url only for executing the payment. Please let me know if you find out more information on this issue. – theyuv Jul 20 '16 at 12:02
  • @theyuv for now I think we'll use a polling solution, to fetch the status regularly as long as it's not paid or denied during a reasonable lapse of time. At least we'll be sure to be up-to-date and in a normal process it should not require many calls. – ZaX Aug 01 '16 at 19:01
  • Please check here [Paypal webhook integration using sandbox in Django](https://stackoverflow.com/a/74992415/11272002) – Arti Jan 03 '23 at 11:31

2 Answers2

3

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.

ZaX
  • 193
  • 1
  • 12
-1

You can find the correlation id in the response headers of the api call. If you could let us know we can help troubleshoot further.

Thanks