laraditz/gkash
Composer 安装命令:
composer require laraditz/gkash
包简介
Simple laravel package for Gkash Payment Gateway.
README 文档
README
Simple laravel package for Gkash Payment Gateway.
Installation
You can install the package via composer:
composer require laraditz/gkash
Before Start
Configure your variables in your .env (recommended) or you can publish the config file and change it there.
GKASH_MERCHANT_ID=<your_merchant_id_here>
GKASH_SIGNATURE_KEY=<your_signature_key_here>
GKASH_SANDBOX_MODE=true # true or false for sandbox mode
(Optional) You can publish the config file via this command:
php artisan vendor:publish --provider="Laraditz\Gkash\GkashServiceProvider" --tag="config"
Run the migration command to create the necessary database table.
php artisan migrate
Usage
Create Payment
To create payment and get the payment URL to be redirected to. You can use service container or facade.
// Create a payment // Using service container $payment = app('gkash')->refNo('ABC1234')->amount(100)->returnUrl('https://returnurl.com')->createPayment(); // Using facade $payment = \Gkash::refNo('ABC1234')->amount(100)->returnUrl('https://returnurl.com')->createPayment();
Return example:
[
"code" => "5Xpj9IPN",
"currency_code" => "MYR",
"amount" => 100,
"payment_url" => "http://myapp.com/gkash/pay/5Xpj9IPN"
]
Redirect to the payment_url to proceed to Gkash payment page. Once done, you will be redirected to the returnUrl. Below is the sample response returned.
[ "amount" => "1.00", "code" => "5Xpj9IPN", "currency" => "MYR", "id" => "98043afa-d795-43b1-a6da-af735ba43db0", "merchant_id" => "MXXX-X-XXXXX", "payment_type" => "TnG ECOMM", "ref_no" => "ABC14393647840", "signature" => "0bfe2724c9c29dcd5c086a1f45f28ce0b702dd86dddef8eb40d46001ce76dff76a8f18b9f993f6cbb104206041866f239c4239878f62c043b4252a0c00a3a374", "status" => 3, "status_text" => "Success", "vendor_ref_no" => "MXXX-PO-XXXXXX", ]
| Payment Status | Description |
|---|---|
| 1 | Created |
| 2 | Pending |
| 3 | Success |
| 4 | Failed |
| 5 | Cancelled |
| 6 | None |
Event
This package also provide some events to allow your application to listen to it. You can create your listener and register it under event below.
| Event | Description |
|---|---|
| Laraditz\Gkash\Events\BackendReceived | Received backend response from Gkash for a payment. Can use to update your payment status and other details |
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email raditzfarhan@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
laraditz/gkash 适用场景与选型建议
laraditz/gkash 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 64 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laraditz」 「gkash」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laraditz/gkash 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laraditz/gkash 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laraditz/gkash 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel package for interacting with TikTok API.
Hierarchical or tree database implementation using path enumeration model
A simple laravel package for Experian.
A simple virtual wallet or e-wallet for Laravel
Simple laravel package for Payex Payment Gateway.
Laravel permission management for the lazy.
统计信息
- 总下载量: 64
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-19