maksa988 / privatbank-api

连接到 PrivatBank API 的库

dev-master 2022-09-26 08:45 UTC

This package is auto-updated.

Last update: 2024-09-26 12:49:55 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');