Instant Payment Notification
Get a call back every time a payment event happens on your account
Why Instant Payment Notifications
All payment-related transactions (and some non-payment-related) requests on Xente are processed asynchronously. This is because most transactions require user approval and may take time to complete. Below is how we process transactions:
-
You POST a transaction to Xente.
-
We queue it up.
-
We process the transaction - this might involve user approval.
-
We call back your webhook to notify you of the status of the payment.
-
You respond with an HTTP OK that you have received the notification and we commit the payment as complete.
As a result, it is necessary to set up an Instant Payment Notification (IPN) webhook on your end in order to receive updates on the final status of a transaction
Handling Instant Payment Notification (IPN)
When it comes to handling Instant Payment Notification (IPN), there are a few key steps for you to follow:
-
Set up an IPN URL: Create an endpoint on your server to receive IPN messages. This URL should be capable of handling incoming POST requests.
-
JSON parsing: Ensure that your IPN URL can parse JSON data. This means extracting relevant information from the incoming request payload.
-
Response status: If the JSON parsing is successful, make sure your IPN URL responds with a 200 OK status code. This lets the sender know that the notification was received and processed correctly.
-
Transaction completion: Remember that a transaction is only marked as complete when your system receives a successful response from the IPN URL.
Below is some sample code to help you set up your Instant Payment Notification
Response message
Key | Type | Description |
---|---|---|
Token | string | Authentication token that you will use to authenticate subsquent API calls |
refreshToken | string | The refresh token is used to refresh session without requiring new user login |
success | boolean | Status of authentication request |
message | string | A description of status |
Secure your Instant Payment Notifications (IPN) endpoint
Your Instant Payment Notifications (IPN) endpoint will receive transaction confirmations from Xente, so it’s important to ensure that it is secure. To secure the IPN, we will:
-
Use symmetric encryption: This means we will exchange keys. We will have your public key and you will have our public key. We must authenticate the keys before completing the transaction. This functionality is crucial and you cannot go live without testing it.
-
IP whitelisting: As an added layer of security, whitelist the following IPs: 41.2.2.10 and 41.2.2.11