Skip to content

Go Live

Brian Matovu edited this page Sep 22, 2022 · 14 revisions

Prerequisites

First, submit your KYC forms to MTN here

MTN MOMO Go Live KYC

Client APP credentials.

In production, client application credentials are managed through the partner portal.

MTN MOMO Partner Portal

Client APP ID

Also called; API User ID, appUser, X-Reference-Id

MOMO_COLLECTION_ID="..."

Client APP Secret

Also called; apiKey

MOMO_COLLECTION_SECRET="..."

Product Key

Also called; Subscription Key

MOMO_COLLECTION_SUBSCRIPTION_KEY="..."

Callback URI

Also called; providerCallbackHost

MOMO_COLLECTION_CALLBACK_URI="..."

Other credentials

Environment

Also called; targetEnvironment

- MOMO_ENVIRONMENT="sandbox"
+ MOMO_ENVIRONMENT="mtnuganda"

Base URI

- MOMO_API_BASE_URI="https://ericssonbasicapi2.azure-api.net/"
+ MOMO_API_BASE_URI="https://ericssonbasicapi1.azure-api.net/"

* Must end with a trailing forward slash.

Currency

- MOMO_CURRENCY="EUR"
+ MOMO_CURRENCY="UGX"

Comparison

Setting Sandbox Live
Base URI https://ericssonbasicapi2.azure-api.net/ https://ericssonbasicapi1.azure-api.net/
Environment sandbox mtnuganda
Currency EUR UGX
Documentation https://momodeveloper.mtn.com/api-documentation https://momoapi.mtn.com/api-documentation
Services https://momodeveloper.mtn.com/docs/services https://momoapi.mtn.com/docs/services

Note:

MSISDN (Phone number format)

The right phone number is strictly numeric, preceded by the country code. For example, this: +256 772 485 678 would be 256772485678.

0772485678 - Invalid

+256772485678 - Invalid

256772485678 - Valid

Country

This wiki is for MTN Uganda, the environment and currency will change per country.

Product

Examples are for collection but they apply to other products (disbursement and remittance) too.

Be sure to replace the product name to match the product you subscribed to eg; the client ID for disbursement would be set using MOMO_DISBURSEMENT_ID.

Callback URI

This is not a redirect URI. MTN MoMo API won't redirect a request to this URI. Instead, they use it to notify a transaction once completed.

You're supposed to provide Provider Callback Host and Payment Server URL in the portal.

Payment Server URL Provider Callback Host
https://example.com/mtn-momo/callback example.com
https://api.example.com/mtn-momo/callback api.example.com
jdoe@work-pc:/var/www/html/mtn-momo-demo$ php artisan tinker
Psy Shell v0.10.6 (PHP 7.4.15 — cli) by Justin Hileman
>>> parse_url('https://example.com/mtn-momo/callback')
=> [
     "scheme" => "https",
     "host" => "example.com",
     "path" => "/mtn-momo/callback",
   ]
>>> parse_url('https://api.example.com/mtn-momo/callback')
=> [
     "scheme" => "https",
     "host" => "api.example.com",
     "path" => "/mtn-momo/callback",
   ]
>>>

The callback endpoint must be of HTTP Method PUT and with no authentication or authorization. Because there's no option to set auth credentials that MTN will use with the callback.

To secure the callback; verify that it's coming from MTN before using the payload. You can check by domain; if not the one from MTN, ignore the request.

Server

Referring to the server from where requests are originating from.

The IP address / domain of your live server MUST be whitelisted with MTN. That's done via email, it's not configurable in the portal.

In case, you change your server IP - you must liaise with MTN to update the new IP in their whitelist.

Even with the right live credentials; requests from non-whitelisted IPs will be rejected in live environment.