plaramart/tbi-bank
Composer 安装命令:
composer require plaramart/tbi-bank
包简介
Bulgarian TBI bank API wrapper
README 文档
README
This is standalone API wrapper for Bulgarian TBI Bank. Implement as payment method / recurring payment. Ask for calculations for single/all schemes and more;
Installation
composer require plaramart/tbi-bank
Usage
Initialization
Initialize without framework
$client = new \Plaramart\TbiBank\Client('your-api-secret', __DIR__.'/folder/pub.pem');
Initialize using laravel framework, or you can install my laravel implementation
// Inside AppServiceProvider.php $this->app->singleton(\Plaramart\TbiBank\Client::class, function () { $apiSecretKey = 'your-api-secret'; $pathToCert = storage_path('app/pub.pem'); return new \Plaramart\TbiBank\Client($apiSecretKey, $pathToCert); });
Get calculation
all schemes
Get calculations for all schemes. You can only pass first param (price) to get all data you need. Other params are not mandatory but you can fill them if needed.
// (float $price, float $initialPayment = 0, int $category = 10, $insurance = 'n') $calculationRequest = new \Plaramart\TbiBank\Requests\CalculateForAllPeriodSchemesRequest( price: 113 ); $response = $client->execute($calculationRequest);
single scheme
Second parameter is $period. That's the specific schema u want e.g calc(price: 113, period: 3)
// (float $price, int $period = 3, float $initialPayment = 0, int $category = 10, $insurance = 'n') $calculationRequest = new \Plaramart\TbiBank\Requests\CalculateForPeriodRequest( price: 113, period: 3 ); $response = $client->execute($calculationRequest);
Submit order to TBI
$order = new CreateOrderRequest(price: 113, months: 3, initialPayment: 50); $order->setUser( name: 'Zgdevv LordGeorgex', id: 9808027528, address: 'Na borovets batko', phone: '+35988888888', email: 'me@gmail.com' ); // You can add as much as u want products. // Product ID from your database. nothing to do with their API $order->addProduct( id: 1, name: 'test', quantity: 2, price: 113 ); $response = $client->execute($order);
Contribution
Send PR for bug fixes or improvements. For contact zgdevv@gmail.com
License
MIT
plaramart/tbi-bank 适用场景与选型建议
plaramart/tbi-bank 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 06 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 plaramart/tbi-bank 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 plaramart/tbi-bank 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-25