NAV
Example

Introduction

This Documentation is dedicated to dusupay Merchants or developers with websites/webapps that have/need to integrate dusupay Payment APIs available.

Welcome to the Dusupay’s Merchant/Website API Doc! Use this Documentation to receive payments on your website or webapp in a more reliable manner.

You can view examples/sample codes in the dark area to the right, where applicable.

Get started

Requirements

Live URL
https://dusupay.com

Sandbox URL
http://sandbox.dusupay.com

Create dusupay account from
https://dusupay.com/users/login

Create Merchant account from
https://dusupay.com/pages/dusupay_become_merchant

  1. Sign-In your Dusupay account, click “Merchant” from the top menu
  2. A list of your merchant accounts will display.
  3. Select “New merchant account” to create Merchant account if the list is empty
  4. From the list, click the merchant account name
  5. Next you will view a page with sample Dusupay buttons that might suit your Dusupay merchant account of your intended website
    They also include code you can copy and test with on your website

Create FormButton

<form method="post" action="https://dusupay.com/dusu_payments/dusupay" target="_blank">
  <input type="hidden" name="dusupay_merchantId" value="1000" required>
  <input type="hidden" name="dusupay_amount" value="5000" optional>
  <input type="hidden" name="dusupay_currency" value="UGX" required>
  <input type="hidden" name="dusupay_itemId" value="Item1" required>
  <input type="hidden" name="dusupay_itemName" value="MyItem" required>
  <input type="hidden" name="dusupay_transactionReference" value="112410" required>
  <input type="hidden" name="dusupay_redirectURL" value="" optional>
  <input type="hidden" name="dusupay_successURL" value="" optional>
  <!--<input type="hidden" name="dusupay_logo" value="" optional>-->
  <!--<input type="hidden" name="dusupay_hash" value="hashValue..." required>-->
  <input type="image" name="submit" src="https://dusupay.com/img/paybuttons/dusupaybtn6.png" />
</form>

This is an ordinary form that can process the transaction from dusupay in a new page. You can change its behavior using the target attribute

Create WidgetButton

<div id="dusupay-btn"><a href="javascript:void();"><img src="https://dusupay.com/img/paybuttons/dusupaybtn6.png" /></a></div>
<script 
dusupay_merchantId="1000"
dusupay_amount="5000"
dusupay_currency="UGX"
dusupay_itemId="Item1"
dusupay_itemName="MyItem"
dusupay_transactionReference="112410"
dusupay_render="widget"
dusupay_redirectURL=""
dusupay_successURL=""
dusupay_environment="sandbox" 
id="dusupay" type="text/javascript" async=true> 
document.write(unescape('%3Cscript src="' +
    (("https:" == document.location.protocol) ? "https://dusupay.com" : "http://dusupay.com") +
  '/js/widgets.js" type="text/javascript"%3E%3C/script%3E'
));
</script>

Data Parameters

The Dusupay API/form uses the following parameter names for transaction data:

<?php
    // PHP - creating dusupay_hash for the form data
    // Hashing algorithm = sha1
    // Copy your security mackey from your merchant page
    $mackey = 'My-Security-Mackey';
    $stringData = $dusupay_merchantId 
                . $dusupay_amount 
                . $dusupay_currency 
                . $dusupay_itemId 
                . $dusupay_itemName 
                . $dusupay_transactionReference;

    $dusupay_hash = hash_hmac('sha1',$stringData, $mackey);
?>
<?php
    //PHP Example - Decording hash sent through the IPN notification

    //Get the timestamp to identify all transaction
    $timestamp = '123243';

    //Concatenate the string data to post
    $stringData = $transaction->amount.$transaction->currency.$transaction->item_id.$transaction->transaction_ref.$timestamp;

    //Generate hash key - This is returned with the IPN notification POST request to dusupay_successURL
    $hashid = hash_hmac('sha1', $stringData, $mackey); //create hashing algorithm to SHA1

?>
Parameter Required Example Description
dusupay_hash No Security token/hash to protect your transaction data.
Hashing your data
Use sha1 algorithm to hash your data. Data should be concatenated as shown in the black box on the right.
dusupay_merchantId Yes 1030

