Question

How can I capture paypal IPN and Authorize.net "Silent Post" messages?

I'm fine with how to make payments with Omnipay but I could not yet figure out how to listen to the callbacks from these APIs to detect changes for my payments.

For example Authorize.net processes it's credit card payments one time per day (late night for me) and then sends out it's messages via their so called "silent post" (its just a http POST) notifications. So the API call might be immediately "accepted" but I won't know for sure if everything is OK with the payment until I receive the callback.

So how do I set up Omnipay to listen to APIs that do these kind of delayed callbacks?

I'm aware that I'll need a callback URL like /payments/callback/ to load the right gateway to do something with the callback. But I could not yet figure out what method(s) from Omnipay I have to use for it.

Was it helpful?

Solution

Omnipay doesn't support notifications for existing payments. It automatically handles the first notification which is made directly after a payment, but doesn't yet have methods to handle notifications if you change the status of a payment (for example by refunding it from PayPal's control panel, it will not update in your database automatically).

Note this isn't needed for the initial payment. Especially with PayPal Express the payment is not confirmed until the customer returns to your site, so there is no chance of them closing the browser window and the payment being lost.

If you want to set up a notification endpoint and listen for events which happen after the payment is processed, you will need to add a new request type to Omnipay.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top