Get started by learning how to integrate DirectPay into your application. After finishing this guide you will be able to initiate transfer payments from your customer's bank account seamlessly.
To integrate Directpay into your web or mobile app, the following steps need to be taken:
- Initiate the payment request.
- Await and confirm payment from the Customer.
- Track or verify payment.
You need to initiate the payment request via the API or Mono connect widget, which begins the payment process.
To initiate a one-time payment, an amount, type (i.e., onetime-debit), description, reference, account id (not required), and redirect URL can all be populated on the Initiate endpoint. Once all is provided, a payment link is generated, which your customers open in their browsers or on your mobile app in form of a web view.
NOTE ON THE REDIRECT_URL FIELD
The customer will be redirected to the redirect URL after a successful or failed attempt, the URL includes the reference that was passed when initializing the widget and status and reason in case of failure.
Once the payment initiation has been created, the payment request needs to be presented to the consumer in order to allow them to select their bank and authorize the payment. If the account id of a customer who is already linked to Mono connect is already present in the initiate endpoint above, they will be presented with an authorisation screen to input their OTP, token, pin etc immediately after the screen loads without them having to select bank and log in again.
There are two ways this can be achieved.
a. Mono automatically sends a live direct_debit.payment_successful event of a transaction, to the webhook URL added to your app on the Mono Dashboard. The payload of this webhook contains the Customer's Account ID, transaction amount, transaction time, reference, transaction status etc.
b. With our Verify payment status API, you can trigger manually the status of a particular transaction via the reference which you've initially set on the Initiate endpoint. Once called, we provide all necessary payment information pertaining to a transaction as already highlighted in a. above.
- No webhook event will be sent until the payment process is completed end-to-end be it a successful or a failed transaction.
- If the transaction process is not completed end-to-end, the verify endpoint will return a message: Transaction with this reference could not be found
The Account ID field which can be found in the body params of our Initiate Payment API is what enables payments for returning users. Once the Account ID of an already connected account from Mono Connect is provided on the Payment Initiation API (via account), your users or customers wouldn’t need to sign into the DirectPay Widget.
All that would be required of them would be to authorise the payment with their PIN, password or token on the payment widget. With this, the process of collecting payment from your customer's bank account is done with ease.
The following steps explain how this can be achieved:
- Onboard your customers via Mono Connect.
- Initiate payments via Customer's Account ID.
To set up payment for returning users, it is important to firstly set up Mono connect on your end. The guide here gives a comprehensive step-by-step process on how to integrate Mono Connect so that you can get your customer's account ID.
With step 1 out of the way, you can proceed to initiate payment with our Initiate a Payment API. In this step, you get to pass your account id as received above to the body request, alongside other info like amount, type, description, reference etc
With the payment link now generated, you can await and confirm payment from your Customer as they would be automatically signed in the payment widget while we await for them to authorise. Tracking and verifying payments can still be achieved as explained in steps 2 and 3 at the top.
Updated about 2 months ago
Learn how to initiate payment via API or widget