Your MerchantID.
Click to create one

It can be found on your merchant page created

dusupay_amount Yes 5000 Amount to paid
dusupay_currency Yes UGX

ISO Currency.

dusupay_itemId Yes 12345 Unique ID of the item the customer is paying for.
dusupay_itemName Yes Bag

The item name the customer is paying for.

- Maximum length is 20 charaters

dusupay_transactionReference Yes GE34eRre34

Your unique transaction reference generated by your web app

- This uniquely identifies the transaction you want processed.

- This is also returned to your merchant website as a callback in-case your payment request contains a callback url in the dusupay_successURL parameter

dusupay_redirectURL No

This is a redirect URL when the user has completed the payment. The customer is redirected from Dusupay back to your the merchant website

dusupay_successURL No

This is a callback URL called by Dusupay with the transaction details when the status of the transaction changes or fails or is successful

You can use the transaction reference and your merchantId to verify the transaction status through the check_status API

dusupay_render No widget Use this option to show dusupay payment widget within website.

This is done by setting the value of input fields dusupay_render = “widget”

This also requires an element with id=“dusupay-btn” as your dusupay button
dusupay_logo No Full URL of Your company logo.
125px X 125px Square Logo Recommended
dusupay_environment No sandbox set dusupay_environment=sandbox when processing with the sandbox using the widget button only.

Transactions API

Check Transaction Status

Live URL
https://dusupay.com/transactions/check_status/param1/param2.json 

Sandbox URl
http://sandbox.dusupay.com/transactions/check_status/param1/param2.json
Example Response(.json)

{
  "Response":
  {
   "dusupay_transactionId":"1151001074",
   "dusupay_amount":5000,
   "dusupay_currency":"UGX",
   "dusupay_itemId":"Item1",
   "dusupay_transactionReference":"740",
   "dusupay_charge":0,
   "dusupay_chargeCurrency":"USD",
   "dusupay_transactionStatus":"COMPLETE",
   "status":"success"
  }
}

This API allows you to check the status of your transaction or payment made by the user that could be in a PENDING state in you web app.

URL-Parameters Description
param1 Replace this with your MerchantId
param2 Replace this with the transaction_reference of your webapp

Claim Delivery Code

  Live
  https://dusupay.com/merchant-api/transactions/payments/claimDeliveryCode.json
  Sandbox
  http://sandbox.dusupay.com/merchant-api/transactions/payments/claimDeliveryCode.json
    Sample Request Data
    {
      "merchant_id": "10246",
      "transaction_id": "1170209081619256704543171",
      "delivery_code": "9NKACN3GBC",
      "timestamp": "1485987100",
      "signature": "ab68e8b164ae2e3f3f852764f5f7e4e7960c3bed"
    }
  Note
  1. You can replace transaction_ref for transaction_id 
  2. But Make sure you have unique transaction_ref per transaction passed to us
  3. transaction_id is more reliable and recommended

  - transaction_ref is generated by your system. Usually the OrderId

    Sample Response Data
    {
      "Response":{
        "message":"Request completed successfully",
        "status":"success"
      }
    }
<?php
    // Generate Request Data
    // =======================

    // Create Data Array
    $requestData = [
        'merchant_id'=>'Your Merchant ID',
        'amount'=>100,
        'currency'=>'NGN',
        'account_number'=>'Receipient Account Number',
        'account_name'=>'Receipient Account Number Name',
        'bank_code'=>'058',
        'country'=>'NG',
        'phone'=>'256704543171',
        'timestamp'=>time(),
    ];

    // Generate Request Signature
    $requestData['signature'] = getSignature($requestData,'Your Merchant MacKey');

    // Function to generate request signature
    function getSignature($requestData, $merchantMackey){
        ksort($requestData);
        $stringData = '';
        foreach ($requestData as $key => $value) {
            if(in_array($key, ['signature'])) continue;
            $stringData .= $value;
        }
        return hash_hmac('sha1', $stringData, $merchantMackey);
    }
