bariew/tranzila

Tranzila API

dev-main 2025-08-28 15:08 UTC

This package is not auto-updated.

Last update: 2025-08-29 06:58:06 UTC


README

Tranzila API client.

Description

Processes payments via Israeli company Tranzila

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist bariew/tranzila

or add

"bariew/tranzila": "dev-master"

to require the section of your composer.json file.

Usage

$tranzila = Api::instance($key, $secret, $terminalName);
// get all payments details by email  
$emailPayments = $tranzila->get(['client_email' => 'user@email.com']);
// get payment details by id 
$payment = $tranzila->getSto(4111);
// deactivate a requrring payment
$tranzila->activate(4111, false);
// uprade an existing payment with a new price
$tranzila->upgrade(4111, 1000);
// create a new requrring payment
$response = $tranzila->create([
    'sto_payments_number' => 9999,
    'charge_frequency' => 'monthly',
    'first_charge_date' => '2025-01-31',
    'charge_dom' => 28, // charge day
    'client' => $payment['client'],
    'item' => array_merge($payment['item'], [
        'unit_price' => 100,
//              'code' => 'AA-1246-111-B',
//              'name' => 'My Product Name',
    ], [
        'units_number' => (int) $payment['item']['units_number'],
        'vat_percent' => (int) $payment['item']['vat_percent'],
    ]),
    'card' => array_merge($payment['card'], [
        'expire_month' => (int) $payment['card']['expire_month'],
        'expire_year' => 2000 + (int) $payment['card']['expire_year'],
    ]),
    'response_language' => 'english',
    //   'msv' => ['bank_code' => 12, 'branch_code' => '659', 'account_number' => '127963',],
    // 'created_by_user' => 'Pavel',
]);