PHPackages                             laraditz/gkash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. laraditz/gkash

ActiveLibrary[Payment Processing](/categories/payments)

laraditz/gkash
==============

Simple laravel package for Gkash Payment Gateway.

1.0.4(3y ago)064MITPHPPHP ^7.4|^8.0

Since Dec 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/laraditz/gkash)[ Packagist](https://packagist.org/packages/laraditz/gkash)[ Docs](https://github.com/laraditz/gkash)[ RSS](/packages/laraditz-gkash/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Laravel Gkash
=============

[](#laravel-gkash)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fbfedb0ba89f7558dc2d3b51941a19acf2727a30a7b48467a0ea3fd68bb1c58a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172616469747a2f676b6173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/gkash)[![Total Downloads](https://camo.githubusercontent.com/dc4c16b47c6e736dd37263fdf0fcae751882c21dcba9ff87eb7a2bb3920ad91c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172616469747a2f676b6173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraditz/gkash)[![GitHub Actions](https://github.com/laraditz/gkash/actions/workflows/main.yml/badge.svg)](https://github.com/laraditz/gkash/actions/workflows/main.yml/badge.svg)

Simple laravel package for Gkash Payment Gateway.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require laraditz/gkash
```

Before Start
------------

[](#before-start)

Configure your variables in your `.env` (recommended) or you can publish the config file and change it there.

```
GKASH_MERCHANT_ID=
GKASH_SIGNATURE_KEY=
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
-----

[](#usage)

### Create Payment

[](#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 StatusDescription1Created2Pending3Success4Failed5Cancelled6NoneEvent
-----

[](#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.

EventDescriptionLaraditz\\Gkash\\Events\\BackendReceivedReceived backend response from Gkash for a payment. Can use to update your payment status and other details### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Raditz Farhan](https://github.com/laraditz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

1229d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1203676?v=4)[Raditz Farhan](/maintainers/raditzfarhan)[@raditzfarhan](https://github.com/raditzfarhan)

---

Top Contributors

[![raditzfarhan](https://avatars.githubusercontent.com/u/1203676?v=4)](https://github.com/raditzfarhan "raditzfarhan (20 commits)")

---

Tags

laraditzgkash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laraditz-gkash/health.svg)

```
[![Health](https://phpackages.com/badges/laraditz-gkash/health.svg)](https://phpackages.com/packages/laraditz-gkash)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
