Francophone Mobile Money
Learn about Mobile Money support in Francs.
Getting Started
We recommend checking out the introductory section to understand the basics of direct charge first. This guide assumes you’ve read that.
If you're collecting money in francs (XAF
or XOF
), your customers can pay with mobile money services.
The Process
This involves the following steps:
- You call our API to create a charge and pass in the customer's mobile number.
- Your customer completes the payment by authorizing it with their mobile money provider.
Initiating the Payment
To create a mobile money charge for a customer in a Francophone country, you'll need the customer’s valid phone_number
along with the following required parameters:
amount
currency
email
country
network
tx_ref
(Unique transaction reference)
You can also specify additional details, such as the customer's fullname
, redirect_url
, and custom meta
information. For more information on each parameter and its definition, refer to the endpoint documentation.
Country Codes
Only ISO 3166 Alpha-2 codes are supported as the country param. You can get a full list here. Possible values are
CM
(Cameroon),SN
(Senegal),BF
(Burkina Faso) andCI
(Côte d'Ivoire).
// Install with: npm i flutterwave-node-v3
const Flutterwave = require('flutterwave-node-v3');
const flw = new Flutterwave(
process.env.FLW_PUBLIC_KEY,
process.env.FLW_SECRET_KEY
);
const payload = {
phone_number: '24709929220',
amount: 1500,
currency: 'XAF',
country: 'CM',
email: '[email protected]',
tx_ref: this.generateTransactionReference(),
};
flw.MobileMoney.franco_phone(payload).then(console.log).catch(console.log);
// Install with: composer require flutterwavedev/flutterwave-v3
$flw = new \Flutterwave\Rave(getenv('FLW_SECRET_KEY'));
// Set `PUBLIC_KEY` as an environment variable
$mobileMoneyService = new \Flutterwave\MobileMoney();
$payload = [
"type" => "mobile_money_franco"
"phone_number" => '24709929220',
"amount" => 1500,
"currency" => 'XAF',
"country": 'CM',
"email" => '[email protected]',
"tx_ref" => $this->generateTransactionReference(),
];
$response = $mobileMoneyService->mobilemoney($payload);
print_r($response);
# Install with: gem install flutterwave_sdk
require 'flutterwave_sdk'
flw = Flutterwave.new(ENV["FLW_PUBLIC_KEY"], ENV["FLW_SECRET_KEY"], ENV["FLW_ENCRYPTION_KEY"])
charge = MobileMoney.new(flw)
payload = {
phone_number: '24709929220',
amount: 1500,
currency: 'XAF',
country: 'CM',
email: '[email protected]',
tx_ref: generate_transaction_reference,
}
response = charge.initiate_charge payload
print response
curl --request POST \
--url https://api.flutterwave.com/v3/charges?type=mobile_money_franco \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--header 'content-type: application/json' \
--data '{
"phone_number": "24709929220",
"amount": 1500,
"currency": "XAF",
"country": "CM",
"email": "[email protected]",
"tx_ref": "BJUYU399fcd43"
}'
Supported networks
Flutterwave helps you charge customers across various networks. You need to specify the network in your request when initiating the mobile money charge. Here is a list of supported networks across our markets:
Country | Country code | Currency | Supported Networks |
---|---|---|---|
Burkina Faso | BF | XOF | orangemoney , mobicash |
Cameroon | CM | XAF | mtn , orangemoney |
Côte D'Ivoire | CI | XOF | mtn , orangemoney , moov , wave |
Senegal | SN | XOF | mtn , emoney , freemoney , wave |
Handling the Response
You'll get a response that looks like this:
{
"status": "success",
"message": "Charge initiated",
"data": {
"id": 2079825,
"tx_ref": "MC-15852113s09v5050e8",
"flw_ref": "YVOO069611620649860887",
"device_fingerprint": "N/A",
"amount": 1500,
"charged_amount": 1500,
"app_fee": 481.5,
"merchant_fee": 0,
"processor_response": "Transaction in progress",
"auth_model": "AUTH",
"currency": "XAF",
"ip": "::ffff:10.63.255.131",
"narration": "MerchantName",
"status": "pending",
"payment_type": "mobilemoneysn",
"fraud_status": "ok",
"charge_type": "normal",
"created_at": "2021-05-10T12:30:57.000Z",
"account_id": 732559,
"customer": {
"id": 843193,
"phone_number": "237******20",
"name": "Anonymous customer",
"email": "[email protected]",
"created_at": "2021-05-10T12:30:56.000Z"
}
},
"meta": {
"authorization": {
"mode": "callback",
"redirect_url": null
}
}
}
The meta.authorization.mode
field is "callback"
, which means the user needs to authorize their mobile money service, and then we'll send you a webhook.
Completing the Payment
To complete the payment, the customer needs to be authorized with their mobile money provider (for instance, via a push notification from the app).
Testing Tip
In Test Mode, Francophone mobile money transactions are automatically completed after a few seconds.
When the payment is completed, we'll send you a webhook notification. Here's what the response would look like:
{
"event": "charge.completed",
"data": {
"id": 2073992,
"tx_ref": "MC-15852113s09v5050e8",
"flw_ref": "YVOO069611620649860887",
"device_fingerprint": "N/A",
"amount": 1500,
"currency": "XAF",
"charged_amount": 1500,
"app_fee": 481.5,
"merchant_fee": 0,
"processor_response": "Approved",
"auth_model": "MOBILEMONEY",
"ip": "::ffff:10.30.86.54",
"narration": "MerchantName",
"status": "successful",
"payment_type": "mobilemoneysn",
"created_at":"2021-05-07T09:48:13.000Z",
"account_id": 732559,
"meta": null,
"customer":{
"id": 841600,
"name": "Anonymous Customer",
"phone_number": "237******20",
"email": "[email protected]",
"created_at":"2021-05-07T09:48:13.000Z"
}
}
In your webhook handler, you can then verify the payment and credit your customers with whatever they paid for. See our guide to transaction verification for details.
Updated 4 days ago