NGN Bank Transfers - Direct Charge
This is one of the ways to process NGN payments using bank transfers. The section below will guide you through the process of accepting NGN payments using the direct API method.
Workflow Overview
Study this diagram below to understand the customer journey workflow
When your customer is ready to make an NGN payment, you can make the initial collection API request to the gateway, for which an acknowledgement will be done with 202 HTTP response code (you can optionally store the references). Show the customer a loading screen.
If there are no issues with the request, the DusuPay platform will proceed to obtain virtual bank details and trigger the transaction.processing event callback/webhook as described in the steps below. Details (charge information + account details) from this payload can be displayed to the customer.
As a precaution, listen to the request.failed and transaction.failed event callbacks just in case the request fails before obtaining the bank details. The reason for failure would be part of the callback payload and it's recommended that it's displayed to the customer.
If there was no error, the customer can follow the instructions to transfer funds to the account.
On success, the bank would notify the DusuPay platform, which would in turn notify you the merchant via your configured callback URL. The customer can be show the success screen.
We recommend that this activity is tracked in your local/platform databases and poll for transaction status from your own data store and update the user interface accordingly. The DusuPay platform automatically retries callbacks if your platform doesn't respond as expected.
Step 1: Obtain the required data for the payment request
The table below describes the request parameters that are used for the collection/charge request. Most/all will be collected from the paying customer.
merchant_reference
String
true
The unique reference for this request. It must be at least 8 characters long. Alternatively, the value auto can be passed, and a unique reference will be created for you by the API
transaction_method
String
true
The transaction method to be used. This will be BANK for this request
currency
String
true
The 3-character ISO currency code for the request currency
amount
Number
true
The amount being requested
customer_name
String
false
The name of the customer
customer_email
String
false
The email of the customer
description
String
true
The description/narration for the transaction. Between 10-30 characters
charge_customer
Boolean
false
Whether or not the customer should bear the charge for the transaction. By default, this is false to mean that the merchant bears the charge
allow_final_status_change
Boolean
false
Whether or not the final transaction status can be altered as described here. By default, this is true to mean DusuPay will alter the final transaction status under the circumstances described.
After collecting the necessary bank payment information from your customer, prepare your request payload as demonstrated below.
POST https://sandboxapi.dusupay.com/collections/initialize
The request is sent as a JSON body as demonstrated by the sample request below. Sample responses (acknowledgement and failure) are also shared.
Step 2: Handle the payment instructions webhook
If the request in step 1 is successful and responds with an acknowledgement (HTTP code 202), you should listen and handle the payment instructions webhook/callback. This will be sent to the collection callback URL that's configured on your merchant account. The callback is sent as a JSON POST request and the payload will help you determine the next course of action. Sample payloads below.
Details from the payload need to be displayed for the customer so they can execute the fund to the transfer. A few things to note;
You could directly display the content of the payment_instructions parameter OR implement a custom display using content in the sub_account_details object.
If the customer is bearing the transaction charge (
charge_customer=true), we recommend that you display the value in the transaction_charge so that the customer is aware of surcharge.
Step 3: Handle the final status webhook
Every merchant account is expected to have configured a callback/webhook URL for collections. For all collections that transition to the final state (COMPLETED, FAILED or CANCELLED), a JSON POST request will be made to the callback URL. Sample callback payloads (request bodies) are shared below. Be sure to check out Handling Notifications to see how you should verify the signature(s) in the request headers and how to respond.
We recommend that the webhook/callback requests are verified for authenticity using any of the described signature verification methods.
Last updated