PHP code example of fruitware / maib-api

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

    

fruitware / maib-api example snippets


namespace MyProject;
pi\MaibClient;
use Fruitware\MaibApi\MaibDescription;
use GuzzleHttp\Client;
use GuzzleHttp\Subscriber\Log\Formatter;
use GuzzleHttp\Subscriber\Log\LogSubscriber;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;

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

// init Client
$guzzleClient = new Client($options);

// create a log for client class, if you want (monolog/monolog on
var_dump($client->revertTransaction('1', '1'));

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