Welcome to PayU Webhooks - implementing server callbacks: - www.deekpay.com
We received a lot of feedback from merchants wanting us to provide a way to update their systems when a payment occurs. We listened carefully to this feedback and introduced the webhook feature to address this need.
What is a webhook?
A webhook is an HTTP callback. When you create a webhook, you specify a URL as the callback address.
Webhook callbacks are event-based, i.e. they are executed whenever an event associated with a webhook occurs.
For example --
Successful Payment Webhook: The event associated with this webhook is a successful payment. Therefore, whenever a successful payment occurs, a callback is sent to the webhook URL.
How does the PayU webhook work?
PayU will send a callback message in the form of an HTTP POST request to the specified URL.
Currently, we offer two webhook event types -- the
When payment is successful
When payment fails
As a result, you can receive a server callback whenever a successful or failed payment occurs on your merchant account. All payment details are shared in the callback message so that you can update the server and process the order in accordance with your business processes.
The format of the callback request can be viewed - here.
How do I create a webhook?
To create a webhook, you need to create a URL on the server to receive the callback message that will be sent.
Once you have created the URL, you can go to your PayU Merchant Account -> Settings -> My Account -> Webhook
Click on the "Create New Webhook" button.
Select the type of event you want to add the webhook to.
Enter the webhook URL (the URL you created in the first step). Note that you cannot create a webhook with a URL that cannot receive a callback request!
Optionally, you can also provide a static authorisation header and key so that your server can identify whether the callback message came from the PayU server or not
submit (a report etc)
Upon submission, the PayU server will send a mock callback message to confirm that the URL provided is capable of receiving POST requests.
If your URL is not able to receive the simulated request sent, then you will be able to create this webhook.
If your URL is able to receive the request and provide an HTTP response code of 200 OK, then the webhook will be created successfully.
Once your webhook is created successfully, a callback is sent to your webhook URL whenever a webhook event occurs.