PHPackages                             moeen-basra/omnipay-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. moeen-basra/omnipay-jazzcash

ActiveLibrary[Payment Processing](/categories/payments)

moeen-basra/omnipay-jazzcash
============================

Jazzcash driver for the Omnipay PHP payment processing library

1.0.2(2y ago)012MITPHP

Since Oct 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/moeen-basra/omnipay-jazzcash)[ Packagist](https://packagist.org/packages/moeen-basra/omnipay-jazzcash)[ Docs](https://github.com/moeen-basra/omnipay-jazzcash)[ RSS](/packages/moeen-basra-omnipay-jazzcash/feed)WikiDiscussions main Synced 1mo ago

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

Omnipay: Jazzcash
=================

[](#omnipay-jazzcash)

**Jazz Jazzcash gateway for the Omnipay PHP payment processing library**

[Omnipay](https://github.com/thephpleague/jazzcash) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements jazzcash support for Omnipay.

Install
-------

[](#install)

Via Composer

```
$ composer require moeen-basra/omnipay-jazzcash
```

Usage
-----

[](#usage)

This gateway provides seamless integration with jazzcash hosted paged integration.

### Purchase Request

[](#purchase-request)

```
use Omnipay\Omnipay;

/** @var \Omnipay\Jazzcash\Gateway $gateway */
$gateway = Omnipay::create('Jazzcash');

// initialize with array
$gateway->initialize([
    'merchantId' => 'your-merchant-id',
    'password' => 'your-password',
    'secretKey' => 'your-secret-key',
]);

// or individual properties setter

$gateway->setMerchantId('your-merchant-id')
    ->setPassword('your-password')
    ->setSecretKey('your-secret-key');

// set the test mode if needed
$gateway->setTestMode(true);

$date = CarbonImmutable::now('Asia/Karachi');

try {
    $parameters = [
        [
            'paymentMethod' => 'MWALLET', // 'MWALLET' | 'OTC' | 'MPAY'
            'transactionTimestamp' => new \DateTime(), // make sure not past date also check your server timezone
            'transactionExpiryTimestamp' => new \DateTime(), // cab be future date
            'billReference' => (string) $date->timestamp,
            'description' => 'Test Order',
            'amount' => '20',
            'language' => 'EN',
            'currency' => 'PKR',
            'transactionId' => $date->timestamp,
            'extra' => [
                'field_1' => 'value_1',
                'field_2' => 'value_2',
                'field_3' => 'value_3',
                'field_4' => 'value_4',
                'field_5' => 'value_5'
            ],
            'returnUrl' => 'https://exmpale.com/return',
        ]
    ];

    $response = $gateway->purchase($parameters)->send();

    // var_dump($response->getData());

    if ($response->isSuccessful() && $response instanceof RedirectIn) {
        // do the redirect here you can do it auto using the following return statement
        // return $response->getRedirectResponse();
    } else {
    // handle failed response
    }
} catch (\Throwable $exception) {
    var_dump($exception);
}
```

***Note:*** Check this class for more redirect logic [PurchaseResponse.php](src%2FMessage%2FPurchaseResponse.php)

### Complete Purchase

[](#complete-purchase)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('Jazzcash');

// initialize with array
$gateway->initialize([
    'merchantId' => 'your-merchant-id',
    'password' => 'your-password',
    'secretKey' => 'your-secret-key',
]);

try {
    $response = $gateway->completePurchase()->send();

    if (!$response->isSuccessful()) {
        // handle failed logic
    }

    // always good option to cross-check the response data with gateway
    $inquiryResponse = $gateway->fetchTransaction([
        'transactionReference' => $response->getData()['pp_TxnRefNo'],
    ])

    // see next step for more details

} catch (\Throwable $exception) {
    var_dump($exception);
}

$response = $gateway->completePurchase()

```

### Inquiry Request

[](#inquiry-request)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('Jazzcash');

// initialize with array
$gateway->initialize([
    'merchantId' => 'your-merchant-id',
    'password' => 'your-password',
    'secretKey' => 'your-secret-key',
]);

try {
    $parameters = [
        'transactionReference' => '',
    ];

    $response = $gateway->fetchTransaction($parameters)->send();

    // var_dump($response->getData());

    if ($response->isSuccessful()) {
        if ($response->getData()['pp_Status'] === 'Complete') {
            // the transaction is success
        } else {

        }
     // handle success response
    } else {
    // handle failed response
    }
} catch (\Throwable $exception) {
    var_dump($exception);
}
```

***Note:*** Check [FetchTransactionResponse.php](src%2FMessage%2FFetchTransactionResponse.php) for more response statuses

**NOTE:** You can check the tests Mock for sample response data.

License
-------

[](#license)

This package is released under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](LICENSE) file for details.

Contact
-------

[](#contact)

You can reach me here

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~35 days

Total

3

Last Release

871d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29e85434bbb62af31bbfe18c0983fd39f14e472995e53ecfab734258fd470b9b?d=identicon)[moeen-basra](/maintainers/moeen-basra)

---

Top Contributors

[![moeen-basra](https://avatars.githubusercontent.com/u/3841052?v=4)](https://github.com/moeen-basra "moeen-basra (5 commits)")

---

Tags

paymentgatewaypaymerchantomnipaycredit-cardjazzcashotcmajazzcash-otcjazzcash-majazzcash-credit-cardjazzcash-mobile-accountjazzcash-over-the-counter

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/moeen-basra-omnipay-jazzcash/health.svg)

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

###  Alternatives

[omnipay/payfast

PayFast driver for the Omnipay payment processing library

24626.9k3](/packages/omnipay-payfast)

PHPackages © 2026

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