Installing the Monnify SDK is very easy and can be completed in a couple of minutes. Simply follow the steps below:
You can simply copy the code snippet below and paste it in your website to install the Monnify SDK.
Once you've copied this code into your website, you can start receiving payments via Monnify immediately.
You will likely need to pass in your own values when initializing the SDK. Your contractCode, and apiKey can be found on your Monnify dashboard
When the transaction is completed, Monnify returns a response object to your onComplete function.
If a user cancels, Monnify returns the following response to your onClose function
We recommend that you always make a get transaction status call whenever a transaction is completed (or cancelled) before saving the transaction on your database. Monnify will also notify you via your webhook url of the status of any transaction.
Simulating Bank Transfers on the Sandbox
To simulate bank transfers on the Monnify Sandbox environment you can use our Banking App Web Simulator. Click here to view the banking app simulator
(M) indicates fields that are mandatory in the request body
|amount (M)||The amount to be paid by the customer|
|currency (M)||The currency of the transaction being initialized. "NGN"|
|reference (M)||Merchant's Unique reference for every transaction. (The SDK already has a code snippet that generates this for you, but you can always replace it)|
|customerName (M)||Full name of the customer|
|customerEmail (M)||Email address of the customer|
|customerMobileNumber (M)||Phone number of the customer|
|apiKey (M)||Merchant's API Key (Can be found on the Monnify dashboard)|
|contractCode (M)||Merchant's contract code (Can be found on the Monnify dashboard)|
|paymentDescription (M)||Description for the transaction. Will be used as the account name for bank transfer payments|
|isTestMode (M)||Should be set to true when using the sandbox and false when on production|
|transactionHash (M)||Transaction Hash added to transaction response for security purposes. Click here for information on how to calculate the hash value|
|paymentStatus (M)||Status of the transaction ("PAID", "PENDING" or "FAILED")|
|incomeSplitConfig||Object containing specifications on how payments to this reserve account should be split.|
|subAccountCode (m)||The unique reference for the sub account that should receive the split.|
|feeBearer||Boolean to determine if the sub account should bear transaction fees or not|
|feePercentage||The percentage of the transaction fee to be borne by the sub account|
|splitPercentage||The percentage of the amount paid to be split into the sub account.|
|paymentMethods||An array containing payment methods which will be displayed to select from. It's defaulted to both account and card payment methods.|