First Atlantic Commerce driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements First Atlantic Commerce support for Omnipay.
We invest a lot of resources into creating opensource products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
You can install the package via composer:
composer require shamarkellman/omnipay-first-atlantic-commerce
$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 included
'amount' => '10.00',
'currency' => 'USD',
'transactionId' => '1234',
'card' => $cardData,
'testMode' => true //use for calls to FAC sandbox
])->send();
if ( $response->isSuccessful() ) {
print_r($response);
}
else {
echo $response->getMessage();
}
$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 included
'amount' => '10.00',
'currency' => 'USD',
'transactionId' => '1234',
'card' => $cardData,
'testMode' => true //use for calls to FAC sandbox
])->send();
if ( $response->isSuccessful() ) {
print_r($response);
}
else {
echo $response->getMessage();
}
$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 requirements
'cardHolderResponseURL' => 'https://merchant/response/page.php',
'pageSet' => 'pageSetFromPanel',
'pageName' => 'pageNameFromPanel',
])->send();
if ( $response->isSuccessful() ) {
$response->getRedirectUrl();
$response->getToken(); //the single use token to build hosted page URL. See doc
}
else {
echo $response->getCode();
echo $response->getMessage();
}
This returns the payment data for the hosted payment
$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();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.