Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fruitware/maibapi
Moldova Agroindbank php sdk api
https://github.com/fruitware/maibapi
Last synced: 3 days ago
JSON representation
Moldova Agroindbank php sdk api
- Host: GitHub
- URL: https://github.com/fruitware/maibapi
- Owner: Fruitware
- Created: 2015-08-13T15:06:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:29:48.000Z (11 months ago)
- Last Synced: 2024-04-26T17:22:30.706Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 13
- Watchers: 9
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MaibAPI
Maib online payments php SDK## Installing
```bash
composer require fruitware/maib-api
```## Usage
```php
namespace MyProject;
require_once(__DIR__ . '/vendor/autoload.php');use Fruitware\MaibApi\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 required)
$log = new Logger('maib_guzzle_request');
$log->pushHandler(new StreamHandler(__DIR__.'/logs/maib_guzzle_request.log', Logger::DEBUG));
$subscriber = new LogSubscriber($log, Formatter::SHORT);$client = new MaibClient($guzzleClient);
$client->getHttpClient()->getEmitter()->attach($subscriber);
// examples//register sms transaction
var_dump($client->registerSmsTransaction('1', 978, '127.0.0.1', '', 'ru'));//register dms authorization
var_dump($client->registerDmsAuthorization('1', 978, '127.0.0.1', '', 'ru'));//execute dms transaction
var_dump($client->makeDMSTrans('1', '1', 978, '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'));//close business day
var_dump($client->closeDay());```