Handling Webhooks
Learn how to listen for webhook events executed on Lamba
Receiving webhooks (POST method)
In your webhook endpoint for low_fi
, you can obtain the webhook payload in the form:
Please take note of the following points when handling your webhooks:
Your webhook endpoint must be able to accept a
POST
request withJSON
payload.Validate the
encryption_key
to ensure it matches the one in your.env
file, specifically the encryption key in your app'sAPI keys
section in your Lamba dashboard.Verify the amount and currency returned to confirm they match the value indicated by your
order_id
in your database. Do not mark the order as fulfilled/completed if the values do not match, as they could have been maliciously tampered with on the client.Choose to either record the
actionId
to your order record in the database or discard it, noting that it can always be retrieved by querying thefetching payment
actions endpoint on Lamba API with yourorderId
.Acknowledge the webhook notification within
60
seconds to prevent timeouts. Perform any other business logic in the background and quickly return a status code within the range200 - 299
to acknowledge receipt of the webhook notification.Be aware that failed webhook notifications are resent every
60
seconds for the next12 minutes
(if it keeps failing). After this period, no further notifications will be sent. You must then use yourorderId
to query the Lamba APIfetching payment
actions endpoint to fetch the transaction yourself and validate that the status isfulfilled
. If the status is notfulfilled
, do not credit the user.
Last updated
Was this helpful?