PHP code example of mediumart / momo

1. Go to this page and download the library: Download mediumart/momo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mediumart / momo example snippets


use Mediumart\MobileMoney\MobileMoney;

MobileMoney::setCurrentEnvironment('sandbox');

$collection =  MobileMoney::collection('sandbox');

use Mediumart\MobileMoney\Sandbox\UsersProvisioning;

$user =  UsersProvisioning::sandboxUserFor('<your product subscription key>');


$id = $user->id;

$apikey = $user->apikey;

$subscriptionkey = $user->subscriptionkey;

$collection = MobileMoney::collection();

$token = $collection->createAccessToken($subscriptionkey, $id, $apikey);

use Mediumart\MobileMoney\MobileMoney;

$collection =  MobileMoney::collection();
$disbursement =  MobileMoney::disbursement();
$remittance =  MobileMoney::remittance();