PHPackages                             ayvazyan10/ameriabankvpos - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. ayvazyan10/ameriabankvpos

ActiveLibrary[Payment Processing](/categories/payments)

ayvazyan10/ameriabankvpos
=========================

AmeriaBank VPOS service for Laravel

v2.8.8(1mo ago)6892MITPHPPHP &gt;=7.4

Since Apr 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ayvazyan10/ameriabankvpos)[ Packagist](https://packagist.org/packages/ayvazyan10/ameriabankvpos)[ Docs](https://github.com/ayvazyan10/ameriabankvpos)[ RSS](/packages/ayvazyan10-ameriabankvpos/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (17)Used By (0)

AmeriaBank VPOS Laravel Package
===============================

[](#ameriabank-vpos-laravel-package)

 This package provides a simple and convenient integration with AmeriaBank VPOS for Laravel applications.

[![Buy me a coffee](https://camo.githubusercontent.com/aed849270fd025c7733a6dcedd69be887c73ea55a6dae5c9a4c3b1431c16c62c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532306d6525323061253230636f666665652d446f6e6174652d79656c6c6f773f7374796c653d666f722d7468652d6261646765266c6f676f3d6275796d6561636f66666565)](https://www.buymeacoffee.com/ayvazyan403)

[![Image Description](https://camo.githubusercontent.com/506debae7206d8d7090564ebd4e6058c739c00cae8ac54b04cb25cbc13920af5/68747470733a2f2f7765646f2e64657369676e2f73746f726167652f75706c6f6164732f696d672f6d61696e2f6c6f676f2d626c61636b2e737667)](https://camo.githubusercontent.com/506debae7206d8d7090564ebd4e6058c739c00cae8ac54b04cb25cbc13920af5/68747470733a2f2f7765646f2e64657369676e2f73746f726167652f75706c6f6164732f696d672f6d61696e2f6c6f676f2d626c61636b2e737667)

### Requirements

[](#requirements)

- PHP &gt;= 7.4
- Laravel 7.x – 13.x

### 🚀 Installation

[](#-installation)

#### Install the package via Composer.

[](#install-the-package-via-composer)

```
composer require ayvazyan10/ameriabankvpos
```

#### Publish the configuration file.

[](#publish-the-configuration-file)

```
php artisan vendor:publish --tag=ameriabankvpos.config
```

#### (Optional) To store transactions in the database, publish the migration and enable it in config.

[](#optional-to-store-transactions-in-the-database-publish-the-migration-and-enable-it-in-config)

```
php artisan vendor:publish --tag=ameriabankvpos.migrations
php artisan migrate
```

Then set `AMERIABANKVPOS_STORE_TRANSACTIONS=true` in your `.env` file. When disabled (default), `check()` returns `"transaction" => null` instead of a database record.

### ⚙️ Configuration

[](#️-configuration)

After publishing the configuration file, you should set your AmeriaBank VPOS credentials/options in the config/ameriabankvpos.php file or in your .env file:

```
AMERIABANKVPOS_CLIENT_ID=your_client_id
AMERIABANKVPOS_USERNAME=your_username
AMERIABANKVPOS_PASSWORD=your_password
AMERIABANKVPOS_BACK_URL=your_back_url_route_name
AMERIABANKVPOS_TEST_MODE=true_or_false
AMERIABANKVPOS_STORE_TRANSACTIONS=true_or_false
AMERIABANKVPOS_CURRENCY=your_currency
AMERIABANKVPOS_LANGUAGE=your_language
```

### 📚 Usage

[](#-usage)

Here is an example of how to use the AmeriaBankVPOS facade or helper in your Laravel application:

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;

// Process the payment with facade and redirect to AmeriaBank payment interface
$initPayment = AmeriaBankVPOS::pay($amount, $orderId, array $options);
// or with helper
// Process the payment with helper and get success response to redirect AmeriaBank payment interface
$initPayment = ameriabank()->pay($amount, $orderId, array $options);

if($initPayment['status'] === "SUCCESS") {
    // If you need to store payment id in your database
    // For get full response use: $initPayment['response'];
    $paymentId = $initPayment['paymentId'];
    // Redirect to AmeriaBank payment interface
    return redirect($initPayment['redirectUrl']);
}

// Check the payment status and return the transaction details
$response = AmeriaBankVPOS::check($request);

// or with helper

$response = ameriabank()->check($request);

// Retrieve data from the transaction
if ($response['status'] === 'SUCCESS') {
    $transaction = $response['transaction'];

    $order_id = $transaction->order_id;
    $user_id = $transaction->user_id;
    $payment_id = $transaction->payment_id;
    $provider = $transaction->Provider;
    // more fields as needed ...
    // you can find all fields in ameriabank_transactions table
}
```

### 📋 Statuses

[](#-statuses)

This package returns the payment status as a string in the status key of the response array. The possible statuses are:

- SUCCESS: The payment approved and can be processed.
- FAIL: The payment failed or was declined.

### ⚡ All Methods

[](#-all-methods)

```
public function cancelPayment($paymentId): array;

public function check(Request $request): array;

public function getPaymentDetails($paymentId): array;

public function pay($amount, int $orderId, array $options = []): array;

public function refund($paymentId, $refundAmount): array;

public function makeBindingPayment($amount, int $orderId, array $options = []): array;

public function getBindings(): array;

public function deactivateBinding(string $cardHolderId): array;

public function activateBinding(string $cardHolderId): array;
```

### 📖 Examples

[](#-examples)

Below are some examples on how to use the package in different scenarios.

### Example 1: Simple Payment

[](#example-1-simple-payment)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;

$amount = 100; // minimum amount while testing is 10 AMD
$orderId = 1; // in test mode order id should be from 2923001 to 2924000
$description = 'Test Payment'; // optional

$initPayment = AmeriaBankVPOS::pay($amount, $orderId, ['Description' => $description]);

if($initPayment['status'] === "SUCCESS") {
    // If you need to store payment id in your database
    // For get full response use: $initPayment['response'];
    $paymentId = $initPayment['paymentId'];
    // Redirect to AmeriaBank payment interface
    return redirect($initPayment['redirectUrl']);
}
```

### Example 2: Payment with Custom Currency and Language, also redirect to different page

[](#example-2-payment-with-custom-currency-and-language-also-redirect-to-different-page)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;

// NOTE. Array is optional and default data injecting from configuration file

$amount = 100;
$orderId = 1;
$description = 'Test Payment'; // optional
$currency = '840'; // optional - currency ISO code (current:USD)
$language = 'en'; // optional
$BackURL = route('my.rounte.name'); // or just url: "https://...."
$opaque = 'Some additional information';

$initPayment = AmeriaBankVPOS::pay($amount, $orderId, [
    'Currency' => $currency,
    'Language' => $language,
    'BackURL' => $BackURL,
    'Opaque' => $opaque,
]);

if($initPayment['status'] === "SUCCESS") {
    // If you need to store payment id in your database
    // For get full response use: $initPayment['response'];
    $paymentId = $initPayment['paymentId'];
    // Redirect to AmeriaBank payment interface
    return redirect($initPayment['redirectUrl']);
}
```

### Example 3: Handling the Payment Response

[](#example-3-handling-the-payment-response)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;
use Illuminate\Http\Request;

// In your controller method, where you handle the payment response
public function handlePaymentResponse(Request $request)
{
    $response = AmeriaBankVPOS::check($request);

    if ($response['status'] === 'SUCCESS') {
        // Handle successful payment
        $transaction = $response['transaction'];
        // You can retrieve additional transaction data as needed
        // For example: $transaction->order_id, $transaction->user_id, etc.
    } else {
        // Handle failed payment
        // Also can retrieve additional transaction data as needed
    }
}
```

### Example 4: Getting the Payment Details

[](#example-4-getting-the-payment-details)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;
use Exception;

// In your controller method or anywhere else
public function giveMeID($payment_id)
{
    try {
        // Actual payment ID to be retrieved
        $paymentDetails = AmeriaBankVPOS::getPaymentDetails($paymentId);

        // Will return details in array
        // Handle payment details as needed
        // For example: $paymentDetails['ApprovedAmount'], $paymentDetails['Description'], etc...
    } catch (Exception $e) {
        // Handle exception as needed
        // For example: Log the error or return an error response
    }
}
```

### Example 5: Refunding a specific payment

[](#example-5-refunding-a-specific-payment)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;
use Exception;

// In your controller method or anywhere else
public function refundPayment($paymentId, $refundAmount)
{
    try {
        // Refund a specific payment partially
        $refundDetails = AmeriaBankVPOS::refund($paymentId, $refundAmount);

        // Will return refund status and details in array
        // Handle refund details as needed
        // For example: $refundDetails['status'], $refundDetails['response']['ResponseCode'], etc...
    } catch (Exception $e) {
        // Handle exception as needed
        // For example: Log the error or return an error response
    }
}
```

This method sends an API request to refund a specific payment partially. It takes two parameters:

$paymentId: The ID of the payment to be refunded. This parameter is required and can be an integer or string value. $refundAmount: The amount to be refunded. This parameter is required and can be an integer or float value. The method returns an associative array with two keys:

"status": Indicates the status of the refund operation. Possible values are "SUCCESS" or "FAIL". "response": Contains the response data from the API. If the refund operation is successful, the response data will contain details about the refunded amount, otherwise it will contain an error message. If an error occurs during the API request, the method will throw an exception with a message describing the error.

### Example 6: Canceling payment

[](#example-6-canceling-payment)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;
use Exception;

// In your controller method or anywhere else
public function cancelPayment($paymentId)
{
    try {
        // Cancel a specific payment
        $cancellationDetails = AmeriaBankVPOS::cancelPayment($paymentId);

        // Will return cancellation status and details in array
        // Handle cancellation details as needed
        // For example: $cancellationDetails['status'], $cancellationDetails['response']['ResponseCode'], etc...
    } catch (Exception $e) {
        // Handle exception as needed
        // For example: Log the error or return an error response
    }
}
```

In this example, the cancelPayment method is called with the $paymentId parameter. Inside the try block, the AmeriaBankVPOS::cancelPayment() method is called with the provided payment ID to initiate a payment cancellation operation. The method returns an associative array with two keys: "status" and "response". These keys contain the cancellation status and details respectively.

After calling the cancelPayment method, you can handle the returned details as needed. For example, you can check the "status" key to see if the cancellation was successful or not, and use the "response" key to get more details about the cancellation operation. In case an exception is thrown during the API request, the catch block will be executed and you can handle the error as needed, such as logging it or returning an error response.

### Example 7: Binding Payments (Subscribe User Card)

[](#example-7-binding-payments-subscribe-user-card)

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;
use Exception;

// In your controller method or anywhere else
public function payForBinding()
{
    // We passing CardHolderID and say with it that this payment need to subscribe
    // for first time
    ameriabank()->pay(10, '3073028', [
        'BackURL' => 'http://127.0.0.1:8000/my-back-route',
        'CardHolderID' => 'EXAMPLEUNIQUESTRING'
    ]);

    // After that we can use EXAMPLEUNIQUESTRING to charge user card
    // with simple post request

    try {
       $resp = ameriabank()->makeBindingPayment(10, '3073035', [
        'CardHolderID' => 'EXAMPLEUNIQUESTRING'
       ]);

       dd($resp); // Will return binding payment details in array
       // if all is ok. We charged user card.
    } catch (Exception $e) {
        // Handle exception as needed
        // For example: Log the error or return an error response
    }
}
```

### Example 8: Apple Pay / opening a specific payment page directly

[](#example-8-apple-pay--opening-a-specific-payment-page-directly)

By default the bank performs device auto-detection and shows the matching payment page. You may optionally pass a `Type` to open a specific page directly:

- `AmeriaBankVPOS::PAYMENT_TYPE_APPLE_PAY` (13) → Apple Pay page
- `AmeriaBankVPOS::PAYMENT_TYPE_CARD` (5) → Visa/MasterCard/ArCa page
- omitted or any other value → device auto-detection (default behavior)

This only affects the returned `redirectUrl`; `InitPayment` is unchanged and existing calls keep working as before.

```
use Ayvazyan10\AmeriaBankVPOS\Facades\AmeriaBankVPOS;

// Open the Apple Pay page directly (redirectUrl gets &type=13 appended)
$initPayment = AmeriaBankVPOS::pay($amount, $orderId, [
    'Type' => AmeriaBankVPOS::PAYMENT_TYPE_APPLE_PAY,
]);

if ($initPayment['status'] === "SUCCESS") {
    return redirect($initPayment['redirectUrl']);
}
```

> Note: rendering the Apple Pay button and detecting whether the visitor's device supports Apple Pay is your responsibility on the front end — it is outside the scope of this package. Apple Pay cannot be used in the binding flow (Apple Pay cards cannot be stored for future payments). When you read payment details, `PaymentType` is `13`for Apple Pay and `ClientName` is empty.

### 🛠️ Extending and Customizing

[](#️-extending-and-customizing)

If you need to extend or customize the package behavior, you can create your own class that extends the AmeriaBankVPOS class and override the methods as needed. Make sure to update the AmeriaBankVPOS alias in config/app.php to point to your custom class.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Author
------

[](#author)

- [Razmik Ayvazyan](https://github.com/ayvazyan10)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~75 days

Recently: every ~211 days

Total

16

Last Release

33d ago

Major Versions

v1.5.0 → v2.0.12024-02-06

PHP version history (3 changes)v1.0.0PHP &gt;=7.3

v1.1.4PHP &gt;=7.1

v2.5.8PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/79054971?v=4)[Razmik Ayvazyan](/maintainers/ayvazyan10)[@ayvazyan10](https://github.com/ayvazyan10)

---

Top Contributors

[![ayvazyan10](https://avatars.githubusercontent.com/u/79054971?v=4)](https://github.com/ayvazyan10 "ayvazyan10 (71 commits)")

---

Tags

laravelpaymentsvposAmeriaBank

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ayvazyan10-ameriabankvpos/health.svg)

```
[![Health](https://phpackages.com/badges/ayvazyan10-ameriabankvpos/health.svg)](https://phpackages.com/packages/ayvazyan10-ameriabankvpos)
```

###  Alternatives

[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

3720.4k](/packages/linkxtr-laravel-qrcode)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

882.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
