waqarraza / jazzcash-laravel
Jazz Cash implementation with Laravel
Installs: 77
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.0|^8.0
- illuminate/support: 5.8.*|^6.0|^7.0|^8.0
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