MTN MoMo

Configure and manage MTN MoMo payment method

MTN MoMo

MTN MoMo is a widely used mobile money service that allows users to store and transfer money, pay for goods and services, and access financial services using their mobile phones. By integrating MTN MoMo with PayOS, businesses can offer a secure and convenient payment option to their customers, facilitating real-time transactions and enhancing the overall payment experience.

Introduction

MTN MoMo, a mobile money service launched by MTN Group, operates primarily in several African countries. It is an essential payment method for businesses targeting markets in Africa where mobile money services are extensively used. Integrating MTN MoMo with PayOS allows you to accept payments, initiate transfers, and manage financial transactions efficiently. This guide provides a comprehensive overview of how to integrate MTN MoMo into your application or website using PayOS.

MTN MoMo’s extensive agent network and user-friendly platform have made it a significant player in promoting financial inclusion across these regions, serving millions of customers who may not have access to traditional banking services. In addition to its primary operations, MTN MoMo has expanded its services to include international transfers, enhancing its functionality beyond just domestic transactions.

Pre-requisites

Before accepting MTN MoMo payments through PayOS, ensure you meet the following requirements:

  • PayOS Integration:
    You have integrated with PayOS, either using our hosted checkout, SDK, or server-to-server API.

  • Payment Processor Configuration:
    You have set up an integration account for MTN MoMo with supported Payment Service Providers (PSPs) in PayOS. Currently, MTN MoMo is supported through PSPs such as Flutterwave, Cellulant, Paystack, and directly through MTN. Ensure that the commercial relationships with these PSPs are in place or can be utilized through PayOS.

  • Enable MTN MoMo:
    You have enabled MTN MoMo as a payment option in your PayOS configuration through the PayOS Portal.

  • Meta Fields Setup:
    If MTN MoMo requires specific meta fields (such as mobile number or consent details), ensure these fields are correctly configured under Merchant configurations -> Meta fields on your PayOS dashboard and included in your requests.

Ways to Integrate MTN MoMo with PayOS

PayOS supports multiple integration methods for offering MTN MoMo at checkout:

  1. PayOS Hosted Checkout
    Using PayOS’s hosted checkout is the simplest way to accept MTN MoMo payments. With this option:

    • Minimal development is required on your end.
    • PayOS automatically displays the MTN MoMo payment method during checkout.
    • You can control the payment methods offered through the session creation API call, specifying MTN MoMo as a restricted method if desired.
  2. PayOS SDK
    If you prefer more control over your checkout experience, you can integrate with the PayOS SDK:

    • The SDK provides UI components to include MTN MoMo as a payment method seamlessly.
    • It simplifies capturing any required inputs (like mobile number) and initiating transactions without extensive server-side coding.
    • Consult the PayOS SDK documentation for detailed steps on integrating MTN MoMo.
  3. Server-to-Server Integration
    For complete control over your payment process and checkout flow, you can integrate MTN MoMo using PayOS’s server-to-server APIs:

    • This approach offers greater flexibility in implementing the payment flow and handling customer data.
    • You will be responsible for capturing necessary inputs (e.g., mobile number) and forwarding them to PayOS securely.

Let’s explore the server-to-server approach in more detail.

Retrieving Available Payment Methods

Using the PayOS API, you can retrieve a list of available payment methods for a given checkout session by calling the GET /v1/payment/available-methods endpoint with a sessionId. For MTN MoMo, the method type is typically returned as mobileMoneyMtnMomo.

Request:

$curl -G https://api.payos.money/api/v1/payment/available-methods \
> -d sessionId={sessionId}

Response:

1{
2 "success": true,
3 "availableMethods": [
4 {
5 "type": "mobileMoneyMtnMomo",
6 "name": "MTN MoMo",
7 "requiredInput": [
8 {
9 "name": "mobileNumber",
10 "type": "text",
11 "label": "Mobile Number"
12 },
13 {
14 "name": "provider",
15 "type": "select",
16 "label": "Mobile Money Provider",
17 "options": ["MTN MoMo", "Other Providers"]
18 }
19 ]
20 },
21 ...other methods...
22 ]
23}

In this response:

  • The MTN MoMo payment method is listed with "type": "mobileMoneyMtnMomo".
  • The requiredInput field indicates that the customer must provide details such as their mobile number and select their mobile money provider.

Creating a Checkout Session

To create a checkout session that includes MTN MoMo as a payment option, make a POST request to the /v1/checkout/session endpoint. You can specify which payment methods to offer in the paymentMethods array. For MTN MoMo, set "type": "mobileMoneyMtnMomo".

$curl -X POST https://api.payos.money/api/v1/checkout/session \
> -H "Content-Type: application/json" \
> -d '{
> "amount": 15000,
> "currency": "NGN",
> "integrationType": "hosted",
> "merchantReference": "ORDER67890",
> "redirectUrl": "https://merchant.com/redirect",
> "brand": "merchant-brand-key",
> "payerToken": "TOKEN_abcdef123456",
> "payerDetails": {
> "payerName": "Frank Mwangi",
> "payerEmailAddress": "frank.mwangi@example.com",
> "payerMobileNumber": "0723456789",
> "payerLocation": "KEN"
> },
> "paymentMethods": [
> {
> "type": "mobileMoneyMtnMomo",
> "restrict": true
> }
> ]
>}'

Response:

