Transfers Checkout Guide

Here's how to add Transfers Checkout to your app or website

Installation

You can add Transfers Checkout to your project like this:

index.html
<script src="https://checkout.transfers.africa/lib/lib.bundle.js"></script>

If your project is a mobile app built with native technologies, you can use a Web View to load an HTML page that will have the above code.

Initialise

To initialise Transfers Checkout:

Transfers.init({
siteName: "<your site or app name>",
siteUrl: "<your site url>",
siteLogo: "<url to your logo>",
publicKey: "<your Transfers public key>"
})

Create transfer charge

To create a transfer charge to any bank account:

const result = await Transfers.charge({
amount: "<how much you want to charge in Naira>",
userId: "<a unique identifier for your user>",
destinationAccountNumber: "<recipient account number>",
destinationBankCode: "<recipient bank code>",
transactionReference: "<a unique identifier for your transaction>",
beneficiaryName: "optional: <the sender's full name if you want us to ensure that they're sending from their own bank account>"
});

You can retrieve a list of banks and their codes by making a GET request to https://checkout.transfers.africa/banks.json

You can also create a transfer charge to your pre-registered default settlement account:

const result = Transfers.chargeToDefaultAccount({
amount: "<how much you want to charge in Naira>",
userId: "<a unique identifier for your user>",
transactionReference: "<a unique identifier for your transaction>",
beneficiaryName: "optional: <the sender's full name if you want us to ensure that they're sending from their own bank account>"
})

Responses

If the transfer charge was successfully created, then result will be:

{ paymentId: "<the transaction reference you passed in earlier>"}

You shouldn't give your users value at this point. That should be done on the server-side and will be explained in the next section of this guide.

If the transfer charge fails or the user closes Transfers Checkout, then result will be:

null