laraditz/gkash 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laraditz/gkash

最新稳定版本:1.0.4

Composer 安装命令:

composer require laraditz/gkash

包简介

Simple laravel package for Gkash Payment Gateway.

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

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.

统计信息

  • 总下载量: 64
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固