PHP code example of futureecom / omnipay-tranzila

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

    

futureecom / omnipay-tranzila example snippets




use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->authorize([
    'amount' => '10.00',
    'currency' => 'ILS',
    'myid' => '12345678',
    'card' => [
        'ccno' => '4444333322221111',
        'expdate' => '1225',
        'mycvv' => '1234',
    ],
])->send();



use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->authorize([
    'amount' => '10.00',
    'currency' => 'ILS',
    'myid' => '12345678',
])->send();

if ($response->isRedirect()) {
    echo $response->getRedirectUrl(); // https://direct.tranzila.com/terminal_name/iframe.php?tranmode=V&currency=1&sum=1.00
}



use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->capture([
    'amount' => '1',
    'transaction_reference' => '22-000000',
])->send();



use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->purchase([
    'amount' => '10.00',
    'currency' => 'ILS',
    'myid' => '12345678',
    'card' => [
        'ccno' => '4444333322221111',
        'expdate' => '1225',
        'mycvv' => '1234',
    ],
])->send();



use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->refund([
    'amount' => '5.00',
    'currency' => 'ILS',
    'transaction_reference' => '22-000000',
])->send();



use Futureecom\OmnipayTranzila\TranzilaGateway;

/** @var TranzilaGateway $gateway */
$response = $gateway->void([
    'transaction_reference' => '22-000000',
    'TranzilaTK' => 'DdyniRvcUGHBj9xO', // TranzilaToken
])->send();