PHP code example of waqarraza / jazzcash-laravel

1. Go to this page and download the library: Download waqarraza/jazzcash-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

waqarraza / jazzcash-laravel example snippets


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

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

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

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

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
    }
}

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