/Mazzuma-PHP

A library for consuming Mazzuma's payment API for sending or receiving Mobile Money for an PHP Application.

Primary LanguagePHPMIT LicenseMIT

Mazzuma-PHP

Latest Version on Packagist Software License Build Status Code Coverage Scrutinizer Code Quality Total Downloads

A library for consuming Mazzuma's payment API to send or recieve Mobile Money for a PHP Application.

Install

Via Composer

$ composer require baffouradu/mazzuma

Usage

require "vendor/autoload.php";

use \BaffourAdu\Mazzuma\MazzumaPayment;

//Replace this with API key as obtained from https://dashboard.mazzuma.com/
$APIKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";

$payment = new MazzumaPayment($APIKey);

try {
    $response = $payment->transfer('MTN_TO_MTN')
                ->amount(1) 
                ->from('05xxxxxx')
                ->to('02xxxxxx')
                ->send();

    if ($payment->isSuccessful()) {
        /* $response holds the original
        structure of Mazzuma's API Response */
        echo json_encode($response);
    } else {
        /* $response holds the original
        structure of Mazzuma's API Response */
        echo json_encode($response);
    }  
} catch (Exception $e) {
    echo 'Message: ' .$e->getMessage();
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email baffouraduboampong@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.