waqarraza/jazzcash-laravel

Jazz Cash implementation with Laravel

v1.0.1 2021-09-22 18:36 UTC

This package is auto-updated.

Last update: 2025-06-23 02:56:31 UTC


README

Step 1

composer require waqarraza/jazzcash-laravel

Step 2

For Laravel version <= 5.4

You can skip this step for Laravel version >= 5.5

Add these following lines in config/app.php

'providers' => [
    ...
    Waqar\Jazzcash\JazzCashServiceProvider::class,
    ...
]

'aliases' => [
    ...
    'JazzCash' => Waqar\Jazzcash\JazzCashFacade::class
    ...
]

Step 3

publish config and add details

php artisan vendor:publish --provider="Waqar\Jazzcash\JazzCashServiceProvider"

Usage

Add merchant details in config/jazzcash.php file

'merchant_id' => '<your merchant id>',
'password' => '<your password>',
'integrity_salt' => '<your integrity salt>',

Set return page in config

'return_url' => 'http://127.0.0.1/returnpage',

To check out add function in controller

public function checkout() {
    $amount = 10 ; // in pkr
    $description = "Some checkout details";
    return JazzCash::checkout($amount, $description)
}

public function checkout_return(Request $request) {
    if($request->get('pp_ResponseCode') === '000') {
        ... do something on success
    } else {
        ... do something in failure
    }
}

checkout function will return a view which submits a request to jazz cash checkout page.

checkout_return function will be called on return_url

Sandbox

For testing, you can use this number 03123456789