1. Go to this page and download the library: Download nokimaro/liontech-php-sdk 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/ */
// Webhook Signature Verification
$verifier = $liontech->webhookVerifier(); // auto-fetches public key
$verifier = $liontech->webhookVerifier($pemKey); // or provide your own
$isValid = $verifier->verify($headers, $payload);
// Card Encryption
$encryptor = $liontech->cardEncryptor(); // auto-fetches encryption key
$encryptor = $liontech->cardEncryptor($pemKey); // or provide your own
$encrypted = $encryptor->encryptForPayment([
'pan' => '4405639704015096',
'cvv' => '123',
'exp_month' => 12,
'exp_year' => 2030,
'cardHolder' => 'John Doe',
]);
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory;
use Nokimaro\LionTech\Client;
use Nokimaro\LionTech\Http\Transport;
$transport = new Transport(
baseUrl: 'https://api.fusionpayments.io',
client: new GuzzleClient(),
requestFactory: new HttpFactory(),
streamFactory: new HttpFactory(),
);
$liontech = new Client(
accessToken: 'your_token',
httpClient: $transport,
);
use Nokimaro\LionTech\Client;
// Via constructor
$liontech = new Client(
accessToken: 'your_sandbox_token',
baseUrl: 'https://api.sandbox.fusionpayments.io',
secureUrl: 'https://secure.sandbox.fusionpayments.io',
);
// Via builder
$liontech = Client::builder()
->accessToken('your_sandbox_token')
->sandbox()
->build();
use Nokimaro\LionTech\Exceptions\Auth\AuthenticationException;
use Nokimaro\LionTech\Exceptions\Auth\TokenExpiredException;
use Nokimaro\LionTech\Exceptions\Business\ConflictException;
use Nokimaro\LionTech\Exceptions\RateLimitException;
use Nokimaro\LionTech\Exceptions\ResourceNotFoundException;
use Nokimaro\LionTech\Exceptions\Transport\TransportException;
use Nokimaro\LionTech\Exceptions\Validation\ValidationException;
try {
$payment = $liontech->payments()->create($request);
} catch (TokenExpiredException $e) {
// Token expired — refresh and retry
$liontech->auth()->refreshAndApply($refreshRequest);
$payment = $liontech->payments()->create($request);
} catch (ValidationException $e) {
// Invalid request data
$errors = $e->getErrors();
} catch (ResourceNotFoundException $e) {
// Resource doesn't exist
} catch (AuthenticationException $e) {
// Authentication failed
} catch (RateLimitException $e) {
// Too many requests
} catch (TransportException $e) {
// Network or server error
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.