fractorysolutions / lhv-connect
LHV银行针对Laravel 6+的CONNECT服务,基于mihkullorg/lhv-connect的分支
2.0.4
2021-08-12 10:59 UTC
Requires
- php: ^7.2.5 | ^8.0
- ext-simplexml: *
- guzzlehttp/guzzle: ^6.5 || ^7.0
- illuminate/config: ^6.0 || ^7.0 || ^8.0
- illuminate/support: ^6.0 || ^7.0 || ^8.0
Requires (Dev)
- phpunit/phpunit: ^8.0 || ^9.0
README
快速入门
$ composer require fractorysolutions/lhv-connect
注意!服务提供者 Mihkullorg\LhvConnect\LaravelLhvConnectServiceProvider::class 将自动注册。
在终端运行
$ php artisan vendor:publish
打开文件 config/lhv-connect.php 并填写配置。您可以填写关于多个银行账户和证书的信息。
现在您可以创建新的 LhvConnect 对象。Config::get 参数 lhv-connect.test 表示传递了 lhv-connect.php 文件和带有 'test' 键的数组。
$lhv = new LhvConnect(Config::get('lhv-connect.test'));
测试连接。如果没有连接,应抛出带有 503 状态码的异常。
$lhv->makeHeartbeatGetRequest();
从LHV收件箱检索消息
$message = $lhv->makeRetrieveMessageFromInboxRequest();
从LHV收件箱删除消息
$lhv->makeDeleteMessageInInboxRequest($message);
检索所有消息。这将检索所有消息,同时也会从收件箱中删除所有消息。
$messages = $lhv->getAllMessages();