dagim/telebirr-api
Composer 安装命令:
composer require dagim/telebirr-api
包简介
Simplify integration of Telebirr's payment gateway into Laravel applications. Generate payment URLs, handle notifications, and ensure secure transactions effortlessly. With robust error handling and configuration flexibility, streamline Telebirr payment integration in your Laravel projects.
README 文档
README
Project Description
Telebirr Laravel Integration Package is a Laravel helper package for integrating Telebirr H5 Web payment functionality into Laravel applications. This package facilitates payment via the web, allowing third-party systems to invoke the interface upon payment issues by the customer. A redirect page is returned to the third-party system from the Telebirr platform upon payment completion.
Logical Specification
Platform Authentication Rule
- Telebirr platform allocates appId and appKey to corresponding third-party clients, uniquely identifying them.
- Third-party source IP addresses must be added to the trust list. IP addresses not on the trust list won't access the Telebirr system.
- The timestamp must be consistent with the server time (within one minute). Inconsistent access is considered illegal.
- Client-entered signatures must match the system-generated signatures. Inconsistent access is considered illegal.
Interface Description
| Parameter | Data Type | Mandatory/Optional | Description | Example |
|---|---|---|---|---|
| appId | String | Mandatory | Unique identifier provided by Telebirr platform | ce83aaa3dedd42ab88bd017ce1ca |
| appKey | String | Mandatory | AppKey provided by Telebirr platform | a8955b02b5df475882038616d5448d43 |
| nonce | String | Mandatory | Unique random string generated by third-party system | ER33419df678o8bb |
| notifyUrl | String | Optional | Endpoint URL from third-party to receive payment result | https://example.com/telebirr/121232 |
| outTradeNo | String | Mandatory | Unique transaction order number generated by third-party | T0533111222S001114129 |
| returnUrl | String | Mandatory | Third-party redirect page URL after payment completion | https://example.com/ |
| shortCode | String | Mandatory | Third-party short code provided by Telebirr | 8000001 |
| subject | String | Mandatory | Name or item for the payment being issued by the customer | Book |
| timeoutExpress | String | Mandatory | Payment order request timeout (in minutes) | 30 |
| timestamp | String | Mandatory | Timestamp of the request message (milliseconds) | 1624546517701 |
| totalAmount | String | Mandatory | Order amount in ETB | 9.00 |
| receiveName | String | Optional | Transaction receiver's name | Ethiopian airlines |
Response Message Elements
| Parameter | Data Type | Mandatory/Optional | Description | Example |
|---|---|---|---|---|
| code | String | Mandatory | Status code for payment request | 0 |
| msg | String | Mandatory | Status code description for payment request | success |
| data | Object | Mandatory | Data object consisting of the toPayURL | |
| toPayUrl | String | Mandatory | Telebirr payment landing page URL to redirect the customer to H5 Web Payment | https://example.com/telebir/payId=RE9879T0972S |
Getting Started
Install the Telebirr Laravel Integration Package:
composer require dagim/telebirr-api:dev-main
Usage Example
use Dagim\TelebirrApi\Telebirr; $telebirr = new Telebirr( env('TELEBIRR_APP_ID'), env('TELEBIRR_APP_KEY'), env('TELEBIRR_PUBLIC_KEY'), env('TELEBIRR_PRIVATE_KEY'), env('TELEBIRR_API_URL'), env('TELEBIRR_SHORT_CODE'), env('TELEBIRR_NOTIFY_URL'), env('TELEBIRR_RETURN_URL'), env('TELEBIRR_TIMEOUT_EXPRESS'), env('TELEBIRR_RECEIVE_NAME') ); $title = 'Product Purchase'; $amount = 100.00; $orderResult = $telebirr->createOrder($title, $amount); if ($orderResult['success']) { // Payment creation successful $paymentId = $orderResult['payment_id']; } else { // Payment creation failed $errorMessage = $orderResult['message']; }
dagim/telebirr-api 适用场景与选型建议
dagim/telebirr-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 205 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 05 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 dagim/telebirr-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dagim/telebirr-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 205
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-05