sergeynezbritskiy/privatbank-api

连接到 PrivatBank API 的库

v3.0.0 2019-12-01 14:46 UTC

This package is auto-updated.

Last update: 2024-08-30 01:43:44 UTC


README

连接您的PHP应用程序与PrivatBank API的库

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

安装

安装模块最简单的方法是使用Composer

composer require sergeynezbritskiy/privatbank-api:"^3.0"

备注

更多详情请访问 [https://api.privatbank.ua/]

简单使用

使用库非常简单

//create public client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\PublicClient();
//run the request
$result = $client->infrastructure(\SergeyNezbritskiy\PrivatBank\Request\InfrastructureRequest::TYPE_ATM, 'Днепр');

//create authorized client for connecting with API
$client = new \SergeyNezbritskiy\PrivatBank\AuthorizedClient();
//create merchant
$merchant = new \SergeyNezbritskiy\PrivatBank\Merchant('<your_merchant_id>', '<your_merchant_secret>');
$client->setMerchant($merchant);
//run the request
$result = $client->balance('4111111111111111');