fastje / enot-io-client
enot.io 的 PHP API 客户端
v1.0.6
2024-02-20 11:20 UTC
Requires
- php: ^7.4 || ^8.0
- guzzlehttp/guzzle: ^6.5 || ^7.0
README
安装
composer require fastje/enot-io-client
或者使用 composer.phar
php composer.phar require fastje/enot-io-client
使用
在您的代码中初始化 API 客户端。有两种方式。
use FASTJE\EnotIO\Client; $client = new Client([ 'merchantId' => 'your-merchant-id', 'secretWord' => 'your-secret-word', 'apiKey' => 'your-api-key', 'email' => 'your-email', ]);
构造函数中的所有参数都是可选的。您可以在之后设置或更改它们。
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');
方法
获取余额
use FASTJE\EnotIO\Client; $client = new Client([ 'api_key' => 'your-api-key', 'email' => 'your-email', ]) $balance = $client->getBalance();
获取可用的支付服务
use FASTJE\EnotIO\Client; $client = new Client([ 'merchantId' => 'your-merchant-id', 'secretWord' => 'your-secret-word', ]) $paymentServices = $client->getAvailablePaymentServices();
提款
use FASTJE\EnotIO\Client; $client = new Client([ 'api_key' => 'your-api-key', 'email' => 'your-email', ]) $paymentServices = $client->getAvailablePaymentServices($service, $wallet, $amount);