1. Go to this page and download the library: Download tuks128/g2a-pay-php5-api 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/ */
tuks128 / g2a-pay-php5-api example snippets
use Tuxxx128\G2aPay\G2aPayApi;
use Tuxxx128\G2aPay\G2aPayItem;
$g2aPayApi = new G2aPayApi('API HASH', 'SECRET KEY', true, 'EMAIL OF STORE');
$item = (new G2aPayItem)->itemTemplate();
$item->name = "My item";
$item->url = "http://...";
$item->price = 10; // default currency is 'EUR'
$g2aPayApi->addItem($item);
$item = (new G2aPayItem)->itemTemplate();
$item->name = "Discount";
$item->url = "http://...";
$g2aPayApi->setCurrency("USD"); // from default currency 'EUR' to 'USD'