mtn_momo

Partner Gateway sandbox provisioning API document

Requirements

Dart 2.0.0 or later OR Flutter 2.7.0 or later

Installation & Usage

Github

If this Dart package is published to Github, please include the following in pubspec.yaml

name: mtn_momo
version: 1.0.0
description: MTN MoMo SDK API client
dependencies:
  mtn_momo:
    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
      version: 'any'

Local

To use the package in your local drive, please include the following in pubspec.yaml

dependencies:
  mtn_momo:
    path: /path/to/mtn_momo

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

Create user, create key and create token with each transaction

import 'package:mtn_momo/api.dart';

var api_instance = new MTNMoMoAPI();
var xTargetEnvironment = xTargetEnvironment_example; // String | The identifier of the EWP system where the transaction shall be processed. This parameter is used to route the request to the EWP system that will initiate the transaction.
var authorization = authorization_example; // String | Authorization header used for Basic authentication and oauth. Format of the header parameter follows the standard for Basic and Bearer. Oauth uses Bearer authentication type where the credential is the received access token.

try {
    var result = api_instance.getAccountBalance(xTargetEnvironment, authorization);
    print(result);
} catch (e) {
    print("Exception when calling MTNMoMoAPI->getV10AccountBalance: $e\n");
}

Documentation for API Endpoints

All URIs are relative to https://sandbox.momodeveloper.mtn.com

ClassMethodHTTP requestDescription
MTNMoMoAPIgetAccountBalanceGET /v1_0/account/balance/v1_0/account/balance - GET
MTNMoMoAPIgetAccountActivityStatusGET /v1_0/accountholder/{accountHolderIdType}/{accountHolderId}/active/v1_0/accountholder/{accountHolderIdType}/{accountHolderId}/active - GET
MTNMoMoAPIgetUserGET /v1_0/apiuser/{X-Reference-Id}/v1_0/apiuser/{X-Reference-Id} - GET
MTNMoMoAPIcreateUserPOST /v1_0/apiuser/apiuser - POST
MTNMoMoAPIcreateUserAPIKeyPOST /v1_0/apiuser/{X-Reference-Id}/apikey/v1_0/apiuser/{X-Reference-Id}/apikey - POST
MTNMoMoAPIrequestToPayPOST /v1_0/requesttopay/requesttopay - POST
MTNMoMoAPIgetPaymentStatusGET /v1_0/requesttopay/{referenceId}/requesttopay/{referenceId} - GET
MTNMoMoAPIcreateTokenPOST /token//token - POST
MTNMoMoAPIrequestTransferPOST /v1_0/transfer/transfer - POST
MTNMoMoAPIgetTransactionStatusGET /v1_0/transfer/{referenceId}/transfer/{referenceId} - GET

Documentation For Models

Documentation For Authorization

apiKeyHeader

  • Type: API key
  • API key parameter name: Ocp-Apim-Subscription-Key
  • Location: HTTP header

apiKeyQuery

  • Type: API key
  • API key parameter name: subscription-key
  • Location: URL query string

Author

Libraries

mtn_momo.api