PHP code example of shamarkellman / omnipay-first-atlantic-commerce
1. Go to this page and download the library: Download shamarkellman/omnipay-first-atlantic-commerce 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/ */
shamarkellman / omnipay-first-atlantic-commerce example snippets
$gateway = Omnipay::create('FirstAtlanticCommerce');
$gateway->setMerchantId('123456789');
$gateway->setMerchantPassword('abc123');
$gateway->setAcquirerId(12345);
$cardData = [
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
];
$response = $gateway->authorize([
'createCard' => true, //optional - Will return tokenized card if
$gateway = Omnipay::create('FirstAtlanticCommerce');
$gateway->setMerchantId('123456789');
$gateway->setMerchantPassword('abc123');
$gateway->setAcquirerId(12345);
$cardData = [
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
];
$response = $gateway->purchase([
'createCard' => true, //optional - Will return tokenized card if
$gateway = Omnipay::create('FirstAtlanticCommerce');
$gateway->setMerchantId('123456789');
$gateway->setMerchantPassword('abc123');
$gateway->setAcquirerId(12345);
$response = $this->gateway->capture([
'amount' => '10.00',
'currency' => 'USD',
'transactionId' => '1234',
])->send();
if ( $response->isSuccessful() ) {
$response->getCode();
$response->getResponseCode();
$response->getMessage();
$response->getOriginalResponseCode();
}
else {
echo $response->getMessage();
}
$gateway = Omnipay::create('FirstAtlanticCommerce');
$gateway->setMerchantId('123456789');
$gateway->setMerchantPassword('abc123');
$gateway->setAcquirerId(12345);
$response = $this->gateway->hostedPage([
'amount' => '10.00',
'currency' => 'USD',
'transactionId' => '1234',
'transactionCode' => TransactionCode::SINGLE_PASS + TransactionCode::REQUEST_TOKEN, //Use values based on
$gateway = Omnipay::create('FirstAtlanticCommerce');
$gateway->setMerchantId('123456789');
$gateway->setMerchantPassword('abc123');
$gateway->setAcquirerId(12345);
$response = $this->gateway->hostedPageResult([
'token' => '_JBfLQJNiEmFBtnF3AfoeQ2', //token is provided returned in callback after completes hosted page
]);
if ( $response->isSuccessful() ) {
echo $response->getResponseCode();
echo $response->getMessage();
echo $response->getTransactionId();
echo $response->getCardReference(); //if tokenization was requested
}
else {
echo $response->getCode();
echo $response->getMessage();
}