tobelyan/omnipay-ameria

Ameria Bank payment gateway using Omnipay library [Laravel]

dev-master 2020-06-01 20:42 UTC

This package is auto-updated.

Last update: 2024-04-29 04:27:25 UTC


README

Ameria bank payment gateway driver

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements Ameria support for Omnipay.

Installation

Omnipay installation is done using Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "tobelyan/omnipay-ameria": "dev-master"
    }
}

And run composer to update your dependencies:

composer update

Or you can simply run

composer require tobelyan/omnipay-ameria

Basic Usage

  1. Call Omnipay gateway class:
    use Omnipay\Omnipay;

1.1 Set your credentials in app.php (located in your conf directory) use code below

    'ameria' => [
        'clientId' => 'YourClientIdHere',
        'username' => 'YourUsernameHere',
        'password' => 'YourPasswordHere',
    ],
  1. Initialize Ameria gateway:
     $gateway = Omnipay::create('Ameria');
     $gateway->setClientId(config('app.ameria.clientId'));
     $gateway->setUsername(config('app.ameria.username'));
     $gateway->setPassword(config('app.ameria.password'));
     $gateway->setCurrency('AMD'); //or USD, RUB
     $gateway->setTestMode('bool'); // set true or false
     $gateway->setParameter('returnUrl','return url here'); // e.g route('ameria.order.check')
     $gateway->setParameter('lang',\App::getLocale()); //or set am, ru
     $gateway->setParameter('OrderID',"123456"); // orderID from Bank
     $gateway->setParameter('amount',$order_amount); // price of product
     $gateway->setParameter('PaymentId',$order_id); // random generated numbers type int
     $gateway->setParameter('description',$description); // Description for your purchase
     $gateway->setParameter('transactionId',$order_id); // random generated numbers type int
     $purchase = $gateway->purchase()->send();
     if ($purchase->isRedirect()) {
         $purchase->redirect();
     }
  1. Create a webhook to handle the callback request at your returnUrl and catch the webhook
    $gateway = Omnipay::create('Ameria');
    $gateway->setClientId(config('app.ameria.clientId'));
    $gateway->setUsername(config('app.ameria.username'));
    $gateway->setPassword(config('app.ameria.password'));
    
    $purchase = $gateway->completePurchase('paymentID')->send();
    
    if ($purchase->isSuccessful()) {       
        // Your logic     
    }
    
    return new Response('OK');

Information

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.

##Developed by DINEURON

Support

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 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.