jackmartin / popolniclub
Library PopolniClub API
1.6
2020-10-07 13:51 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^7.1
Requires (Dev)
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2024-12-07 22:45:50 UTC
README
Описание
PHP библиотека для работы с API PopolniClub
Read this in other language: English, Русский, Український
Документация
Требования
- PHP 5.6 или выше
- Composer
Composer
composer require jackmartin/popolniclub
Библиотеки
Основные методы API
- Создать платёж
- Статус платежа
- Текущий баланс
Примеры
__construct()
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); // $pophone = new Pophone(); // $pophone // ->setLogin() // ->setPassword() // ->setAPI() // ->setSandbox();
sandbox()
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API', true);
sendPayment() - Пример 1
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); print_r( $pophone->sendPayment( [ 'transactionId' => 1000000001, 'amount' => 100, 'msisdn' => '380000000000', 'templateID' => 0 ] ) );
sendPayment() - Пример 2
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); print_r( $pophone ->setTransactionID() ->setSumm(1) ->setPhone('380000000000') ->setTemplateID() ->addPayment() ->sendPayment() );
sendPayment() - Пример 3
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); foreach ( [ [ 'phone' => '380000000000', 'summ' => 1 ], [ 'phone' => '380000000001', 'summ' => 1 ] ] as $key => $item ) { $pophone ->setTransactionID() ->setPhone($item['phone']) ->setSumm($item['summ']) ->setTemplateID() ->addPayment(); } print_r( $pophone->sendPayment()->getData() );
statusPayment() - Пример 1
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); print_r( $pophone->statusPayment( [ [ 'transactionId' => 1000000001, 'status' => 0, ], ] ) );
statusPayment() - Пример 2
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); print_r( $pophone ->addTransaction(1000000001) ->statusPayment() );
statusPayment() - Пример 3
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); foreach ( [ 1000000001, 1000000002, ] as $id ) { $pophone->addTransaction($id); } print_r( $pophone->statusPayment()->getData() // $pophone->statusPayment()->getRaw() // $pophone->statusPayment()->transaction() // $pophone->statusPayment()->status() );
currentBalance()
require_once 'vendor/autoload.php'; use PopolniClub\Pophone; $pophone = new Pophone('Ваш логин', 'Ваш пароль API'); print_r( $pophone->currentBalance()->getData() // $pophone->currentBalance()->getRaw() // $pophone->currentBalance()->balance() // $pophone->currentBalance()->balance(true) // $pophone->currentBalance()->credit() );