PHP code example of milyoona / laravel-ipg

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

    

milyoona / laravel-ipg example snippets


$app->register(Milyoona\Ipg\MilyoonaIpgServiceProvider::class);

    
    use Milyoona\Ipg\Facades\MilyoonaIpg;
    
    MilyoonaIpg::terminal('YOUR_TERMINAL_ID')
        ->amount('AMOUNT_OF_PRODUCT')
        ->callbackUrl('YOUR_CALLBACK_URL')
        ->getToken(); // or ->pay(); for redirect to gateway page
            
    // If you set the terminal_id and callback_url in config/milyoona_ipg.php you not need to fill this methods.
    MilyoonaIpg::amount('PRICE_OF_PRODUCT')->getToken(); // or ->pay(); for redirect to gateway page
    

    
    use Milyoona\Ipg\Facades\MilyoonaIpg;
    
    MilyoonaIpg::terminal('YOUR_TERMINAL_ID')
        ->amount('PRICE_OF_PRODUCT')
        ->callbackUrl('YOUR_CALLBACK_URL')
        ->option([
            'mobile' => 'MOBILE',
            'national_code' => 'NATIONAL_CODE',
            'order_id' => 'ORDER_ID',
            'card_no' => 'CARD_NUMBER',
            'description' => 'YOUR_DESCRIPTION',
        ])
        ->getToken(); // or ->pay(); for redirect to gateway page
    

    
    use Milyoona\Ipg\Facades\MilyoonaIpg;
    
    MilyoonaIpg::terminal('YOUR_TERMINAL_ID')
        ->token('YOUR_TOKEN')
        ->verify(); // or ->trace();
        
    // If you set the terminal_id in config/milyoona_ipg.php you not need to fill this method.
    MilyoonaIpg::token('YOUR_TOKEN')
        ->verify(); // or ->trace();
    
bash
php artisan vendor:publish --tag=milyoona_ipg