PHP code example of ulasoft / pay-uz

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

    

ulasoft / pay-uz example snippets



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

//here user redirects to payment system
Route::any('/redirect/{paysys}/{user_id}/{amount}',function($paysys, $user_id, $amount){
    $user = App\User::find($user_id);
    $url = 'https://payment.uz';
    PayUz::driver($paysys)->redirect($user, $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"