stephencoduor/omnipay-mtn

MTN CAM mobile money driver gateway for Omnipay V2.0 payment processing library

v2.0.0 2021-01-03 07:47 UTC

This package is auto-updated.

Last update: 2024-04-09 01:13:34 UTC


README

MTN Mobile money driver for the Omnipay PHP payment processing library

Build Status

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements MTN Mobile money support for Omnipay.

Note

This release is scurrently unstable but will soon be released on a stable branch when the fix is applied. If you seek to use this package urgently, please contact author me

Installation

Omnipay is installed via Composer. To install, go to your project root directory and simply run :

$ composer require stephencoduor/omnipay-mtn

Then run composer update to fetch it

Basic Usage

The following methods are provided by this package:

  • purchase
use Omnipay\Omnipay;

$gateway = Omnipay::create('Momoc');
$config = [
    'providerCallbackHost' =>'http://mycallback',
    'amount' => 100.00, //amount the client should pay
    'api_user' => '', //your provided profile apiuser
    'api_key' => '', //your provided profile api key
    'subscription_key' => '', //your provided subscription key
];

$gateway->authorize($config);
$response = $gateway->purchase($config)->send();

$transactionInfo = $response->getMessage(); 
//an array containing transaction data

if($response->isSuccessful()){
    //save transaction to database and notify the user
    
}else{
    //get error from the message and notify the user
    //
} 

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request. "# omnipay-mtn-v2.0"