Squad Payment Modal
Last updated
Last updated
Squad Payment Modal provides an easy and convenient payment flow. It is the simplest way to securely collect payments from your customers without them leaving your website. The customer will be shown all the payment methods you have selected.
It can be integrated with simple steps, by copying the code in the embedded section and pasting it on your page; making it the easiest way to accept payments. It works across devices and can help increase your conversion.
To initialize a transaction, you need to pass details such as email, first name, last name, amount, transaction reference, etc. Email, amount, and currency are required. You can also pass any other additional information in the metadata
object field. The following is a complete list of parameters that you can pass:
The customer information can either be retrieved from a form, or from your database if you already have it stored. (Example below)
When the customer clicks on the submit
button, initiate a transaction by passing the necessary details (email, amount, and any other parameters) to Squad through to a JavaScript function.
A checkout modal will pop-up with different payment options for the customer to choose and input their payment information to complete the transaction.
The key
field takes your Squad key.
By default, the amount
field is already set in the lowest currency unit (kobo, cent). That is, to pay NGN100, you have to enter 10000 in the amount field.
To convert amount
to the base currency (Naira, Dollar), multiply the amount parameter by 100
in your code, amount: document.getElementById("amount").value * 100, This will allow you enter the amount in Naira or Dollar as the case may be.
After initialization, there are a couple of payment channels available to the customer to complete the transaction.
The USSD channel allows your Nigerian customers to pay you by dialing the USSD code on their mobile devices. Nigerian banks provide USSD services for customers to use for transactions, and we have integrated with some of these banks to allow your customers to complete payments.
After dialing the USSD code displayed, the system will prompt the user to input the USSD PIN to authenticate the transaction and then confirm it. All that is needed to initiate USSD payment is the customer's email and the amount to be charged. When the user makes a payment, the response will be sent to your webhook.
Therefore, to make it work as expected, webhooks must be configured on your Squad dashboard.
Here is a list of all the Banks USSD shortcodes
we currently support:
Squad provides a payment method that makes it possible for customers to pay you through a direct bank account transfer. The customer provides their name, phone number, and email address. Then a preset account number is displayed along with the preregistered bank name.
With Squad, customers can pay with Card provided their card details are correct and updated. The customer provides their card number, card expiry date, and CVV.
Create a free Squad sandbox account and get your test keys from the dashboard.
Copy the code sample from the Code Glossary of this documentation unto a text editor of your choice.
Save the document as .html
file. For example index.html
With an internet-enabled device, view the .html
file (index.html) using any web server of your choice either local (WAMP, XAMPP, etc) or online.
To go live on the payment modal, simply change the test key to the live key found in your Squad dashboard.
PARAMETERS
REQUIRED?
DESCRIPTION
key
Yes
Your Squad public key. Use the test key found in your Sandbox account in test mode, and use the live key found in your Squad dashboard in live mode.
Yes
Customer's email address.
amount
Yes
The amount you are debiting customer (expressed in the lowest currency value - kobo
& cent
).
transaction_ref
No
Unique case-sensitive transaction reference. If you do not pass this parameter, Squad will generate a unique reference for you.
currency_code
Yes
The currency you want the amount to be charged in. Allowed value is NGN or USD
.
payment_channels
No
An array of payment channels to control what channels you want to make available for the user to make a payment with. Available channels include; ['card'
, 'bank'
,
'ussd'
,'transfer'
]
customer_name
No
Name of Customer
callback_url
No
Sample: https://squadco.com
metadata
No
Object that contains any additional information that you want to record with the transaction. The custom fields in the object
will be returned via webhook and the payment verification endpoint.
pass_charge
No
It takes two possible values: True or False. It is set to False by default. When set to True, the charges on the transaction is computed and passed on to the customer(payer). But when set to False, the charge is passed to the merchant and will be deducted from the amount to be settled to the merchant.
Bank
USSD Shortcode
Access (Diamond) Bank
426
Access Bank
901
EcoBank
326
First City Monument Bank (FCMB)
329
Fidelity Bank
770
First Bank
894
Guaranty Trust
737
Heritage Bank
745
Keystone Bank
7111
Rubies (Highstreet) MFB
779
Stanbic IBTC Bank
909
Sterling Bank
822
United Bank for Africa (UBA)
919
Union Bank
826
Unity Bank
7799
VFD Bank
5037
Wema Bank
945
Zenith Bank
966