PHP code example of sherbacov / omnipay-ameria

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

    

sherbacov / omnipay-ameria example snippets


    use Omnipay\Omnipay;

     $gateway = Omnipay::create('AMERIA');
     $gateway->setClientId(env('clientId'));
     $gateway->setUsername(env('username'));
     $gateway->setPassword(env('password'));
     $gateway->setTestMode('bool');
     $gateway->setLanguage('ameria language');
     $gateway->setDescription('some description');
     $gateway->setAmount(10);  // Amount to charge, for test it should be 10
     $gateway->setTransactionId('XXXX');  // Transaction ID from your system
     ....

     $purchase = $gateway->purchase()->send();
     if ($purchase->isRedirect()) {
         $purchase->redirect();
     }


    $gateway = Omnipay::create('Ameria');
    $gateway->setClientId(env('clientId'));
    $gateway->setUsername(env('username'));
    $gateway->setPassword(env('password'));
    
    $purchase = $gateway->completePurchase('paymentID')->send();
    
    if ($purchase->isSuccessful()) {       
        // Your logic     
    }
    
    return new Response('OK');