?>

This API allows you to complete the payment that required a DeliveryCode. Your transaction will be creditable to your merchant account when the DeliveryCode validated correctly

Request Method

POST

Request Data

application/json

Response Data

application/json

Generating the signature

To Generate a request Signature Please follow the steps below

step1 Get Your Merchant MacKey from your merchant account page

step2 Create an array of the data to be posted excluding the {signature} array key

step3 ksort the data array generated from step2. This arranges the ArrayKeys in ASCENDING Order

step4 Join the data array values into one string with no space

step5 Create the Signature like hash_hmac(‘sha1’, {joinedString}, {Mackey})

step6 Include the {signature} key to the request data

Note An Example of this implementation has been included in the sample on the right

Mobile Money Pay Outs API

Pay/Withdraw - NEW API Use this API

Live URL
https://dusupay.com/merchant-api/payout/mobile/sendFromSubAccount.json

Sandbox URl
http://sandbox.dusupay.com/merchant-api/payout/mobile/sendFromSubAccount.json
Sample Request Data

{
  "merchant_id": 1368,
  "amount": 2000,
  "account_number": "256704543171",
  "account_name": "Hillary.N",
  "merchant_reference": "1496706203",
  "timestamp": 1496706203,
  "signature": "93ad92d8fbcc0fac06fcc7584a897d59d7143cc6"
}
Example Response

{
  "response": {
    "id": 1747,
    "amount": 2000,
    "charge": 3500,
    "currency": "UGX",
    "account_id": 18,
    "account_type": "MobileMoneyPayoutAccount",
    "transfer_type": "WITHDRAW",
    "created": "2017-06-06T00:03:36+0000",
    "modified": "2017-06-06T00:03:36+0000",
    "transaction_status": "PENDING",
    "status": true,
    "message": "Request Succeeded"
  }
}

This API allows you to send Funds from your Merchant MobileMoney SubAccount to the receipients Mobile Money Account for the supported networks.


Funds will be withdrawn from your Merchant Sub Account whose currency matches the country code of the account_number that will be paid to
e.g 256777777777 will be paid from the UGX SubAccount.


Make sure you have created a MobileMoney SubAccount under your merchant account and added funds to it.

Request Method

POST

Request Data Type

application/json

Response Data Type

application/json

Request Field Description
merchant_id Your MerchantId (int)
amount Amount to be paid (float) (2 Decimal e.g 25.00, 25.03)
account_number Customer/Account Number (String)
account_name Customer/Account name (String)
merchant_reference Optional Unique Transaction Reference from your web-app (String - 32 MAX-Length)
timestamp UNIX Timestamp (Integer)
signature Request Signature (String)

Generate Request Signature

<?php
    // Generate Request Data
    // PHP Example
    // =======================

    // Create Data Array
    $requestData = [
        'merchant_id'=>'Your Merchant ID',
        'amount'=>2000,
        'account_number'=>'Receipient Account Number e.g 256704543171',
        'account_name'=>'Receipient Account Number Name',
        'timestamp'=>time(),
        'merchant_reference'=>'Optional'
    ];

    // Generate Request Signature
    $requestData['signature'] = getSignature($requestData,'Your Merchant MacKey');

    // Function to generate request signature
    function getSignature($requestData, $merchantMackey){
        ksort($requestData);
        $stringData = '';
        foreach ($requestData as $key => $value) {
            if(in_array($key, ['signature'])) continue;
            $stringData .= $value;
        }
        return hash_hmac('sha1', $stringData, $merchantMackey);s
    }
?>

To Generate a request Signature Please follow the steps below

step1 Get Your Merchant MacKey from your merchant account page

step2 Create an array of the data to be posted excluding the {signature} array key

step3 ksort the data array generated from step2. This arranges the ArrayKeys in ASCENDING Order

step4 Join the data array values into one string with no space

step5 Create the Signature like hash_hmac(‘sha1’, {joinedString}, {Mackey})

step6 Include the {signature} key to the request data

Note An Example of this implementation has been included in the sample on the right

