swiftmade/lhv-connect
最新稳定版本:0.1.0
Composer 安装命令:
composer require swiftmade/lhv-connect
包简介
LHV bank's CONNECT service for Laravel
README 文档
README
⚠️ Warning: This package is under active development and may receive breaking changes between minor versions until it reaches v1.0. Please pin your dependency to a specific version.
Legal Disclaimer: This is a third-party integration package. It is not officially endorsed, sponsored, affiliated with or otherwise authorized by AS LHV Pank. All product and company names are trademarks™ or registered® trademarks of their respective holders.
A Laravel integration package for LHV Connect API, providing secure banking operations for Estonian businesses. This package handles the complexities of LHV's API communication, certificate management, and response handling.
Features
- Account balance inquiries
- Account statements
- Secure certificate-based authentication
- Automatic message handling and cleanup
- Comprehensive error handling
- Sandbox environment support
Requirements
- PHP 8.1 or higher
- Laravel 8.x, 9.x, 10.x, 11.x
- Valid LHV Connect API credentials and certificates
Installation
composer require swiftmade/lhv-connect
Configuration
- Publish the configuration file:
php artisan vendor:publish --provider="Swiftmade\LhvConnect\LhvConnectServiceProvider"
- Configure your credentials in
config/lhv-connect.php:- Set paths to your .p12 certificate files
- Configure certificate passwords
- Add your IBAN and account details
- Set up both sandbox and production environments as needed
Example configuration:
'sandbox' => [ 'url' => 'https://connect.prelive.lhv.eu', 'cert' => [ 'path' => '/path/to/cert.p12', 'password' => 'your-cert-password', ], 'verify' => 'path_to_lhv_rootca.cer', 'IBAN' => 'EE123456789', 'name' => 'Company Name', 'bic' => 'LHVBEE22', ],
Usage
Initialize the Client
use Swiftmade\LhvConnect\LhvConnect; // Connect to sandbox or production $lhv = LhvConnect::make('sandbox');
Test Connection
$lhv->sendHeartbeat();
Get Account Balance
// Get balance for default IBAN $balance = $lhv->getAccountBalance(); // Or specify an IBAN $balance = $lhv->getAccountBalance('EE123456789');
Get Account Statement
$statement = $lhv->getAccountStatement( fromDate: new DateTime('2024-01-01'), toDate: new DateTime('2024-03-01') ); // Or include a specific IBAN $statement = $lhv->getAccountStatement( fromDate: new DateTime('2024-01-01'), toDate: new DateTime('2024-03-01'), accountIban: 'EE123456789' );
Error Handling
The package implements comprehensive error handling for:
- Invalid configuration
- API errors (LhvApiError)
- Connection issues
- Request timeouts
Technical Details
- Uses certificate-based authentication
- Implements request locking mechanism
- Default request timeout: 2 seconds
- Automatic retry mechanism with exponential backoff
- Automatic cleanup of processed messages
Contributing
Contributions are welcome. Please ensure your changes adhere to the following:
- Follow PSR-12 coding standards
- Add/update tests as needed
- Document new features
License
This project is licensed under the MIT License - see the LICENSE file for details.
Resources
Developed and maintained by Swiftmade OÜ
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-24