1{
2 "sessionId": "SESSION_abcdef123456",
3 "paymentLink": "https://payos.money/checkout/SESSION_abcdef123456"
4}

In this example:

  • The paymentMethods array restricts the session to only the MTN MoMo payment method ("type": "mobileMoneyMtnMomo").
  • restrict set to true ensures that this session provides only MTN MoMo as the available payment method.
  • The sessionId in the response references this specific checkout session, which can be used to retrieve available methods, complete the payment, or make further adjustments before checkout completion.

Handling the Payment

After creating a session, your application can direct customers to the paymentLink if using the hosted checkout. If you’re using the PayOS SDK or a server-to-server integration, you’ll use the session details to process the MTN MoMo payment. This involves:

  • Initiating MTN MoMo Payments:
    Follow these steps to initiate an MTN MoMo payment:

    1. Collect the Required Details:
      Gather the customer’s mobile number and any other necessary information.

    2. Send the Payment Request:
      Send a POST /payment/initiate request to the Wallet Platform with the required information.

    3. Handle the Approval Process:
      Inform the customer to approve the payment using their MTN MoMo client (e.g., mobile app or USSD).

  • Verifying Payment Status:
    You can verify the status of the payment in several ways:

    • Polling: Use the transfer status endpoint to check the payment status.
    • Webhooks: If you have webhooks enabled, monitor the payment status through webhook notifications.
    • Callback URLs: For payments with callback_id, PayOS will send the payment details and status to the specified callback URL.

Supported Regions / Countries

MTN MoMo through PayOS is supported in the following regions and countries:

RegionCountries
East AfricaKenya, Uganda, Tanzania
West AfricaCameroon, Ivory Coast (Côte d’Ivoire), Rwanda, Ghana, Benin, Nigeria
Southern AfricaSouth Africa, Zambia
Middle EastUnited Arab Emirates (UAE), Kingdom of Saudi Arabia (KSA), Kuwait, Bahrain, Qatar, Oman, Egypt
EuropeEuropean Union, United Kingdom
North AmericaUnited States

Supported Currencies:

CurrencySupported Countries
EURSEPA countries
GBPUnited Kingdom
GHSGhana
KESKenya
NGNNigeria, USA (domicilliary account), US
SLLSierra Leone
TZSTanzania
UGXUganda
USDNigeria (domicilliary account), United States
XAFCameroon, Chad, DR Congo, Gabon
XOFBenin, Côte d’Ivoire, Senegal
ZARSouth Africa

(Note: Support for additional regions and countries may be added in the future. Check PayOS documentation or contact support for updates.)

Supported Workflows and Services

The following table outlines the workflows and services supported when using MTN MoMo with PayOS:

Workflow / ServiceSupported
Available via PayOS hosted checkout✔️ Yes
Available via PayOS SDK✔️ Yes
Available via PayOS server-to-server API✔️ Yes
Request to Pay✔️ Yes
Pre-Approval✔️ Yes
Transfer✔️ Yes
Validate Account Holder✔️ Yes
Get Balance✔️ Yes
Delivery Notification✔️ Yes
Validate Consumer Identity✔️ Yes
Get consumer information with consent✔️ Yes
Transfer with consumer consent✔️ Yes
Merchant payment with consumer consent✔️ Yes
Payment with consumer consent✔️ Yes
Bank transfer with consumer consent✔️ Yes
Instant Capture✔️ Yes
Cancel / Void✔️ Yes
Refund / Reverse✔️ Yes
Delayed / Manual Capture✖️ No
Save Instruments✔️ Yes
Merchant Initiated Transaction (MIT)✔️ Yes
InteroperabilityN/A

Ensuring a Seamless and Secure Payment Experience

To optimize your integration and ensure customer satisfaction, consider the following best practices:

  • Prioritize Security and Compliance:
    Protecting customer data is paramount. PayOS adheres to PCI DSS standards and other relevant regulations. Ensure you also follow any additional region-specific compliance requirements, especially when handling sensitive financial information across different countries.

  • Focus on a Smooth User Experience:
    Present payment methods clearly and intuitively. When customers reach the checkout stage, they should easily recognize and trust the payment options available. For example, highlight local payment methods prominently in regions where they are popular.

  • Monitor Performance and Reliability:
    Keep an eye on transaction success rates and processing times. PayOS’s dashboard provides insights into each payment method’s performance, enabling you to resolve any latency or downtime issues quickly to maintain customer trust.

  • Scale with Your Business Growth:
    As your business expands, your payment needs may evolve. PayOS’s flexible infrastructure makes it easy to add new payment methods, integrate with additional PSPs, or adjust your configurations to handle increased transaction volumes without compromising performance.

Additional Resources and Next Steps

With PayOS, managing and enabling diverse payment methods becomes more efficient and manageable. For detailed integration instructions, coding examples, and advanced customization options, explore these resources:

  • PayOS API Documentation
    Dive deeper into PayOS’s API endpoints and discover how to implement server-to-server integrations, handle advanced payment flows, and manage transactions programmatically.

  • Integration Guides
    Review step-by-step guides for integrating PayOS’s SDKs or connecting to popular PSPs, ensuring a smooth setup experience regardless of your technical background or business model.

By configuring MTN MoMo with PayOS, you can offer your customers a streamlined and secure mobile money payment experience tailored to their preferences and regional payment norms. Continuously refine your payment configurations and leverage PayOS’s robust features to stay agile in an ever-evolving e-commerce landscape.