Skip to main content

Getting started

To be able to use and test payment gateway you need to have Client ID and Client secret from TB developer portal.

Installation

To install PHP SDK, you need to install tatrapayplus/tatrapayplus_api_client library via composer.\

You can add requirement from command line by running:
composer require tatrapayplus/tatrapayplus_api_client=^2.0

Alternatively, inside your composer.json file for your project, add new requirement:

{
"name": "project name",
// ...
"require": {
// ...
"tatrapayplus/tatrapayplus_api_client": "2.0.0"
},
// ...
}

Afterwards, run command composer install to install new dependency.

Client initialization

To start working with the API, you need to initialize the TatraPayPlusAPIApi with the following parameters:

<?php
use Tatrapayplus\TatrapayplusApiClient\Api\TatraPayPlusAPIApi;

$tatrapayplus_api = new TatraPayPlusAPIApi(
"your-client-id",
"your-client-secret",
mode: TatraPayPlusAPIApi::SANDBOX
);

There are 2 supported modes:

  • SANDBOX (default): requests will be sent to SANDBOX (test) environment of gateway
  • PRODUCTION: requests will be sent to PRODUCTION (live) environment of gateway