PHPackages                             zfhassaan/jazzcash - 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. zfhassaan/jazzcash

ActiveLibrary[Payment Processing](/categories/payments)

zfhassaan/jazzcash
==================

JazzCash Payment Gateway Package for Laravel 9

v1.0.6(4mo ago)141.3k↑125%8MITPHPPHP ^8.1CI passing

Since Jan 2Pushed 4mo ago2 watchersCompare

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

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

 [![JazzCash Payment Gateway](logo_JazzCash.png)](logo_JazzCash.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dfa7098985c1a7bd7ee09dda777d3d4f28e31cd2ee59e09d87c2cb73c70fde1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a666861737361616e2f6a617a7a636173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zfhassaan/jazzcash)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/172013236c5a484e9dcfbb04dc36ccdc0cd1469fce5d2bb6aaeef1c3910c2abd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a666861737361616e2f6a617a7a636173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zfhassaan/jazzcash)[![Tests](https://camo.githubusercontent.com/ce6fea01cf14b8c411552346aac158fc831c5d33c44c8a2d9486841998fdbe5c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a666861737361616e2f6a617a7a636173682f63692e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/zfhassaan/jazzcash/actions)[![Laravel](https://camo.githubusercontent.com/c5636cbc00edeb2fc30bc0a089aca31231cc9b87845c6d56b74fb9e2fc931b02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com)

####  Disclaimer

[](#-disclaimer-)

This is unofficial Jazzcash API Payment Gateway. This repository is only created to help developers in streamlining the integration process. You can Review the Official Payment Gateway [here.](https://sandbox.jazzcash.com.pk/Sandbox/) This Package only processes hosted checkout process. There's no Subscription option enabled yet. #### About

[](#about)

JazzCash is a leading payment gateway in Pakistan that allows businesses to securely accept online payments from their customers. With fast and reliable transaction processing, advanced fraud protection, and a user-friendly interface, JazzCash makes it easy for merchants to grow their online sales. Whether you're a small business owner, e-commerce store owner, or a developer looking to integrate a payment gateway into your website or mobile app, JazzCash has a solution that fits your needs. This document contains a detailed explanation of how to integrate with JazzCash's hosted checkout feature (version 1.0.0).

#### Intended Audience

[](#intended-audience)

This document is for merchants and developers who want to integrate with JazzCash to perform a hosted checkout.

#### Integration Scope

[](#integration-scope)

The merchant will implement all e-commerce functionality. The JazzCash service will only be used for payment processing with the hosted checkout feature.

#### API End Points

[](#api-end-points)

This package only contains the hosted checkout process. There are no API endpoints specified for direct checkout.

#### Integration Prerequisites

[](#integration-prerequisites)

Merchants must be registered with JazzCash prior to integration. After signing up for a JazzCash account, the merchant will receive the following unique values to operate: `Merchant_ID`, `Password`, `Hashkey`, `Sandbox URL`, and `Production URL`. These keys are used to get a one-time authentication token, which

#### Installation

[](#installation)

You can install the package via composer

```
composer require zfhassaan/jazzcash

```

#### Set .env configurations

[](#set-env-configurations)

```
JAZZCASH_PAYMENTMODE=sandbox
JAZZCASH_MERCHANTID=
JAZZCASH_PASSWORD=
JAZZCASH_HASHKEY=
JAZZCASH_MPIN=
JAZZCASH_PRODUCTION_URL=
JAZZCASH_SANDBOX_URL=
JAZZCASH_RETURNURL=

```

#### configuration

[](#configuration)

In your `config/app.php` file, add the following line to the providers array:

```
    /*
    * Package Service Providers...
    */

    \zfhassaan\jazzcash\provider\ServiceProvider as JazzcashServiceProvider;
```

In the `aliases` array of the same file, add the following line:

```
  'aliases' => Facade::defaultAliases()->merge([
        'Jazzcash' => \Zfhassaan\Jazzcash\Facade\JazzcashFacade::class,
    ])->toArray(),
```

#### Publish Vendor:

[](#publish-vendor)

Publish the package assets by running the following command:

```
php artisan vendor:publish
```

This will show the following response in terminal: [![img.png](img.png)](img.png)

press 9 to publish `zfhassaan\jazzcash\provider\ServiceProvider` provider

#### Steps:

[](#steps)

##### Hosted Checkout

[](#hosted-checkout)

To initiate the hosted checkout process, send a POST request with the following parameters:

```
{
    "amount":"1",
    "billref":"bill-reference",
    "productDescription": "Product Description"
}
```

Then, in your controller, use the following code:

```
        $jazzcash = new JazzCash();
        $jazzcash->setAmount($request->amount);
        $jazzcash->setBillReference($request->billref);
        $jazzcash->setProductDescription($request->productDescription);
        return $jazzcash->sendRequest();
```

The index function is called and a new instance of the JazzCash class is created. The setAmount, setBillReference, and setProductDescription methods are called on the JazzCash object, passing in the amount, billref, and productDescription values from the request as arguments. These methods set the corresponding properties of the JazzCash object to the specified values.

The sendRequest method is called on the JazzCash object. This method sends a request to the JazzCash API to initiate the checkout process and returns the response from the API as an HTML template which can be rendered on the web and mobile application. To hide or show fields, you can use CSS to control the field's visibility on the frontend.

The response from the API is returned by the index function. This response can be used to display the hosted checkout form on your website or mobile app.

### Testing

[](#testing)

To test the payment gateway, you can use the sandbox mode by setting `JAZZCASH_PAYMENTMODE=sandbox` in your `.env` file. This will allow you to test the checkout process without actually processing any payments.

To switch to production mode, set `JAZZCASH_PAYMENTMODE=production` in your `.env` file.

#### Changelog

[](#changelog)

Please see Changelog for more information what has changed recently.

#### Security

[](#security)

The following lines are taken from [briandk](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62) repository for contributing in an open source projects.

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
    - Be specific!
    - Give sample code if you can. An issue includes sample code that *anyone* with a base R setup can run to reproduce what I was seeing
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

#### License

[](#license)

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

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance75

Regular maintenance activity

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96% 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 ~182 days

Recently: every ~272 days

Total

7

Last Release

137d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f91e22a64582fa1db957f7f189736d6cd2e6f1f69c2236a42a9ee8fcbdd0723?d=identicon)[zfhassaan](/maintainers/zfhassaan)

---

Top Contributors

[![zfhassaan](https://avatars.githubusercontent.com/u/17079656?v=4)](https://github.com/zfhassaan "zfhassaan (48 commits)")[![asadudev](https://avatars.githubusercontent.com/u/119096659?v=4)](https://github.com/asadudev "asadudev (1 commits)")[![salman-mahmood](https://avatars.githubusercontent.com/u/28801084?v=4)](https://github.com/salman-mahmood "salman-mahmood (1 commits)")

---

Tags

developerhosted-checkoutjazzcashjazzcash-paymentlaravellaravel-packagepackage

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zfhassaan-jazzcash/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[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)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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