Skip to content

fintreen/php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP client for fintreen.com.

Fintreen.com php client for crypto-payment gateway API

MIT License

Fintreen.com php client


Explore the docs on apiary »

Report Bug · Request Feature .

>>> Laravel Client <<<

Tested on php 8.0, 8.1, 8.2. Should be also good with php 8.3.

Use composer2 for this

Installation:

composer req fintreen/php-client

Then see example:

Example:

<?php
include "vendor/autoload.php";

use Fintreen\FintreenClient;

// or you can download and use 
// include (__DIR__ . DIRECTORY_SEPARATOR . 'FintreenClient.php');

$token = 'yourtokenhere';
$email = 'youremailhere';
$isTestMode = true;


$fintreenClient = new FintreenClient($token, $email, $isTestMode, true);
$currencies = $fintreenClient->getCurrenciesList();

var_dump($currencies);

$orderStatusList = $fintreenClient->getOrderStatusList();

var_dump($orderStatusList);

// Calculate 25 eur in USDT and BTC
$currencyCodesToCalculate = ['USDT-TRC20', 'USDT-ERC20', 'BTC'];
$calculation = $fintreenClient->calculate(25, $currencyCodesToCalculate);

var_dump($calculation);

// Create order for 26 eur in usdt-trc20
$transactionCreated = $fintreenClient->createTransaction(26, 'USDT-TRC20', FintreenClient::DEFAULT_FIAT_CODE);

var_dump($transactionCreated);

$checkedTransaction = $fintreenClient->checkTransaction((int)$transactionCreated['data']['id']);

var_dump($checkedTransaction);

// Filter params for transactions list
$filters = [];
$filters['statusId'] = 1; // New
$filters['isTest'] = (int)$isTestMode; // should be same or will return 404
$filters['perPage'] = 5; // items per page
$filters['page'] = 1;
$filters['codesFilter'] = implode(',', $currencyCodesToCalculate);// comma seprated codes to filter transaction with
// Note that you can use it without filters

$transactionsList = $fintreenClient->getTransactionsList($filters);

// You can alternatively use $fintreenClient->sendRequest
$anotherFilters['statusId'] = 1; // New
$notFilteredTransactions = $fintreenClient->sendRequest('transactions', 'GET', $anotherFilters);
var_dump(@json_decode($notFilteredTransactions, true));

About

Fintreen.com php client for payment gateway with crypto

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages