Hosted Payment Page

It's highly recommended to use this method to collect funds using mobile money.

Follow the steps below to collect funds using HPP.

1. Set Payment Method

MOBILE_MONEY is the value to be set for the parameter, method in the request collection body. For Hosted Payment Page payments, we expect you to provide a, redirect_url where we will redirect the customer when they complete or cancel the transaction once you have redirected them to the payment_url we will return.

{
  ...
  "method": "MOBILE_MONEY",
  "redirect_url": "https://my-domain.com/redirect_url"
  ...
}

payment_url will be returned which you will redirect the customer to complete the payment

{
  ...
  "payment_url": "https://sandbox.dusupay.com/v1/completepayment",
  ...
}

3. Redirect customer

Whenever a payment_url is returned in any response body, you are expected to redirect the customer to it for them to be able to complete the transaction initiated.

Mobile Money Collection API

POST https://sandbox.dusupay.com/v1/collections

Headers

Request Body

{
    "code": 202,
    "status": "accepted",
    "message": "Transaction Initiated",
    "data": {
        "id": 615616,
        "request_amount": 7,
        "request_currency": "USD",
        "account_amount": 26632.8249,
        "account_currency": "UGX",
        "transaction_fee": 1038.6802,
        "total_credit": 25594.1447,
        "provider_id": "mtn_ug",
        "merchant_reference": "xxxxxxxx8",
        "internal_reference": "DUSUPAY5FNZFYCL9WKX47F",
        "payment_url": "https://sandbox.dusupay.com/v1/complete-payment/DUSUPAY5FNZFYCL9WKX47F/mobile_money",
        "transaction_status": "PENDING",
        "transaction_type": "collection",
        "message": "Transaction Initiated",
        "instructions": [
            {
                "step_no": "1",
                "description": "Ensure that you have sufficient balance on your MTN Mobile Money account"
            },
            {
                "step_no": "2",
                "description": "Approve the payment request sent to your phone"
            }
        ],
        "customer_charged": false
    }
}

Last updated