Monnify
Provider ID: monnify
Monnify is a Nigeria-focused provider with strong bank transfer support. It expects amounts in major units (naira), but you still pass minor units (kobo) to Sanwo – the engine divides by 100 automatically.
Important: Monnify requires a contractCode in addition to your API key. You get this from the Monnify dashboard when you create a contract.
Installation
Section titled “Installation”npm i @sanwohq/monnifyflutter pub add sanwo_monnifyIn Xcode, go to File > Add Package Dependencies and add:
https://github.com/Sanwohq/iosSelect the SanwoMonnify product.
Add JitPack to settings.gradle.kts:
dependencyResolutionManagement { repositories { maven { url = uri("https://jitpack.io") } }}Then add the dependency in build.gradle.kts:
implementation("com.github.Sanwohq.android:sanwo-monnify:1.0.0")import { monnify } from "@sanwohq/monnify";
const provider = monnify({ apiKey: "MK_TEST_xxxxxxxxxxxx", contractCode: "1234567890",});Both apiKey and contractCode are required. Get them from the Monnify Dashboard.
Amount handling
Section titled “Amount handling”Monnify uses major units (naira) natively. Sanwo converts automatically (amountInMinorUnit: false internally).
| You pass | Monnify receives | Meaning |
|---|---|---|
500000 |
5000 |
5,000.00 NGN |
100 |
1 |
1.00 NGN |
You always pass minor units to Sanwo. The conversion is invisible to your code.
Supported currencies
Section titled “Supported currencies”NGN
Supported countries
Section titled “Supported countries”NG
Payment methods
Section titled “Payment methods”card, bank_transfer, ussd, phone_number
Provider-specific options
Section titled “Provider-specific options”Pass these via sanwoProviderOptions on web/React, or as flat fields on Flutter and mobile SDKs.
| Option | Type | Required | Description |
|---|---|---|---|
contractCode |
string |
Yes | Monnify contract code (set during provider init) |
redirectUrl |
string |
No | URL to redirect the customer after payment |
paymentMethods |
string[] |
No | Restrict available methods |
isTestMode |
boolean |
No | Use Monnify sandbox environment |
Available paymentMethods values
Section titled “Available paymentMethods values”"CARD", "ACCOUNT_TRANSFER", "USSD", "PHONE_NUMBER"
Usage examples
Section titled “Usage examples”Basic checkout
Section titled “Basic checkout”const result = await checkout({ amount: 500000, currency: "NGN", customer: { email: "customer@example.com" },});The contractCode is already set on the provider, so no extra options are needed for a basic payment.
final result = await sanwo.checkout( CheckoutOptions( amount: 500000, currency: 'NGN', customer: Customer(email: 'customer@example.com'), ),);Restrict to bank transfer only
Section titled “Restrict to bank transfer only”const result = await checkout({ amount: 500000, currency: "NGN", customer: { email: "customer@example.com" }, sanwoProviderOptions: { paymentMethods: ["ACCOUNT_TRANSFER"], redirectUrl: "https://example.com/payment/callback", },});final result = await sanwo.checkout( CheckoutOptions( amount: 500000, currency: 'NGN', customer: Customer(email: 'customer@example.com'), paymentMethods: ['ACCOUNT_TRANSFER'], redirectUrl: 'https://example.com/payment/callback', ),);Test mode
Section titled “Test mode”import { monnify } from "@sanwohq/monnify";
const provider = monnify({ apiKey: "MK_TEST_xxxxxxxxxxxx", contractCode: "1234567890", isTestMode: true,});Use isTestMode: true during development. Test credentials are available in the Monnify Developer Portal.