jazzcash-laravel maintained by waqarraza
Description
Jazz Cash implementation with Laravel
Author
Last update
2021/09/22 20:36
(dev-main)
License
Downloads
78
Laravel Jazz Cash Package
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