Interswitch
Provider ID: interswitch
Interswitch is one of Nigeria’s oldest and most widely used payment processors, common in enterprise and government. It accepts amounts in minor units (kobo), which Sanwo passes through without conversion.
Important: Interswitch requires a payItemId for every transaction. You get this from the Interswitch developer portal when you register a payment item.
Installation
Section titled “Installation”npm i @sanwohq/interswitchflutter pub add sanwo_interswitchIn Xcode, go to File > Add Package Dependencies and add:
https://github.com/Sanwohq/iosSelect the SanwoInterswitch 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-interswitch:1.0.0")import { interswitch } from "@sanwohq/interswitch";
const provider = interswitch({ merchantCode: "MX_TEST_xxxxxxxxxxxx", payItemID: "Default_Payable_MX_xxxxxxxxxxxx",});Both merchantCode and payItemID are required. Get them from the Interswitch Developer Console.
Amount handling
Section titled “Amount handling”Interswitch uses minor units (kobo) natively. Sanwo passes values straight through.
| You pass | Interswitch receives | Meaning |
|---|---|---|
500000 |
500000 |
5,000.00 NGN (kobo) |
100 |
100 |
1.00 NGN |
Supported currencies
Section titled “Supported currencies”NGN
Supported countries
Section titled “Supported countries”NG
Payment methods
Section titled “Payment methods”card, bank_transfer, ussd, qr
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 |
|---|---|---|---|
payItemId |
string |
Yes | Payment item ID from Interswitch (set during provider init) |
payItemName |
string |
No | Display name for the payment item |
siteRedirectUrl |
string |
No | URL to redirect the customer after payment |
mode |
string |
No | "TEST" or "LIVE" |
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 merchantCode and payItemID are already set on the provider, so a basic checkout needs no extra options.
final result = await sanwo.checkout( CheckoutOptions( amount: 500000, currency: 'NGN', customer: Customer(email: 'customer@example.com'), ),);Custom payment item name and redirect
Section titled “Custom payment item name and redirect”const result = await checkout({ amount: 500000, currency: "NGN", customer: { email: "customer@example.com" }, sanwoProviderOptions: { payItemName: "Premium Subscription", siteRedirectUrl: "https://example.com/payment/complete", },});final result = await sanwo.checkout( CheckoutOptions( amount: 500000, currency: 'NGN', customer: Customer(email: 'customer@example.com'), payItemName: 'Premium Subscription', siteRedirectUrl: 'https://example.com/payment/complete', ),);Test mode
Section titled “Test mode”import { interswitch } from "@sanwohq/interswitch";
const provider = interswitch({ merchantCode: "MX_TEST_xxxxxxxxxxxx", payItemID: "Default_Payable_MX_xxxxxxxxxxxx", mode: "TEST",});Set mode: "TEST" during development. Switch to mode: "LIVE" with your production credentials when deploying. Test credentials are available in the Interswitch Developer Console.
Test card
Section titled “Test card”Use these credentials in test mode:
| Field | Value |
|---|---|
| Card Number | 5060 9905 8000 0021 7499 |
| Expiry | Any future date |
| CVV | 111 |
| PIN | 1234 |
| OTP | 123456 |