churakovmike/enot-io-client

PHP API client for enot.io

dev-master 2020-05-31 14:46 UTC

This package is auto-updated.

Last update: 2024-10-29 06:05:45 UTC


README

Installation

composer require churakovmike/enot-io-client

or with composer.phar

php composer.phar require churakovmike/enot-io-client

Usage

Initialize api client in your code. There are two way.

use ChurakovMike\EnotIO\Client;

$client = new Client([
    'merchantId' => 'your-merchant-id',
    'secretWord' => 'your-secret-word',
    'apiKey' => 'your-api-key',
    'email' => 'your-email',
]);

All parameters in constructor are optional. You can set or change it later.

use ChurakovMike\EnotIO\Client;

$client = new Client();
$client->setMerchantId('your-merchant-id');
$client->setSecretWord('your-merchant-id');
$client->setApiKey('your-api-key');
$client->setEmail('your-email');

Methods

Get balance

use ChurakovMike\EnotIO\Client;

$client = new Client([
    'api_key' => 'your-api-key',
    'email' => 'your-email',
])

$balance = $client->getBalance();

Get available payment services

use ChurakovMike\EnotIO\Client;

$client = new Client([
    'merchantId' => 'your-merchant-id',
    'secretWord' => 'your-secret-word',
])

$paymentServices = $client->getAvailablePaymentServices();

Withdraw money

use ChurakovMike\EnotIO\Client;

$client = new Client([
    'api_key' => 'your-api-key',
    'email' => 'your-email',
])

$paymentServices = $client->getAvailablePaymentServices($service, $wallet, $amount);

Generate payment link

See methods signature