PHP code example of indrivo / maib-api

1. Go to this page and download the library: Download indrivo/maib-api 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/ */

    

indrivo / maib-api example snippets


namespace MyProject;
pi\MaibClient;
use Fruitware\MaibApi\MaibDescription;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use GuzzleHttp\MessageFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

//set options
$options = [
	'base_uri' => 'https://ecomm.maib.md:4455',
	'debug'  => false,
	'verify' => true,
	'cert'    => [__DIR__.'/cert/pcert.pem', 'Pem_pass'],
	'ssl_key' => __DIR__.'/cert/key.pem',
	'config'  => [
		'curl'  =>  [
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_SSL_VERIFYPEER => true,
		]
	]
];

// create a log for client class, if you want (monolog/monolog .0.1', '', 'ru'));

//execute dms transaction
var_dump($client->makeDMSTrans('1', '1', 498, '127.0.0.1', '', 'ru'));

//get transaction result
var_dump($client->getTransactionResult('1', '127.0.0.1'));

//revert transaction
var_dump($client->revertTransaction('1', '1'));

//transaction refund
var_dump($client->refundTransaction('1', '1'));

//close business day
var_dump($client->closeDay());