IPN - Payout Status(IPN) Webhook(URL)

sample IPN Message

{
  "id": 1757,
  "amount": 2000,
  "charge": 1500,
  "currency": "UGX",
  "rate": 1,
  "account_id": 18,
  "account_type": "MobileMoneyPayoutAccount",
  "transfer_type": "WITHDRAW",
  "created": "2017-07-01T11:27:21+0000",
  "modified": "2017-07-01T11:44:42+0000",
  "status": "PENDING",
  "merchant_id": 1368,
  "merchant_reference": "1498908373",
  "customer_phone": "256704543171",
  "customer_name": "Hillary.N"
}

Simply set the Payout Status(IPN) Webhook(URL) url under your merchant account settings

Request Method

POST

Content-Type

application/json You need to set the content type in your account settings

Default Content-Type

multipart/form-data

Field type Description
id int e.g 12 Unique ID for the payment made
amount float e.g 5600 Amount transfered
charge float e.g 100 Charge by dusupay
currency string e.g KES Currency of the Amount/Charge
account_id int e.g 4 SubAccount account id
account_type string e.g MobileMoneyPayoutAccount SubAccount account type
transfer_type string e.g WITHDRAW Transfer Type
created string e.g 2017-05-10T09:19:13+0000 Date the transaction was created
modified string e.g 2017-05-10T09:23:13+0000 Date the transaction was modified
status string e.g COMPLETE New Transaction status
merchant_id int e.g 1234 Merchant Account Id
merchant_reference string e.g P34KRe4 MAX_LENGTH = 32 Unique Transaction ID from your WebApp. This will be returned in the IPN as-well. Therefore you can use it to complete the transaction on your side.
customer_phone string e.g 254704549719 Customer Phone
customer_name string e.g Hillary.N Customer Name

Get Mobile Money Transaction

Live URL
https://dusupay.com/merchant-api/payout/mobile/getTransaction.json

Sandbox URl
http://sandbox.dusupay.com/merchant-api/payout/mobile/getTransaction.json
Sample Request Data
{
  "id": 1757,
  "merchant_id": 1368,
  "timestamp": 1499434686,
  "signature": "86d3359c21b6fa2aa4d67fd342ee91234121152b"
}
Example Response
{
  "response": {
      "id": 1757,
      "amount": 2000,
      "charge": 1500,
      "currency": "UGX",
      "rate": 1,
      "account_id": 18,
      "account_type": "MobileMoneyPayoutAccount",
      "transfer_type": "WITHDRAW",
      "created": "2017-07-01T11:27:21+0000",
      "modified": "2017-07-01T11:44:42+0000",
      "status": "PENDING",
      "merchant_id": 1368,
      "merchant_reference": "1498908373",
      "customer_phone": "256704543171",
      "customer_name": "Hillary.N"
  }
}

This API allows you to details about a transaction. You can use this to get the status of the transation when the IPN fails

Request Method

POST

Request Data Type

application/json

Response Data Type

application/json

Bank Payouts API

Send Funds To Bank (Withdraw to Bank)

Live URL
https://dusupay.com/merchant-api/payout/bank/sendFromSubAccount.json

Sandbox URl
http://sandbox.dusupay.com/merchant-api/payout/bank/sendFromSubAccount.json
Sample Request Data

{
    "merchant_id": 10248,
    "amount": 100,
    "currency": "NGN",
    "account_number": "0044823848",
    "account_name": "AccountName",
    "bank_code": "058",
    "country": "NG",
    "phone": "256704543171",
    "merchant_reference": "1496773894",
    "timestamp": 1496773894,
    "signature": "b912deefb6ecbb0cb861f1fe5c7b3bc83aaa98a5"
}
Example Response

{
  "response": {
    "id": 16,
    "amount": 100,
    "charge": 500,
    "currency": "NGN",
    "account_id": 8,
    "account_type": "BankPayoutAccount",
    "transfer_type": "WITHDRAW",
    "created": "2017-06-06T18:42:03+0000",
    "modified": "2017-06-06T18:42:03+0000",
    "transaction_status": "PENDING",
    "status": true,
    "message": "Request Sent"
  }
}

This API allows you to send Funds from your Merchant Bank SubAccount to the receipients Bank Account for the supported banks.

Request Method

POST

Request Data Type

application/json

Response Data Type

application/json

Request Field Description
merchant_id Your MerchantId (int)
amount Amount to be paid (float) (2 Decimal e.g 25.00, 25.03)
currency Currency to be paid (ISO3 String). This defines which BankSubAccount will be debited
account_number Customer/Account Number (String)
account_name Customer/Account name (String)
bank_code Supported Bank Code/Id from the banks available (String)
country Supported Bank Country (String)
phone Customer PhoneNumber (String)
merchant_reference Optional Unique Transaction Reference from your web-app (String - 32 MAX-Length)
timestamp UNIX Timestamp (Integer)
signature Request Signature (String)

Generate Request Signature

<?php
    // Generate Request Data
    // =======================

    // Create Data Array
    $requestData = [
        'merchant_id'=>'Your Merchant ID',
        'amount'=>100,
        'currency'=>'NGN',
        'account_number'=>'Receipient Account Number',
        'account_name'=>'Receipient Account Number Name',
        'bank_code'=>'058',
        'country'=>'NG',
        'phone'=>'256704543171',
        'timestamp'=>time(),
    ];

    // Generate Request Signature
    $requestData['signature'] = getSignature($requestData,'Your Merchant MacKey');

    // Function to generate request signature
    function getSignature($requestData, $merchantMackey){
        ksort($requestData);
        $stringData = '';
        foreach ($requestData as $key => $value) {
            if(in_array($key, ['signature'])) continue;
            $stringData .= $value;
        }
        return hash_hmac('sha1', $stringData, $merchantMackey);
    }
?>

To Generate a request Signature Please follow the steps below

step1 Get Your Merchant MacKey from your merchant account page

step2 Create an array of the data to be posted excluding the {signature} array key

step3 ksort the data array generated from step2. This arranges the ArrayKeys in ASCENDING Order

step4 Join the data array values into one string with no space

step5 Create the Signature like hash_hmac(‘sha1’, {joinedString}, {Mackey})

step6 Include the {signature} key to the request data

Note An Example of this implementation has been included in the sample on the right

Get Countries Supported

    Live URL
    https://dusupay.com/merchant-api/payout/bank/getSupportedCountries/{country}.json

    Sandbox URl
    http://sandbox.dusupay.com/merchant-api/payout/bank/getSupportedCountries/{country}.json
    Sample Response
    {
        "response": {
            "countries": [
                "NG",
                "KE"
            ]
        }
    }

This API will help you get a list of the countries supporting bank payouts.

Request Method

GET

Request Data Type

application/json

Response Data Type

application/json

Get Banks Supported

    Live URL
    https://dusupay.com/merchant-api/payout/bank/getSupportedBanks/{country}.json

    Sandbox URl
    http://sandbox.dusupay.com/merchant-api/payout/bank/getSupportedBanks/{country}.json

    Default Country
    NG - Nigeria
    Sample Response
    {
        "response": {
            "banks": {
                "401": "ASO Savings and \u0026 Loans",
                "044": "Access Bank",
                "323": "Access Money",
                "317": "Cellulant",
                "303": "ChamsMobile",
                "023": "CitiBank"
            }
        }
    }

You can fetch a list of the banks supported per country supported

Request Method

GET

Request Data Type

application/json

Response Data Type

application/json

IPN - Payout Status(IPN) Webhook(URL)

sample IPN Message

{
    "id": 16,
    "amount": 100,
    "charge": 500,
    "currency": "NGN",
    "rate": 1,
    "account_id": 8,
    "account_type": "BankPayoutAccount",
    "transfer_type": "WITHDRAW",
    "created": "2017-06-06T18:42:03+0000",
    "modified": "2017-06-06T18:42:03+0000",
    "status": "COMPLETE",
    "merchant_id": 1368,
    "merchant_reference": "1496774417",
    "customer_phone": "256704543171",
    "customer_name": "ACCOUNT HOLDER NAME",
    "customer_bank_account": "0044823999",
    "customer_bank_name": "GTBank Plc"
}

Simply set the `Payout Status(IPN) Webhook(URL)` url under your merchant account settings

Request Method

POST

Content-Type

application/json You need to set the content type in your account settings

Default Content-Type

multipart/form-data

Field type Description
id int e.g 12 Unique ID for the payment made
amount float e.g 10 Amount transfered
charge float e.g 13.5694 Charge by dusupay
currency string e.g USD Currency of the Amount/Charge
account_id int e.g 6 SubAccount account id
account_type string e.g BankPayoutAccount SubAccount account type
transfer_type string e.g WITHDRAW Transfer Type
created string e.g 2017-05-10T09:19:13+0000 Date the transaction was created
modified string e.g 2017-05-10T09:23:13+0000 Date the transaction was modified
status string e.g COMPLETE New Transaction status
merchant_id int e.g 1234 Merchant Account Id
merchant_reference string e.g P34KRe4 MAX_LENGTH = 32 Unique Transaction ID from your WebApp. This will be returned in the IPN as-well. Therefore you can use it to complete the transaction on your side.
customer_phone string e.g 256704543171 Customer Phone
customer_name string e.g Hillary Customer Name
customer_bank_account string e.g 334343 Bank Account
customer_bank_name string e.g Eco Bank Bank Name

Get Bank Payout Transaction

Live URL
https://dusupay.com/merchant-api/payout/bank/getTransaction.json

Sandbox URl
http://sandbox.dusupay.com/merchant-api/payout/bank/getTransaction.json
Sample Request Data
{
    "id": 16,
    "merchant_id": 1368,
    "timestamp": 1499435222,
    "signature": "caf0923d81ae0489da907523aec38b0f0ed103f7"
}
Example Response
{
    "response": {
        "id": 16,
        "amount": 100,
        "charge": 500,
        "currency": "NGN",
        "rate": 1,
        "account_id": 8,
        "account_type": "BankPayoutAccount",
        "transfer_type": "WITHDRAW",
        "created": "2017-06-06T18:42:03+0000",
        "modified": "2017-06-06T18:42:03+0000",
        "status": "COMPLETE",
        "merchant_id": 1368,
        "merchant_reference": "1496774417",
        "customer_phone": "256704543171",
        "customer_name": "ACCOUNT HOLDER NAME",
        "customer_bank_account": "0044823999",
        "customer_bank_name": "GTBank Plc"
    }
}

This API allows you to details about a transaction. You can use this to get the status of the transation when the IPN fails

Request Method

POST

Request Data Type

application/json

Response Data Type

application/json

Direct Collections API

Mobile Money

Live URL
https://dusupay.com/merchant-api/collections/mobile/requestPayment.json

Sandbox URl
http://sandbox.dusupay.com/merchant-api/collections/mobile/requestPayment.json
Sample Request Data
{
    "dusupay_amount": 1000,
    "dusupay_currency": "UGX",
    "dusupay_merchantId": "1368",
    "dusupay_transactionReference": "MYREF",
    "dusupay_customerPhone": "256704543171",
    "dusupay_transactionTimestamp": 1497509797,
    "dusupay_successURL":"(optional)https://domain.com/myIPNCallbackURL",
    "dusupay_itemId": "(optional)ItemId from your system",
    "dusupay_itemName": "(optional)ItemName being paid for from your system",
    "dusupay_customerName": "(Optional)CustomerName. Will be indicated under your payments",
    "dusupay_customerEmail": "(optional)CustomerEmail",
    "signature": "2f6c6e75bccbbb37ebc94f502a3ad5dc454a6ef6"
}
Example Response

