Ameria bank driver for the Omnipay Laravel payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements Ameria support for Omnipay.
Omnipay is installed via Composer. To install, simply add it
to your composer.json
file:
{
"require": {
"sarsam/omnipay-ameria": "dev-master"
}
}
And run composer to update your dependencies:
composer update
Or you can simply run
composer require sarsam/omnipay-ameria
- Use Omnipay gateway class:
use Omnipay\Omnipay;
- Initialize Ameria gateway:
$gateway = Omnipay::create('AMERIA');
$gateway->setClientId(env('clientId'));
$gateway->setUsername(env('username'));
$gateway->setPassword(env('password'));
$gateway->setTestMode('bool');
$gateway->setLanguage('ameria language');
$gateway->setDescription('some description');
$gateway->setAmount(10); // Amount to charge, for test it should be 10
$gateway->setTransactionId('XXXX'); // Transaction ID from your system
....
- Call purchase, it will automatically redirect to ameria's hosted page
$purchase = $gateway->purchase()->send();
if ($purchase->isRedirect()) {
$purchase->redirect();
}
- Create a webhook controller to handle the callback request at your
RESULT_URL
and catch the webhook as follows
$gateway = Omnipay::create('Ameria');
$gateway->setClientId(env('clientId'));
$gateway->setUsername(env('username'));
$gateway->setPassword(env('password'));
$purchase = $gateway->completePurchase('paymentID')->send();
if ($purchase->isSuccessful()) {
// Your logic
}
return new Response('OK');
In this package implemented AmeriaBank integration vPOS 3.0.
API interaction is performed via data exchange through Rest (except administration page: SOAP) .
For more information read ameria Bank documentation.
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.