PHPackages                             transact-pro/gate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. transact-pro/gate

ActiveLibrary[API Development](/categories/api)

transact-pro/gate
=================

TransactPRO php integration

v1.2.3(2y ago)1297.8k↓41.2%7[2 PRs](https://github.com/TransactPRO/transactpro-integration-php/pulls)MITPHPCI passing

Since Jul 10Pushed 3mo ago8 watchersCompare

[ Source](https://github.com/TransactPRO/transactpro-integration-php)[ Packagist](https://packagist.org/packages/transact-pro/gate)[ RSS](/packages/transact-pro-gate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (31)Used By (0)

TransactPRO PHP integration
===========================

[](#transactpro-php-integration)

[![Build Status](https://camo.githubusercontent.com/0bcd3418618cdaeefd5757adea796233cd5f70f5b57c7a657a66222edea6b420/68747470733a2f2f7472617669732d63692e6f72672f5472616e7361637450524f2f7472616e7361637470726f2d696e746567726174696f6e2d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/TransactPRO/transactpro-integration-php)[![Coverage Status](https://camo.githubusercontent.com/96b51c3ad7fe62e178c1ce0551365ab79f6a7b9b07dce90944f282c30c7e0bfa/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f5472616e7361637450524f2f7472616e7361637470726f2d696e746567726174696f6e2d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/TransactPRO/transactpro-integration-php?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9e28d6771b021e3c29704b656dc6969b138ca9a8ff21d6afa0bcd045e190e998/68747470733a2f2f706f7365722e707567782e6f72672f7472616e736163742d70726f2f676174652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/transact-pro/gate)[![Latest Stable Version](https://camo.githubusercontent.com/1412fbd9884f2954ef5c34c4d0088c686bddde74d05eb75a435da0284466c0ff/68747470733a2f2f706f7365722e707567782e6f72672f7472616e736163742d70726f2f676174652f762f737461626c652e737667)](https://packagist.org/packages/transact-pro/gate)[![License](https://camo.githubusercontent.com/53427077135d1a11450d2a6033eaafce2aef0bbaff1e7c527f38993a708d29ee/68747470733a2f2f706f7365722e707567782e6f72672f7472616e736163742d70726f2f676174652f6c6963656e73652e737667)](https://packagist.org/packages/transact-pro/gate)

Library provide ability to make requests to TransactPRO Gateway API.
Library are supported by me, and not by TransactPRO. So, submit all requests, issues and questions directly here (on GitHub). Library provided as is.
You must adopt library for your projects by yourselves, I only provide basic functionality to make requests.

Installation
============

[](#installation)

### Composer

[](#composer)

Recommended way of installation is through [composer](http://getcomposer.org/).
Run command line command `composer require transact-pro/gate` or add to your composer.json:

```
"require": {
    "transact-pro/gate": "^v1.1"
}
```

And then install with:

```
$ composer.phar install
```

### Manual

[](#manual)

You can manually download library and use autoloader.

```
require_once 'lib/autoloader.php'
```

Usage
=====

[](#usage)

### Create gate client

[](#create-gate-client)

FieldMandatoryTypeDescriptionapiUrlyesstringApi URL. Can be aquired via Integration manual.guidyesstringMerchant GUID.pwdyesstringUnecrypted password. It will be encrypted by client.verifySSLnoboolDefault: `true`. Must be set to `false` for test environment#### Basic client

[](#basic-client)

```
use TransactPRO\Gate\GateClient;

$gateClient = new GateClient(array(
    'apiUrl'    => 'https://www.payment-api.com',
    'guid'      => 'AAAA-AAAA-AAAA-AAAA',
    'pwd'       => '111'
));
```

#### Client with disabled SSL check.

[](#client-with-disabled-ssl-check)

```
use TransactPRO\Gate\GateClient;

$gateClient = new GateClient(array(
    'apiUrl'    => 'https://www.payment-api.com',
    'guid'      => 'AAAA-AAAA-AAAA-AAAA',
    'pwd'       => '111',
    'verifySSL' => false
));
```

### Actions

[](#actions)

GateClient instance provide number of actions, such as 'charge' or 'status\_request'. All data passed into action are validated and if mandatory field missed, then exception will be raised. Please check integration manual, to get more info about required data for each action.

#### Init

[](#init)

```
$response = $gateClient->init(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => '1',
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com'
));
```

#### Charge

[](#charge)

```
$response = $gateClient->charge(array(
    'f_extended'                  => '5',
    'init_transaction_id'         => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc'                          => '5111111111111111',
    'cvv'                         => '111',
    'expire'                      => '01/20',
    'browser_accept_header'       => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    'browser_java_enabled'        => true,
    'browser_javascript_enabled'  => true,
    'browser_language'            => "en-US",
    'browser_color_depth'         => "24",
    'browser_screen_height'       => "1080",
    'browser_screen_width'        => "1920",
    'browser_tz'                  => "-180" ,
    'browser_user_agent'          => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
));
```

#### Init DMS

[](#init-dms)

```
$response = $gateClient->initDms(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com'
));
```

#### Make hold

[](#make-hold)

```
$response = $gateClient->makeHold(array(
    'f_extended'          => '5',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc'                  => '5111111111111111',
    'cvv'                 => '111',
    'expire'              => '01/20'
));
```

#### Charge hold

[](#charge-hold)

```
$response = $gateClient->chargeHold(array(
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg'
));
```

#### Cancel DMS

[](#cancel-dms)

```
$response = $gateClient->cancelDms(array(
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'amount_to_refund'    => '100'
));
```

#### Cancel request

[](#cancel-request)

```
$response = $gateClient->cancelRequest(array(
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg'
));
```

#### Refund

[](#refund)

```
$response = $gateClient->refund(array(
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'amount_to_refund'    => '100'
));
```

#### Status request

[](#status-request)

```
$response = $gateClient->statusRequest(array(
    'request_type'        => 'transaction_status',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'f_extended'          => '5'
));
```

#### Init P2P transactions

[](#init-p2p-transactions)

```
$response = $gateClient->initP2P(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com',
    'save_card'               => '1',
    'cardname'                => 'John Doe',
    'recipient_name'          => 'Jane Doe',
    'client_birth_date'       => '06291988',
));
```

#### Do P2P transactions

[](#do-p2p-transactions)

```
$response = $gateClient->doP2P(array(
    'f_extended'          => '5',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc_2'                => '5111111111111111',
));
```

#### Init B2P transactions

[](#init-b2p-transactions)

```
$response = $gateClient->initB2P(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '10',
    'currency'                => 'RUB',
    'name_on_card'            => 'John Doe 1',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'noemail@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'client_birth_date'       =>  '15101970',
    'merchant_site_url'       => 'http://www.example.com',
));
```

#### Do B2P transactions

[](#do-b2p-transactions)

```
$response = $gateClient->chargeB2P(array(
    'f_extended'          => '5',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc_2'                => '5111111111111111',
    'expire2' => '11/22',
));
```

#### Init Credit transactions

[](#init-credit-transactions)

```
$response = $gateClient->initCredit(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com',
));
```

#### Do Credit transactions

[](#do-credit-transactions)

```
$response = $gateClient->doCredit(array(
    'f_extended'             => '5',
    'init_transaction_id'    => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc'                     => '5111111111111111',
    'cvv'                    => '111',
    'expire'                 => '01/20',
    'merchant_referring_url' => 'http://www.payment.example.com/id=example_referring_id',
));
```

#### Init A2A transactions

[](#init-a2a-transactions)

```
$response = $gateClient->initA2A(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' =>  microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com',
    'save_card'               => '1',
    'cardname'                => 'John Doe',
    'client_birth_date'       => '29061988',
));
```

#### Do A2A transactions

[](#do-a2a-transactions)

```
$response = $gateClient->doA2A(array(
    'f_extended'          => '5',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc_2'                => '5111111111111111',
));
```

#### Init store card for further SMS transactions without card

[](#init-store-card-for-further-sms-transactions-without-card)

```
$response = $gateClient->initStoreCardSms(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => '1',
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com'
));
```

#### Init store card for further Credit transactions without card

[](#init-store-card-for-further-credit-transactions-without-card)

```
$response = $gateClient->initStoreCardCredit(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com',
));
```

#### Init store card for further P2P transactions without card

[](#init-store-card-for-further-p2p-transactions-without-card)

```
$response = $gateClient->initStoreCardP2P(array(
    'rs'                      => 'AAAA',
    'merchant_transaction_id' => microtime(true),
    'user_ip'                 => '127.0.0.1',
    'description'             => 'Test description',
    'amount'                  => '100',
    'currency'                => 'LVL',
    'name_on_card'            => 'Vasyly Pupkin',
    'street'                  => 'Main street 1',
    'zip'                     => 'LV-0000',
    'city'                    => 'Riga',
    'country'                 => 'LV',
    'state'                   => 'NA',
    'email'                   => 'email@example.lv',
    'phone'                   => '+371 11111111',
    'card_bin'                => '511111',
    'bin_name'                => 'BANK',
    'bin_phone'               => '+371 11111111',
    'merchant_site_url'       => 'http://www.example.com',
    'save_card'               => '1',
    'cardname'                => 'John Doe',
    'recipient_name'          => 'Jane Doe',
    'client_birth_date'       => '06291988',
));
```

#### Store card for further transactions without card

[](#store-card-for-further-transactions-without-card)

```
$response = $gateClient->storeCard(array(
    'f_extended'          => '5',
    'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'cc'                  => '5111111111111111',
    'expire'              => '01/20'
));
```

#### Initial recurrent transaction (usual, P2P, Credit)

[](#initial-recurrent-transaction-usual-p2p-credit)

For usual Recurrent use:

- initRecurrent

For P2P recurrent use:

- initRecurrentCredit

For Credit recurrent use:

- initRecurrentP2P

For Credit recurrent use:

- initRecurrentA2A

`Fields in these requests are same, read documetation for details.`

Example:

```
$response = $gateClient->initRecurrent(array(
    'rs'                      => 'AAAA',
    'original_init_id'        => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
    'merchant_transaction_id' => microtime(true),
    'amount'                  => '100',
    'description'             => 'Test description',
));
```

### Charge recurrent transaction

[](#charge-recurrent-transaction)

For usual Recurrent use:

- chargeRecurrent

For P2P recurrent use:

- doRecurrentCredit

For Credit recurrent use:

- doRecurrentP2P

For A2A recurrent use:

- doRecurrentA2A

Example:

```
$response = $gateClient->chargeRecurrent(array(
    'f_extended'             => '5',
    'init_transaction_id'    => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
));
```

### Response

[](#response)

Response instance returned as action result.

#### isSuccess

[](#issuccess)

To check if curl request was successful, you can use `isSuccessful` method;

```
$response->isSuccessful(); // Return bool.
```

#### getResponseContent

[](#getresponsecontent)

To get raw response you can use `getResponseContent`.

If request was successful, then API response was returned. If not, then curl\_error was returned.

```
$response->getResponseContent(); // Return string.
$response->getParsedResponse();  // Parsed response content.
```

Tests
=====

[](#tests)

If you wish to run tests, you need to install development dependencies:

```
$ composer.phar install --dev
```

And then run them with:

```
$ vendor/bin/phpunit
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance53

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~202 days

Recently: every ~392 days

Total

18

Last Release

881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1a25273a3310cb3c0b7f2abaa4ee25b7cff09fba0077ee9afd8b29de58a3dec?d=identicon)[pashira](/maintainers/pashira)

---

Top Contributors

[![uLow](https://avatars.githubusercontent.com/u/1608213?v=4)](https://github.com/uLow "uLow (107 commits)")[![FylmTM](https://avatars.githubusercontent.com/u/626772?v=4)](https://github.com/FylmTM "FylmTM (56 commits)")[![pashira](https://avatars.githubusercontent.com/u/542115?v=4)](https://github.com/pashira "pashira (33 commits)")[![LinMAD](https://avatars.githubusercontent.com/u/13393702?v=4)](https://github.com/LinMAD "LinMAD (14 commits)")[![mg-code](https://avatars.githubusercontent.com/u/1376496?v=4)](https://github.com/mg-code "mg-code (6 commits)")[![OlegGS](https://avatars.githubusercontent.com/u/1352751?v=4)](https://github.com/OlegGS "OlegGS (4 commits)")[![rolandinsh](https://avatars.githubusercontent.com/u/108597?v=4)](https://github.com/rolandinsh "rolandinsh (4 commits)")[![skibish](https://avatars.githubusercontent.com/u/5479211?v=4)](https://github.com/skibish "skibish (3 commits)")[![fazleelahhee](https://avatars.githubusercontent.com/u/1755254?v=4)](https://github.com/fazleelahhee "fazleelahhee (1 commits)")[![dmitryakadiamond](https://avatars.githubusercontent.com/u/1363588?v=4)](https://github.com/dmitryakadiamond "dmitryakadiamond (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/transact-pro-gate/health.svg)

```
[![Health](https://phpackages.com/badges/transact-pro-gate/health.svg)](https://phpackages.com/packages/transact-pro-gate)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
