1. Go to this page and download the library: Download ampeco/omnipay-fibank 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/ */
ampeco / omnipay-fibank example snippets
$gateway = Omnipay::create('\Ampeco\OmnipayFibank\Gateway');
$gateway->initialize([
'merchantCertificate' => '... The PEM certificate you got from the bank',
'merchantCertificatePassword' => 'The Certificate Password',
'createCardAmount' => 1.00, // The amount and currency to use for the create account initial payment
'createCardCurrency' => 'BGN',
'testMode' => true,
]);
try{
$response = $gateway->createCard([
'clientIp' => 'CLIENT IP ADDRESS',
'expiry' => date('Y-m-d', strtotime('+10 years')),
'description' => 'Register a new payment method. The amount will be credited to your account',
])->send();
} catch (EcommException $e) {
abort(422, $e->getMessage());
}
if (!$response->isSuccessful()) {
abort(422, $response->getMessage());
}
// You must redirect the client to:
echo $response->getRedirectUrl();
echo $response->getTransactionId(); // The transaction ID assigned by the bank