2017-25 © Pedro Peláez
 

library omnipay-ameriabank

Ameria Bank Package

image

haykkarapetyan/omnipay-ameriabank

Ameria Bank Package

  • Thursday, July 26, 2018
  • by haykkarapetyan
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Omnipay: Ameriabank

Ameriabank driver for the Omnipay Laravel payment processing library, (*1)

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements iDram support for Omnipay., (*2)

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:, (*3)

{
    "require": {
        "haykkarapetyan/omnipay-ameriabank": "dev-master"
    }
}

And run composer to update your dependencies:, (*4)

composer update

Or you can simply run, (*5)

composer require haykkarapetyan/omnipay-ameriabank

Basic Usage

  1. Use Omnipay gateway class:
    use Omnipay\Omnipay;
  1. Initialize Ameriabank gateway:

$gateway = Omnipay::create('Ameriabank'); $gateway->setClientId('Client_ID'); // Shoud be your Ameriabank Client ID (e.g. 7e7ef8ff-6300-4a78-bb31-3ad1a8c67d5f) $gateway->setUsername('Username'); // Should be your Ameria Username $gateway->setPassword('Password'); // Should be your Ameria password $gateway->setOpaque('Opaque'); // Is not mandatory field and used as additional information during information exchange $gateway->setOrderId('Order_ID'); // Is randomly generated ID. Integer which is generated by using system local time e.g. time() $gateway->setCurrency('AMD'); // Uses national currency e.g. AMD, USD, EUR $gateway->setTestMode(false); // Boolean and can be only true or false $payment = $gateway->purchase([ 'amount' => '100', 'returnUrl' => 'http://example.com/xxx', // The URL to which you will be redirected after completing the purchase. Please also refer to poin 4 below 'description' => 'Description ...' ] )->createPaymentRequest();
  1. Processing payment
    After payment request approval, call receive positive or negative response

if (empty($payment->GetPaymentIDResult->PaymentID) || $payment->GetPaymentIDResult->Respmessage != 'OK') { return $payment->GetPaymentIDResult; // in case if response was negative (rejected). } else { $gateway->setPaymentId($payment->GetPaymentIDResult->PaymentID); //if positive, call receive payment ID $gateway->setClientUrl("http://example.com/ameriarequestframe.aspx"); // Setting /ameriarequestframe.aspx inside your site $gateway->setLanguage('en'); $response = $gateway->purchase()->send(); // generate unique URL return [ 'redirectUrl' => $response->getRedirectUrl() // redirection to previously generated unique URL ]; }
  1. Completeng Payment
    You will be redirected to AmeriaBank VPOS form page. After filling and submitting credit card data AmeriaBank page will webhook http://example.com/xxx (refer to also to point 2)

$gateway = Omnipay::create('Ameriabank'); $gateway->setClientId('Client_ID'); // Shoud be your Ameriabank Client ID (e.g. 7e7ef8ff-6300-4a78-bb31-3ad1a8c67d5f) $gateway->setUsername('Username'); // Should be your Ameria Username $gateway->setPassword('Password'); // Should be your Ameria password $gateway->setOrderId('Order_ID'); // Is randomly generated ID. Integer which is generated by using system local time e.g. time() $gateway->setTestMode(false); // Boolean and can be only true or false $$webService = $gateway->completePurchase([ 'amount' => '100' ] )->getPaymentFields(); if ($paymentFields = $webService->GetPaymentFieldsResult) { // Your logic return $paymentFields; } return $webService; // Return error text in case of connection errors

For testing puposes you should use only AMD currency and charge not more than 10 AMD, (*6)

For general usage instructions, please see the main Omnipay repository., (*7)

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., (*8)

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., (*9)

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., (*10)

The Versions

26/07 2018

dev-master

9999999-dev

Ameria Bank Package

  Sources   Download

MIT

The Requires

 

by Hayk Karapetyan

04/07 2018

1.0.0

1.0.0.0

Ameria Bank Package

  Sources   Download

MIT

by Hayk Karapetyan