{
    "response": {
        "status": true,
        "message": "",
        "data": {
            "dusupay_transactionId": "1170816103501256704543171",
            "dusupay_amount": 1000,
            "dusupay_currency": "UGX",
            "dusupay_itemId": "1502922901",
            "dusupay_transactionReference": "MYREF",
            "dusupay_charge": 750,
            "dusupay_chargeCurrency": "UGX",
            "dusupay_transactionStatus": "PENDING",
            "date": "2017-08-16T22:35:01+0000",
            "status": "success",
            "customer_id": "150406101554-256704543171",
            "customer_name": "Hillary Namanya NHills",
            "customer_email": "namanyahillary@gmail.com",
            "customer_phone": "256704543171"
        }
    }
}

NB. when you are ready to go live, you will need to contact us to enable you access to this API.

This API allows you to directly request funds from the customer’s phone number.
The customer will recieve a prompt on their mobile money network to confirm the transaction.
Once the transaction has been completed, you will receive an IPN call to the url set in the dusupay_successURL parameter



Collection Requests in Sandbox complete immediately, but you will still receive an http call to the url provided in the dusupay_successURL.

Collection Requests in Production are asynchronous as described below
1. Payment is created in a PENDING state,
2. You receive the payment request payload as the response to the API Call made.
3. Customer Recieves a prompt on their mobile phone within 5 seconds to confirm the payment.
4. Customer completes/confirms the payment on their phone and we COMPLETE it on dusupay too.
5. We then make an http call to the url you provided in the dusupay_successURL parameter

Request Method

POST

Request Data Type

application/json

Response Data Type

application/json

Generate Request Signature

<?php
    // Generate Request Data
    // PHP Example
    // =======================

    // Create Data Array
    $requestData = [
        'dusupay_amount'=>1000,
        'dusupay_currency'=>'UGX',
        'dusupay_merchantId'=>'1368',
        'dusupay_transactionReference'=>'MYREF',
        'dusupay_customerPhone'=>'256704543171',
        'dusupay_transactionTimestamp'=>1497509797,
        // 'dusupay_successURL'=>'optional',
        // 'dusupay_itemId'=>'optional',
        // 'dusupay_itemName'=>'optional',
        // 'dusupay_customerName'=>'optional',
        // 'dusupay_customerEmail'=>'optional',
    ];

    // Generate Request Signature
    $requestData['signature'] = getSignature($requestData,'Your Merchant MacKey');

    // Function to generate request signature
    function getSignature($requestData, $merchantMackey){
        ksort($requestData);
        $stringData = '';
        foreach ($requestData as $key => $value) {
            if(in_array($key, ['signature'])) continue;
            $stringData .= $value;
        }
        return hash_hmac('sha1', $stringData, $merchantMackey);s
    }
?>

To Generate a request Signature Please follow the steps below

step1 Get Your Merchant MacKey from your merchant account page

step2 Create an array of the data to be posted excluding the {signature} array key

step3 ksort the data array generated from step2. This arranges the ArrayKeys in ASCENDING Order

step4 Join the data array values into one string with no space

step5 Create the Signature like hash_hmac(‘sha1’, {joinedString}, {Mackey})

step6 Include the {signature} key to the request data

Note An Example of this implementation has been included in the sample on the right

Transaction/Request statuses

Status Meaning
PENDING Transaction is pending.
COMPLETE Transaction completed successfully.
NOTVERIFIED Transaction completed but waiting user validation via phone and email. Status will change to either REFUNDED or COMPLETE
REFUNDED Transaction was detected as a fraud transaction. Cash was refunded.
FAILED Transaction failed.
CANCELLED Transaction was cancelled
INVALID Transaction may not have been found.
true Request was successful.
false Request failed.

Payment Process Flow

This expected payment flow helps to give you a picture of how the payment process starts and finishes af integration completely

Dusupay Buttons

The Dusupay Provied the following payment buttons:

File name Button
dusupaybtn6.png DusuPay
dusupaybtn1.png DusuPay
dusupaybtn2.png DusuPay
dusupaybtn3.png DusuPay
dusupaybtn4.png DusuPay
dusupaybtn5.png DusuPay

Plugins And Libraries

Plugins

Platform Price Download Link
Woocommerce 5.99 GBP Download Now
Opencart 9.99 GBP Download Now