Skip to content

Provider-Specific Options

Sanwo’s unified API covers the options that every provider shares: amount, currency, customer, reference, channels, and metadata. But each provider also has features unique to it – subscription plans, split payments, checkout customizations, and more.

You can access these through provider-specific options without losing portability. If you later switch providers, these options are silently ignored rather than causing errors.

The mechanism differs slightly by platform.

Use the sanwoProviderOptions field inside your checkout options. It accepts any key-value pairs, which are forwarded directly to the underlying provider SDK.

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
// These are passed through to the provider SDK as-is
channels: ["card", "bank_transfer"],
},
});

Some common provider options like channels are available as typed fields on CheckoutOptions. For everything else, use the extra map:

final result = await sanwo(
context: context,
options: CheckoutOptions(
amount: 500000,
currency: 'NGN',
customer: CheckoutCustomer(email: 'customer@example.com'),
channels: ['card', 'bank_transfer'],
extra: {'subaccount': 'ACCT_xxxxxxxxxxxx'},
),
);

On native mobile SDKs, provider-specific fields like channels, extra, and method are available as flat properties on CheckoutOptions. The exact fields vary by platform – see the iOS and Android SDK docs.

Limit which payment methods appear in the checkout:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
channels: ["card", "bank_transfer"],
},
});

Available channels: card, bank, ussd, qr, mobile_money, bank_transfer, eft.

Charge a customer on a recurring Paystack plan:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
plan: "PLN_xxxxxxxxxxxx",
quantity: 1,
},
});

Route part of the payment to a subaccount:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
subaccount: "ACCT_xxxxxxxxxxxx",
},
});

You can also use splitCode for pre-configured split groups or an inline split object for dynamic splits. See the Paystack provider page for full details.

Brand the Flutterwave checkout modal with your store name and logo:

const result = await sanwo({
amount: 250000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
customizations: {
title: "My Store",
description: "Order #1234",
logo: "https://mystore.com/logo.png",
},
},
});

Set up recurring billing with a Flutterwave payment plan:

const result = await sanwo({
amount: 100000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
paymentPlan: 123,
},
});

See the Flutterwave provider page for split payment configuration and additional options.

Razorpay recommends creating an order on your server and passing the orderId to prevent amount tampering:

const result = await sanwo({
amount: 50000,
currency: "INR",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
orderId: "order_xxxxxxxxxxxx",
},
});

Customize the Razorpay checkout colors:

const result = await sanwo({
amount: 50000,
currency: "INR",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
orderId: "order_xxxxxxxxxxxx",
theme: {
color: "#4f46e5",
},
},
});

See the Razorpay provider page for notes, image, and other options.

Monnify requires a contractCode for every transaction. This identifies your merchant contract:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
contractCode: "1234567890",
},
});

Interswitch requires a payItemId to identify the payment item:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
payItemId: "Default_Payable_MX_xxxxxxxxxxxx",
},
});

Here is a Paystack channels example on every platform:

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
channels: ["card", "bank_transfer"],
},
});

Provider-specific options are silently ignored when using a different provider. There are no errors and no crashes – the options simply have no effect.

const result = await sanwo({
amount: 500000,
currency: "NGN",
customer: { email: "customer@example.com" },
sanwoProviderOptions: {
// Paystack-specific: ignored if using Flutterwave
plan: "PLN_xxxxxxxxxxxx",
// Flutterwave-specific: ignored if using Paystack
customizations: { title: "My Store" },
},
});

This means you can safely include options for multiple providers in the same object if needed. Only the options relevant to the active provider take effect.

For a complete reference of each provider’s options, see the individual provider pages: