PHP code example of thebrightlabs / laravel-qicard-gateway

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

    

thebrightlabs / laravel-qicard-gateway example snippets


Route::get('/payment/plan/{id}', function ($planId) {
    $plan = Plan::find($planId);
    $user = auth()->user();
    $qiCardGateway = app(QiCardGateway::class);
    $data = [
        'amount' => $plan->price,
        'locale' => app()->getLocale(),
        'description' => $plan->description,
        'currency' => 'IQD',
        'customerInfo' => [
            'customer_name' => $user->name,
            'customer_email' => $user->email,
        ],
        'request_id' => (string)Str::uuid(),
        'additionalInfo' => [
            "user_id" => $user->id,
            "planType" => $plan->type,
            "planUnitCount" => $plan->unit_count,
        ],
    ];
    return $qiCardGateway->makeSubscription($data, $plan);
})->name('submit');

Schedule::exec('qiCard:status-check')
    ->everyTenMinutes();
bash
   php artisan vendor:publish --provider="Thebrightlabs\QiCard\QiCardServiceProvider"
   
bash
   php artisan migrate
   
bash
   php artisan db:seed --class="Thebrightlabs\QiCard\Seeders\PlansTableSeeder"