PHP code example of arm092 / omnipay-telcell

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

    

arm092 / omnipay-telcell example snippets


    use Omnipay\Omnipay;


    $gateway = Omnipay::create('Telcell');
    $gateway->setShopId(env('TELCELL_SHOP_ID'));
    $gateway->setShopKey(env('TELCELL_SHOP_KEY'));
    $gateway->setLanguage(\App::getLocale()); // Language
    $gateway->setAmount(200); // Amount to charge
    $gateway->setDescription(1); // Product description
    $gateway->setValidDays(1); // Days during which the invoice is valid
    $gateway->setTransactionId(XXXX); // Transaction ID from your system



    $purchase = $gateway->purchase()->send();
    $purchase->redirect();



    $gateway = Omnipay::create('Telcell');
    $gateway->setShopId(env('TELCELL_SHOP_ID'));
    $gateway->setShopKey(env('TELCELL_SHOP_KEY'));
    
    $purchase = $gateway->completePurchase()->send();
    
    // Do the rest with $purchase and response with 'OK'
    if ($purchase->isSuccessful()) {
        
        // Your logic
        
    }
    
    return new Response('OK');