badinansoft/fib-php-sdk
Composer 安装命令:
composer require badinansoft/fib-php-sdk
包简介
FIB Online payments service PHP SDK
关键字:
README 文档
README
The PHP SDK for First Iraqi Bank's online payment is a library that allows you to integrate First Iraqi Bank's online payment system into your PHP application. The SDK provides a simple and easy-to-use API that allows you to create, status check, and cancel payments.
Features
- User Authentication: Verifying the user's identity and credentials and generating an access token for future requests.
- Payment Creation: Generating QR codes and dynamic links to direct the user to the payment screen when creating a payment.
- Payment Status Check: Checking the current status of a payment.
- Payment Cancellation: Canceling an active payment that has not yet been paid.
Installation
You can install the package via composer:
composer require badinansoft/fib-php-sdk
Usage
// create object instance of class $fib = new \Badinansoft\FIB\FIB(client_id: '', client_secret:'');
| Parameter | Description |
|---|---|
| Client_id | Client id provided by FIB |
| client_secret | Client Secret provided by FIB |
//create a payment $payment = $fib->payments() ->createPayment(amount: 20, currency: 'IQD', description: 'Host Invoice #2832', statusCallbackUrl: 'https://.....')
| Parameter | Description |
|---|---|
| amount | the amount of the payment |
| currency | the currency of the payment; currently only IQD is supported |
| description | (Optional) Description of the payment to help your customer to identify it in the FIB app, with the maximum length of 50 characters. |
| statusCallbackUrl | should be able to handle POST requests with request body that contains two properties: - id: this will be the payment id - status: this will be the status of the payment, for more information, go to Check Status endpoint section of this |
//return all data as stdClass Object $payment->getData();
Expected Response
| Property | Description |
|---|---|
| paymentId | A unique identifier of the payment, used later to check the status. |
| qrCode | A base64-encoded data URL of the QR code image that the user can scan with the FIB mobile app. |
| readableCode | A payment code that the user can enter manually in case he cannot scan the QR code. |
| personalAppLink | A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Personal app. |
| businessAppLink | A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Business app |
| corporateAppLink | A link that the user can tap on his mobile phone to go to the corresponding payment screen in the FIB Corporate app |
| validUntil | An ISO-8601-formatted date-time string, representing a moment in time when the payment expires |
//Check payment status $fib->payments() ->paymentStatus(paymentId: '9dfa724f-4784-4487-811b-63057b540503') ->getData();
Expected Response
| Property | Description |
|---|---|
| paymentId | a unique identifier of the payment. |
| status | Expected values are PAID |
| validUntil | an ISO-8601-formatted date-time string, representing a moment in time when the payment expires |
| paidAt | an ISO-8601-formatted date-time string, representing a moment in time when the payment is done. |
| amount | a JSON object, containing two key-value pairs; the amount and currency of the payment. |
| decliningReason | Expected Values are: -SERVER_FAILURE: Payment failure due to some internal error. -PAYMENT_EXPIRATION: Payment has expired. -PAYMENT_CANCELLATION: Payment canceled by the user. |
//Cancel Payment $fib->payments() ->cancelPayment(paymentId: '9dfa724f-4784-4487-811b-63057b540503');
Testing
composer tests
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email me@shahabzebari.net instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
badinansoft/fib-php-sdk 适用场景与选型建议
badinansoft/fib-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.78k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 04 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「BadinanSoft」 「fib-php-sdk」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 badinansoft/fib-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 badinansoft/fib-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 badinansoft/fib-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 1.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-30