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:
  1. You POST a transaction to Xente.
  2. We queue it up.
  3. We process the transaction - this might involve user approval.
  4. We call back your webhook to notify you of the status of the payment.
  5. 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:
  1. 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.
  2. JSON parsing: Ensure that your IPN URL can parse JSON data. This means extracting relevant information from the incoming request payload.
  3. 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.
  4. 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

curl -X POST 'your-url' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": "long",
    "subscriptionId": "long",
    "transactionId": "UUID",
    "batchId": "string",
    "requestId": "string",
    "requestReference": {
      "createdOn": "datetime",
      "requestId": "string"
    },
    "statusMessage": "string",
    "statusCode": "integer",
    "correlationId": "",
    "createdOn": "datetime",
    "amount": "decimal",
    "currencyCode": "string"
}'

Response message

KeyTypeDescription
TransactionIdstringThe transaction Id of the transaction. This was returned when you made the transaction request.
AccountIdstringYour account Id
createdOnstringDate when request was received and processed on your end
SubscriptionIdstringYour subscription Id
ResponseCodestringA description of status
RequestIdstringThe request Id that was sent in the request.
ReferenceIdstringReferenceId of the Transaction from your end. Can be same as requestId
ResponseMessagestringA description of status from your end

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:
  1. IP whitelisting: As an added layer of security, whitelist the following IPs: 52.48.24.237 and 34.252.29.119