Payment Confirmation

After the account validation has successfully responded with the account details. You can proceed to confirm the payment for the service.

Prepare Transaction Details

Payment confirmation requires the PIN to be sent as part of the request. This PIN is shared in the account approval email. The PIN parameter is sent as a sha1 hash string converted to upper case. Below is pseudocode to describe how the hash is created.

<?php

function getShaHash($pin) {
    return strtoupper(sha1($pin));
}

?>

Send Payment Request

Send a JSON POST request to the API endpoint below;

POST https://sandbox.ellypayapp.com/merchant/process-payment

Request Body

Parameter

Type

Description

Required

validation_reference

string

The validation reference returned in the validation procedure here. This reference is generated by EllyPay

YES

pin

string

The sha1 hash value of the PIN as described in the above section

YES

secret_code

string

This one is a special parameter that applies to Airtel Money Withdraw transactions. The customer secret code should be Base64 encoded before sending the API request.

NO

As mentioned in the registration section, the API is asynchronous. The 202 response is an acknowledgement of your request. The EllyPay will send a payment notification with the updated status of the transaction. The notification data has the same structure as the acknowledgement response above with the addition of the details object that could hold extra data about the transaction. A sample is shared below

/*sample callback data for a UMEME transaction*/
{
  "id": 24546,
  "amount": 30000,
  "product_code": "YAKA",
  "product_name": "UMEME YAKA",
  "agent_reference": "CSTREFYRWWVRKLG6W1P3",
  "internal_reference": "ELPREFYRWWM8FKMBH1A5A",
  "agent_commission": 700,
  "status": "SUCCESSFUL",
  "description": "Purchase completed successfully for 04250513159",
  "details": {
    "token": "6931 3037 4217 9675 2152",
    "units": 39.4,
    "customer_name": "SSUNA, RICHARD",
    "account_number": "04250513159"
  }
}

Handling Payment Notifications/Callbacks

Whenever the status of the transaction changes (to failure or success), we notify your service via callbacks. Below are the hints to take note of as regards these payment notifications.

  • All callbacks are sent to the callback URL you provide during registration.

  • A secure callback URL is required and notifications will ONLY be sent to https URLs. If you don't receive these notifications, ensure to check this.

  • The callback request is a POST with JSON encoded data.

  • We expect that your service will acknowledge the callback request by responding with HTTP code 200 otherwise we will retry a few more times (if the response code is below the 500 range) and then stop.

  • The callback request includes an extra header ellypay-signatureand this can optionally be used to verify that the callback request originated from our servers. If the signature is valid, you can proceed with your business logic.

  • The next section describes the signature verification procedure.

Last updated