PHP code example of goodoneuz / pay-uz

1. Go to this page and download the library: Download goodoneuz/pay-uz 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/ */

    

goodoneuz / pay-uz example snippets



//handle requests from payment system
Route::any('/handle/{paysys}',function($paysys){
    (new Goodoneuz\PayUz\PayUz)->driver($paysys)->handle();
});

//redirect to payment system or payment form
Route::any('/pay/{paysys}/{key}/{amount}',function($paysys, $key, $amount){
	$model = Goodoneuz\PayUz\Services\PaymentService::convertKeyToModel($key);
    $url = request('redirect_url','/'); // redirect url after payment completed
    $pay_uz = new Goodoneuz\PayUz\PayUz;
    $pay_uz
    	->driver($paysys)
    	->redirect($model, $amount, 860, $url);
});
bash
php artisan vendor:publish --provider="Goodoneuz\PayUz\PayUzServiceProvider"
bash
php artisan migrate
bash
php artisan db:seed --class="Goodoneuz\PayUz\database\seeds\PayUzSeeder"