PHPackages                             amjad-gh/paymera-payment-laravel - 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. amjad-gh/paymera-payment-laravel

ActiveLibrary[Payment Processing](/categories/payments)

amjad-gh/paymera-payment-laravel
================================

Laravel package for Paymera eGate payment gateway

v1.1.1(1w ago)070MITPHPPHP ^8.1

Since May 19Pushed 1w agoCompare

[ Source](https://github.com/amjad10-gm/paymera-laravel)[ Packagist](https://packagist.org/packages/amjad-gh/paymera-payment-laravel)[ RSS](/packages/amjad-gh-paymera-payment-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (5)Used By (0)

Paymera Laravel
===============

[](#paymera-laravel)

[![PHP](https://camo.githubusercontent.com/d6aac44f81cb2e6f4e71f098a1cb4a71992f24f7bfb424f6670db8313c9a855c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e312d626c7565)](https://www.php.net)[![Laravel](https://camo.githubusercontent.com/e318ae4be28139e4db425542a2f219c31be670221baae920b3fb42e6784d7cc7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e782d726564)](https://laravel.com)[![Tests](https://camo.githubusercontent.com/9f3c27283cb5c11aee04668809fa170c7382bb652382a9072ae68506cfca91f8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d392532307061737365642d627269676874677265656e)](https://github.com/amjad10-gm/paymera-laravel)[![Packagist](https://camo.githubusercontent.com/56a43003f82b6ade69fe9e2cd7025f2db5b3c57a89ddb50861e5a8c3a6e109fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d6a61642d67682f7061796d6572612d7061796d656e742d6c61726176656c)](https://packagist.org/packages/amjad-gh/paymera-payment-laravel)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](LICENSE)

Laravel package for integrating with the [Paymera eGate](https://paymera.cc) payment gateway API.

---

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^10.0 | ^11.0

---

Installation
------------

[](#installation)

```
composer require amjad-gh/paymera-payment-laravel
```

The service provider and facade are auto-discovered by Laravel.

### Publish the config file

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

```
php artisan vendor:publish --tag=paymera-config
```

---

Configuration
-------------

[](#configuration)

Add the following variables to your `.env` file:

```
PAYMERA_BASE_URL=https://egate-t.paymera.cc   # test environment
# PAYMERA_BASE_URL=https://egate.paymera.cc   # production environment

PAYMERA_USERNAME=your-username
PAYMERA_PASSWORD=your-password
PAYMERA_TERMINAL_ID=your-terminal-id
PAYMERA_LANG=en
```

> **Security:** credentials are sent via HTTP Basic Auth on the server side only and are never exposed to the client.

The published config file (`config/paymera.php`) contains:

```
return [
    'base_url'    => env('PAYMERA_BASE_URL', 'https://egate-t.paymera.cc'),
    'username'    => env('PAYMERA_USERNAME'),
    'password'    => env('PAYMERA_PASSWORD'),
    'terminal_id' => env('PAYMERA_TERMINAL_ID'),
    'lang'        => env('PAYMERA_LANG', 'en'),
];
```

---

Usage
-----

[](#usage)

### Create a Payment

[](#create-a-payment)

```
use Casper\Paymera\Facades\Paymera;
use Casper\Paymera\DTOs\CreatePaymentRequest;

$result = Paymera::createPayment(new CreatePaymentRequest(
    amount:      5000,                                  // amount in smallest currency unit
    callbackURL: 'https://yourapp.com/payment/return',  // user redirect after payment
    triggerURL:  'https://yourapp.com/payment/webhook', // server-to-server notification
    terminalId:  config('paymera.terminal_id'),
    lang:        config('paymera.lang'),
    notes:       'Order #1234',                         // optional
));

// $result->paymentId  — unique payment identifier
// $result->redirectUrl — redirect the user here to complete payment

return redirect($result->redirectUrl);
```

### Get Payment Status

[](#get-payment-status)

```
use Casper\Paymera\Facades\Paymera;

$status = Paymera::getPaymentStatus($paymentId);

if ($status->isAccepted()) {
    // payment succeeded
}

if ($status->isPending()) {
    // still waiting
}

if ($status->isFailed()) {
    // payment failed
}

if ($status->isCanceled()) {
    // payment was canceled
}

// Raw enum value:  $status->status  (PaymentStatus enum)
// Other fields:    $status->rrn, $status->amount, $status->terminalId,
//                  $status->creationTimestamp, $status->notes
```

### Cancel a Payment

[](#cancel-a-payment)

```
use Casper\Paymera\Facades\Paymera;

Paymera::cancelPayment($paymentId);
```

---

API Environments
----------------

[](#api-environments)

EnvironmentBase URLTest`https://egate-t.paymera.cc`Production`https://egate.paymera.cc`Switch environments by changing `PAYMERA_BASE_URL` in your `.env`.

---

DTOs
----

[](#dtos)

### `CreatePaymentRequest`

[](#createpaymentrequest)

ParameterTypeRequiredDefaultDescription`amount``int`✓Amount in smallest currency unit`callbackURL``string`✓User redirect URL after payment`triggerURL``string`✓Server-to-server webhook URL`terminalId``string`✓Your terminal ID`lang``string`✓Language code (e.g. `en`)`notes``string|null``null`Optional payment notes`savedCards``int``0`Enable saved cards (1 = yes)`appUser``string|null``null`Optional app user identifier### `CreatePaymentResult`

[](#createpaymentresult)

PropertyTypeDescription`paymentId``string`Unique payment ID`redirectUrl``string`URL to redirect the user to### `PaymentStatusResult`

[](#paymentstatusresult)

PropertyTypeDescription`status``PaymentStatus`Enum: `Pending`, `Accepted`, `Failed`, `Canceled``rrn``string`Reference retrieval number`amount``int`Payment amount`terminalId``string`Terminal ID`creationTimestamp``string`ISO 8601 creation time`notes``string|null`Payment notes---

PaymentStatus Enum
------------------

[](#paymentstatus-enum)

```
use Casper\Paymera\Enums\PaymentStatus;

PaymentStatus::Pending  // 'P'
PaymentStatus::Accepted // 'A'
PaymentStatus::Failed   // 'F'
PaymentStatus::Canceled // 'C'
```

---

Exception Handling
------------------

[](#exception-handling)

All exceptions extend `PaymeraException` which extends `RuntimeException`.

```
use Casper\Paymera\Exceptions\PaymeraException;
use Casper\Paymera\Exceptions\UnauthorizedException;
use Casper\Paymera\Exceptions\PaymentFailedException;

try {
    $result = Paymera::createPayment($request);
} catch (UnauthorizedException $e) {
    // Invalid credentials — error code 1
} catch (PaymentFailedException $e) {
    // Payment failed — error code 100
} catch (PaymeraException $e) {
    // Any other Paymera error
    $e->getErrorCode();  // raw error code from API
    $e->getMessage();    // error message from API
}
```

---

Testing
-------

[](#testing)

The package ships with a Pest test suite. From the package root:

```
composer install
./vendor/bin/pest tests/
```

In your own application tests, use `Http::fake()` to mock the gateway:

```
use Illuminate\Support\Facades\Http;

Http::fake([
    '*/api/create-payment' => Http::response([
        'ErrorCode'    => 0,
        'ErrorMessage' => 'Success',
        'Data'         => [
            'paymentId' => 'pay_test123',
            'url'       => 'https://egate-t.paymera.cc/pay/pay_test123',
        ],
    ]),
]);
```

---

License
-------

[](#license)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance98

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~6 days

Total

3

Last Release

8d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf3e89b680b36861a5598b6d190410b77b9b4f6e73779b0fe4176003cf84efda?d=identicon)[amjad10-gm](/maintainers/amjad10-gm)

---

Top Contributors

[![amjad10-gm](https://avatars.githubusercontent.com/u/267177162?v=4)](https://github.com/amjad10-gm "amjad10-gm (3 commits)")[![AmjadGhzlangit](https://avatars.githubusercontent.com/u/96890984?v=4)](https://github.com/AmjadGhzlangit "AmjadGhzlangit (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/amjad-gh-paymera-payment-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/amjad-gh-paymera-payment-laravel/health.svg)](https://phpackages.com/packages/amjad-gh-paymera-payment-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)

PHPackages © 2026

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