purt09/privatbank-api

用于连接 PrivatBank API 的库

v3.0.2 2021-10-27 04:38 UTC

This package is auto-updated.

Last update: 2024-09-27 10:50:37 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');