1. Go to this page and download the library: Download ampeco/omnipay-bankart 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-bankart example snippets
$gateway = Omnipay::create('\Ampeco\OmnipayBankart\Gateway');
$gateway->initialize([
'username' => 'Your API username',
'password' => 'Your API password',
'apiKey' => 'Your API key',
'sharedSecret' => 'Your API shared secret',
]);
$response = $gateway->createCard([
'transaction_id' => uniqid('', true),
'description' => 'Description',
'return_url' => 'https://your-return-url',
'notify_url' => 'https://your-notify-url',
'customer' => [
'first_name' => 'John',
'last_name' => 'Doe',
'identification' => 1,
'email' => '[email protected]',
'billingAddress1' => 'None',
'billingCity' => 'Unknown',
'billingCountry' => 'NA',
'billingPostcode' => '0000',
]
])->send();
if (!$response->isSuccessful()) {
abort(422, $response->getMessage());
}
// You must redirect the client to:
echo $response->getRedirectUrl();
echo $response->getTransactionReference(); // The transaction ID assigned by the bank