/mazzuma-api

wrapper of the Mazzuma Mobile Money and Cryto Currency Api

Primary LanguagePHPMIT LicenseMIT

Mazzuma PHP package

Latest Version on Packagist Build Status Quality Score Total Downloads

Mazzuma provides easy to use interfaces for connecting your web application or mobile application to the service. This allow you to gain mobile money payments from customers and clients with optimal ease and at no extra charges (standard mobile money operator charges apply).

Visit https://mazzuma.com/developer for more infomation and account creation process

Installation

You can install the package via composer:

composer require lacasera/mazzuma-api

Usage

Using the Mazzuma Mobile Money Service
require "vendor/autoload.php"
use Lacasera\MazzumaApi\MazzumaApi;

//Send Mobile Money

$response = (new MazzumaApi)
                ->setApiKey('xxxxx')
                ->setService('mobile-money')
                ->pay([
                    "price"=> 1,
                    "network"=> "mtn",
                    "recipient_number"=> "026xxxxxxx",
                    "sender"=> "024xxxxxxx",
                    "option"=> "rmta",
                    "orderID" => "123342
                ]);
                
print_r($response);

// Verify Payment of Order

$orderID = '1223234';

$response = (new MazzumaApi)
                ->setApiKey('xxxxx')
                ->setService('mobile-money')
                ->verify($orderID);
                
print_r($orderID);
Using the Mazzuman Token Service
In order to start sending and receiving Mazzuma tokens, you would have to register to use the service. Head over to the website and create a new Mazzuma account. You would enter a unique wallet username you would wish to use during the registration process. Once registered, log into your account. You would have an API key generated, which you can view in the API section. This API Key should be noted, as it would authorise payments in your account.``

Example

require "vendor/autoload.php"
use Lacasera\MazzumaApi\MazzumaApi;

//Sending 
$response = (new MazzumaApi)
                ->setApiKey('xxxxx')
                ->setService('token')
                ->send([
                     "amount"=> 1,
                     "recipient"=> "",
                     "sender"=> "",
                ]);
 print_r($response);
                
//Recieving Tokens

$response = (new MazzumaApi)
                ->setApiKey('xxxxx')
                ->setService('token')
                ->recieve([
                     "option"=> "set_callback_url",
                     "sender"=> "",
                     "callback_url"=> "",
                ]);
 print_r($response);
 
 
 // Verify a token
 $hash = "xxxxxxxxx";

$response = (new MazzumaApi)
                 ->setApiKey('xxxxx')
                 ->setService('token')
                 ->verify($hash);
print_r($response);
  
  
//get account balance by calling
$response = (new MazzumaApi)
                   ->setApiKey('xxxxx')
                   ->setService('token')
                   ->getBalance();
 print_r($response);
   

//Validate hash
$response = (new MazzumaApi)
                 ->setApiKey('xxxxx')
                 ->setService('token')
                 ->validate([
                    "option" => "validate_account",
                    "username" => ""
                 ]);
  print_r($response);
  

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hi@barfiagyenim.dev instead of using the issue tracker.

Credits

License

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