PHP code example of hachther / mesomb-php

1. Go to this page and download the library: Download hachther/mesomb-php 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/ */

    

hachther / mesomb-php example snippets







use MeSomb\Operation\PaymentOperation;
use MeSomb\Util\RandomGenerator;

$client = new PaymentOperation('<applicationKey>', '<AccessKey>', '<SecretKey>');
// MeSomb::setVerifySslCerts(false); if to want to disable ssl verification
$payment->makeCollect([
    'amount' => 100,
    'service' => 'MTN',
    'payer' => '670000000',
    'nonce' => RandomGenerator::nonce(),
    'trxID' => '1'
]);


use MeSomb\Operation\PaymentOperation;
use MeSomb\Util\RandomGenerator;

$client = new PaymentOperation('<applicationKey>', '<AccessKey>', '<SecretKey>');
// MeSomb::setVerifySslCerts(false); if to want to disable ssl verification
$payment->makeDeposit([
    'amount' => 100,
    'service' => 'MTN',
    'receiver' => '670000000',
    'nonce' => RandomGenerator::nonce(),
    'trxID' => '1'
]);


use MeSomb\Operation\PaymentOperation;
use MeSomb\Util\RandomGenerator;

$client = new PaymentOperation('<applicationKey>', '<AccessKey>', '<SecretKey>');
$application = $client->getStatus();
print_r($application->getStatus());
print_r($application->getBalance());


use MeSomb\Operation\PaymentOperation;
use MeSomb\Util\RandomGenerator;

$client = new PaymentOperation('<applicationKey>', '<AccessKey>', '<SecretKey>');
$transactions = $client->getTransactions(['ID1', 'ID2']);
print_r($transactions);