Flutterwave
Accept payments across Africa via Flutterwave. Supports NGN, USD, GHS, KES, ZAR and more.
Connect Flutterwave
- Sign up at app.flutterwave.com
- Go to Settings → API Keys and copy your keys
- In NaijaBase: Project → Integrations → Flutterwave → Connect
- Enter Public Key, Secret Key, and Encryption Key
Create a payment
const nb = createClient(URL, KEY)
const { payment_url, reference } = await nb.integrations.payments.flutterwave.createPayment({
email: 'user@example.com',
amount: 5000, // NGN 5,000
currency: 'NGN',
callbackUrl: 'https://yourapp.com/verify',
customerName: 'John Doe'
})
// Redirect user to the payment page
window.location.href = payment_url
Verify payment
After Flutterwave redirects back to your callbackUrl, the URL will contain ?transaction_id=xxx&tx_ref=xxx.
// Verify by transaction ID (from redirect URL params)
const result = await nb.integrations.payments.flutterwave.verifyTransaction(transactionId)
// OR verify by reference (the tx_ref you generated)
const result = await nb.integrations.payments.flutterwave.verifyByReference(reference)
if (result.verified) {
console.log('Paid:', result.amount, result.currency)
// fulfil the order
}
Multi-currency payments
// USD payment
await nb.integrations.payments.flutterwave.createPayment({
email: 'user@example.com',
amount: 50,
currency: 'USD',
callbackUrl: 'https://yourapp.com/verify'
})
// Ghana cedis
await nb.integrations.payments.flutterwave.createPayment({
email: 'user@example.com',
amount: 100,
currency: 'GHS',
callbackUrl: 'https://yourapp.com/verify'
})
List transactions
const txns = await nb.integrations.payments.flutterwave.listTransactions({
limit: 20,
currency: 'NGN',
status: 'successful'
})
Check balance
const { balance, currency } = await nb.integrations.payments.flutterwave.getBalance()
// or: .getBalance('USD') for a specific currency
Resolve bank account
const { account_name } = await nb.integrations.payments.flutterwave.resolveBankAccount({
accountNumber: '0690000032',
bankCode: '044' // Access Bank
})
List banks
const banks = await nb.integrations.payments.flutterwave.listBanks()
// [{ name: 'Access Bank', code: '044' }, ...]
Flutterwave vs Paystack
| Feature | Paystack | Flutterwave |
|---|---|---|
| Nigerian cards | ✅ | ✅ |
| Bank transfer | ✅ | ✅ |
| Multi-currency | ❌ | ✅ |
| Pan-African | Limited | ✅ |
| USSD | ✅ | ✅ |
| Mobile money | ❌ | ✅ |
Use Paystack for NGN-only Nigerian apps.
Use Flutterwave for multi-currency or pan-African products.
Test card
Card number: 5531 8866 5214 2950
CVV: 564
Expiry: 09/32
PIN: 3310
OTP: 12345