Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejson
{
    "authorizedAmount": 30,
    "paymentStatus": "USER_CANCELLED",
    "redirectUrl": null,
    "responseCode": "USER_CANCELLED",
    "responseMessage": "User cancelled Transaction"
}

Field Reference

...

Field

(M) indicates fields that are mandatory in the body

...

Field

...

Description

...

amount (M)

...

This shows the description for the fields in the request body.

Field

Mandatory(M)/Optional(O)

Description

amount

M

The amount be paid by the customer

amountPaid

The actual amount paid by customer

currency (M)

currency

M

The currency of the transaction being initialized

. "NGN"

reference (M)

Merchant's Unique (

(“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 

customerName

M

)

Full (

This field contains the full name of the customer

customerEmail 

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)

apiKey

M

Merchant’s API Key

contractCode

M

Merchant’s Contract Code

paymentDescription

M

Description for the transaction. Will be used as the account name for bank transfer payments

paymentStatus (M)

Status of the transaction ("PAID", "PENDING" or "FAILED")

incomeSplitConfig 

incomeSplitConfig

O

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.

onLoadStart

O

This allows you the flexibility of performing an action when the SDK is about to start

onLoadComplete

O

This allows the flexibility of performing an action when the SDK has been loaded fully and payment methods displayed

onComplete

O

This field allows you to implement what should happen when a transaction is completed

onClose

O

This field allows you to implement what should happen when the modal is completed

...

How to Migrate from Version 1 to Version 2

...

Code Block
languagejs
<script type="text/javascript" src="https://sdk-v2.monnify.com/plugin/monnify.js"></script>

2. OnLoadStart function was added

This allows you the flexibility of performing an action when the SDK is about to start. You can define whatever trigger you want to happen when the SDK is about to be launched.

Code Block
languagejs
  ...
  onLoadStart: () => {
    console.log("loading has started");
  },

3. OnLoadComplete function was added

This allows the flexibility of performing an action when the SDK has been loaded fully and payment methods displayed. You can define whatever trigger you want to happen immediately after the SDK has loaded fully.

4. Two new payment methods were added

The newly added payment methods are Pay with Phone Number and Pay with USSD. Version 2 has four(4) payment methods available for collections; 

...

Code Block
languagejs
...
paymentMethods: [
    "USSD",
    "PHONE_NUMBER"
],
onComplete: function(response) {
    console.log(response);
},

5. The

...

isTestMode field has been removed from version 1 which was used to indicate your active environment (whether live or test). The active environment will be automatically detected using the apiKey specified by you in the javascript snippet.

...