Skip to main content
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 GHS, your customers can pay with Ghana mobile money services.

The Process

This involves the following steps:
  1. You call our API to create a charge and pass in the customer’s mobile number.
  2. Your customer completes the payment by authorizing it with their mobile money provider.
xaf_mono

Initiating the Payment

First, you’ll need the customer’s mobile money network (either "MTN", "VODAFONE", or "TIGO") and phone_number. Combine that with the rest of the payment details to create the payload and send it to our charge Ghana mobile money endpoint. You’ll need to specify amount, currency, email, country and a unique tx_ref. You can also specify more details, such as the customer’s fullname and custom meta information. See the endpoint documentation for details.
// 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: '054709929220',
    amount: 1500,
    currency: 'GHS',
    network: "TIGO",
    email: 'JoeBloggs@acme.co',
    tx_ref: this.generateTransactionReference(),
}
flw.MobileMoney.ghana(payload)
    .then(console.log)
    .catch(console.log);

Handling the Response

You’ll get a response that looks like this:
Success
{
  "status": "success",
  "message": "Charge initiated",
  "meta": {
    "authorization": {
      "redirect": "https://ravemodal-dev.herokuapp.com/captcha/verify/144:16cbc719bf66ded37d5522de185f6a58",
      "mode": "redirect"
    }
  }
}
The meta.authorization object contains the details needed to complete the transaction. The mode is "redirect", meaning you should redirect your customer to the provided URL to complete the payment.

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 TipIn Test Mode, you can complete the transaction by visiting the returned redirect URL and entering 123456 as the OTP.
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": "BJUYU399fcd43",
    "flw_ref": "flwm3s4m0c1620380894041",
    "device_fingerprint": "N/A",
    "amount": 1500,
    "currency": "RWF",
    "charged_amount": 1500,
    "app_fee": 43.5,
    "merchant_fee": 0,
    "processor_response": "Approved",
    "auth_model": "MOBILEMONEY",
    "ip": "::ffff:10.30.86.54",
    "narration": "MerchantName",
    "status": "successful",
    "payment_type": "mobilemoneyrw",
    "created_at":"2021-05-07T09:48:13.000Z",
    "account_id": 732559,
    "meta": null,
    "customer":{
      "id": 841600,
      "name": "Anonymous Customer",
      "phone_number": "054709929220",
      "email": "JoeBloggs@acme.co",
      "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.