// Array with meta tag data $metaData = array( "" => array( "title" => "Online Payment System | Connecting Payment Systems and Banks Without Fees.", "description" => "Tegro.money offers advantageous tariff plans for online acquiring with a variety of payment acceptance methods. Register and start accepting payments today!", "keywords" => "tegro, online cash register, internet acquiring, payment acceptance, fund withdrawal, acquiring, card payment, online payment, online payment through internet, tegro.money" ), "referral-program" => array( "title" => "Referral Program | Online Payment System - Tegro.Money", "description" => "Invite acquaintances and friends – earn a percentage of their turnover. A unique opportunity for additional income from invited users.", "keywords" => "tegro, online cash register, internet acquiring, partnership, referral" ), "security" => array( "title" => "Security | Online Payment System - Tegro.Money", "description" => "We use PCI DSS security standard, SSL protocol, Verified by Visa and MasterCard SecureCode security systems.", "keywords" => "" ), "pricing" => array( "title" => "Tariffs | Online Payment System - Tegro.Money", "description" => "Payments for your customers will become simpler and more accessible, and more profitable for you.", "keywords" => "" ), "coupons" => array( "title" => "Discounts and Coupons | Online Payment System - Tegro.Money", "description" => "Payments for your customers will become simpler and more accessible, and more profitable for you.", "keywords" => "" ), "advantages" => array( "title" => "Our Advantages | Online Payment System - Tegro.Money", "description" => "Utilize all the features of Tegro.money service.", "keywords" => "" ), "policy" => array( "title" => "Personal Data Processing Policy | Tegro.Money", "description" => "Tegro.Money prioritizes compliance with and protection of its clients' interests.", "keywords" => "" ), "offer" => array( "title" => "Public Offer for Agreement on Use of Tegro.Money Service", "description" => "Agreement on Use of Tegro.Money Service", "keywords" => "" ), "contacts" => array( "title" => "Contacts | About Tegro.Money Company", "description" => "We are a modern IT company that provides services for electronic payments on the internet and beyond.", "keywords" => "" ), "docs/en/" => array( "title" => "Documentation and API | Tegro.Money", "description" => "Tegro.money API allows you to accept payments, process refunds, check transaction statuses, and much more. To use the API, you'll need to have a store in our system.", "keywords" => "" ) ); // Get the current page's name $current_page = basename($_SERVER['REQUEST_URI'], ""); // Check if there's data for the current page in the $metaData array if (array_key_exists($current_page, $metaData)) { $title = $metaData[$current_page]["title"]; $description = $metaData[$current_page]["description"]; $keywords = $metaData[$current_page]["keywords"]; } else { // If data is absent, set default values $title = "Online Payment System"; $description = "Tegro.money offers advantageous tariff plans for online acquiring with a variety of payment acceptance methods."; $keywords = "tegro, online cash register, internet acquiring, payment acceptance, fund withdrawal, acquiring, card payment, online payment, online payment through internet, tegro.money"; } ?>

General Information

Obtaining an API Key

You can generate an API key to access the Tegro.money REST service by visiting the store settings page.

API Key

All data sent in requests to the Tegro.money service is done using the POST method over the HTTP protocol at the address https://tegro.money/api/method. Message parameters are organized as a JSON object.

You must include a signature along with the request. The entire request body needs to be signed exactly as it's sent to the Bank's server (after converting the request body into JSON for HTTP transmission).

In every request, the nonce parameter must be unique compared to the previous one! For instance, you can use the current time in seconds.

Utilize your secret key to create the signature. Construct the signature using the SHA-256 algorithm.


    <?php

        $api_key = 'EEFA1913EA9D9351469B1E5D852A';

        $data = array(
            'shop_id' => '1913EA9D9351469B1E5D852A',
            'nonce' => time(),
        );

        $body = json_encode($data);
        $sign = hash_hmac('sha256', $body, $api_key);

        $curl = curl_init();

        curl_setopt_array($curl, array(
        CURLOPT_URL => "https://tegro.money/api/orders/",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => $body,
        CURLOPT_HTTPHEADER => array(
            "Authorization: Bearer $sign",
            "Content-Type: application/json"
        ),
        ));

        $response = curl_exec($curl);

        curl_close($curl);
        echo $response;
    ?>