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.1.1(1y ago)5833MITPHPPHP &gt;=7.1

Since Apr 21Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)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/df4396c3d5e60068d516307f7a1bba895aaeb7b93e2f56d8807b79b14f7544f3/68747470733a2f2f7765646f2e64657369676e2f75706c6f6164732f696d672f6d61696e2f6c6f676f2e737667)](https://camo.githubusercontent.com/df4396c3d5e60068d516307f7a1bba895aaeb7b93e2f56d8807b79b14f7544f3/68747470733a2f2f7765646f2e64657369676e2f75706c6f6164732f696d672f6d61696e2f6c6f676f2e737667)

### 🚀 Installation

[](#-installation)

#### Install the package via Composer.

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

```
composer require ayvazyan10/ameriabankvpos
```

#### Release the configuration file and database migration.

[](#release-the-configuration-file-and-database-migration)

```
php artisan vendor:publish --provider="Ayvazyan10\AmeriaBankVPOS\AmeriaBankVPOSServiceProvider"
```

This will create a \[config/ameriabankvpos.php\] and \[database/migrations\] files in your application.

```
php artisan migrate
```

### ⚙️ 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_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(int|string $paymentId): array;

public function check($request): array;

public function getPaymentDetails(int|string $paymentId): array;

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

public function refund(int|string $paymentId, int|float $refundAmount): array;

public function makeBindingPayment(int|float $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, [
    'Currecny' => $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
    }
}
```

### 🛠️ 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

33

—

LowBetter than 75% of packages

Maintenance46

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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 ~54 days

Recently: every ~170 days

Total

14

Last Release

419d ago

Major Versions

v1.5.0 → v2.0.12024-02-06

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

v1.1.4PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/962a9665d168b42630d6c6e81eeee81993ee407056be00b14ea07074179ac65d?d=identicon)[ayvazyan10](/maintainers/ayvazyan10)

---

Top Contributors

[![ayvazyan10](https://avatars.githubusercontent.com/u/79054971?v=4)](https://github.com/ayvazyan10 "ayvazyan10 (68 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

[musahmusah/laravel-multipayment-gateways

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

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[a17mad/laravel-cybersource

This package wraps the Cybersource SOAP API in a convenient, easy to use package for Laravel.

136.8k](/packages/a17mad-laravel-cybersource)[itsmurumba/laravel-mpesa

Laravel Package for Mpesa Daraja API

191.6k](/packages/itsmurumba-laravel-mpesa)[threesquared/laravel-paymill

Laravel wrapper for the Paymill API

121.3k](/packages/threesquared-laravel-paymill)

PHPackages © 2026

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