PHPackages                             alhelwany/laravel-ecash - 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. alhelwany/laravel-ecash

ActiveLibrary[Payment Processing](/categories/payments)

alhelwany/laravel-ecash
=======================

Laravel Payment Gateway for Ecash (Syria)

1.1.3(1y ago)224[4 PRs](https://github.com/alhelwany/laravel-ecash/pulls)MITPHPPHP ^8.1CI passing

Since Apr 6Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/alhelwany/laravel-ecash)[ Packagist](https://packagist.org/packages/alhelwany/laravel-ecash)[ Docs](https://github.com/mhdghaithalhelwany/laravel-ecash)[ GitHub Sponsors]()[ RSS](/packages/alhelwany-laravel-ecash/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (13)Versions (21)Used By (0)

Laravel Payment Gateway for Ecash (Syria)
=========================================

[](#laravel-payment-gateway-for-ecash-syria)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f775a4b821369c0e89c7f442aab040a56c3466b8018b5aab785717597f6ff1ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c68656c77616e792f6c61726176656c2d65636173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alhelwany/laravel-ecash)[![Total Downloads](https://camo.githubusercontent.com/f1aa64f13e18e495c7fcd1f93c22dea18e538479437acdbd736b2b36ababa6cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c68656c77616e792f6c61726176656c2d65636173682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alhelwany/laravel-ecash)[![GitHub Tests Action Status](https://camo.githubusercontent.com/229a5f093642a2583b80d71afe7fba404a85bde502a628cb2dfaef3b18e261b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6864676861697468616c68656c77616e792f6c61726176656c2d65636173682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mhdghaithalhelwany/laravel-ecash/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7d2065bb1ea70715894e6a207854838e0c827a7f542c910a1dc5e20ca553e6f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6864676861697468616c68656c77616e792f6c61726176656c2d65636173682f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/MhdGhaithAlhelwany/laravel-ecash/actions/workflows/phpstan.yml?query=workflow%3Aphpstan+branch%3Amain)

Simplify the integration of Ecash payments into your Laravel applications. This package offers a streamlined setup and intuitive API to process payments quickly and securely.

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

[](#installation)

You can install the package via composer:

```
composer require alhelwany/laravel-ecash
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="laravel-ecash-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-ecash-config"
```

This is the contents of the published config file:

```
return [
    'gatewayUrl' => env('ECASH_GATEWAY_URL', 'https://checkout.ecash-pay.co'),
    'terminalKey' => env('ECASH_TERMINAL_KEY', null),
    'merchantId' => env('ECASH_MERCHANT_ID', null),
    'merchantSecret' => env('ECASH_MERCHANT_SECRET', null),
];
```

Getting Started
---------------

[](#getting-started)

1. Setup your environment variables
2. Publish and run the migrations
3. To start the payment process, use the checkout method to create a payment model &amp; generate the payment URL
4. Once the payment is complete, and the gateway redirects the user to the redirect URL, the payment status changes from PENDING to PROCESSING
5. Once the gateway calls the callback URL, the payment status Changes from PROCESSING to either FAILED or PAID
6. On each payment status change, a PaymentStatusUpdated event is fired, you may configure a listener to update the status of your order

Enums
-----

[](#enums)

### Enums are in the namespace "Alhelwany\\LaravelEcash\\Enums"

[](#enums-are-in-the-namespace-alhelwanylaravelecashenums)

```
enum Lang: string
{
    case AR = 'AR';
    case EN = 'EN';
}
```

```
enum Currency: string
{
    case SYP = 'SYP'; // The only available currency by the gateway so far
}
```

```
enum CheckoutType: string
{
    case QR = 'QR';
    case CARD = 'Card';
}
```

```
enum PaymentStatus: string
{
    case PENDING = 'pending';
    case PROCESSING = 'processing';
    case PAID = 'paid';
    case FAILED = 'failed';
}
```

Exceptions
----------

[](#exceptions)

### InvalidAmountException

[](#invalidamountexception)

Thrown when the checkout function is called with negative or 0 amount.

### InvalidConfigurationException

[](#invalidconfigurationexception)

Thrown when trying to use the package before setting up the .env variables

Events
------

[](#events)

### PaymentStatusUpdated

[](#paymentstatusupdated)

```
namespace Alhelwany\LaravelEcash\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Alhelwany\LaravelEcash\Models\EcashPayment;

class PaymentStatusUpdated
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public function __construct(private EcashPayment $paymentModel)
    {
    }

    public function getPaymentModel(): EcashPayment
    {
        return $this->paymentModel;
    }
}
```

Important Note
--------------

[](#important-note)

```
The EcashPayment Model uses id of type UUID as a primary key

```

Example Usage
-------------

[](#example-usage)

### Checkout

[](#checkout)

```
use App\Http\Controllers\Controller;

use Alhelwany\LaravelEcash\Facades\LaravelEcashClient;
use Alhelwany\LaravelEcash\DataObjects\PaymentDataObject;
use Alhelwany\LaravelEcash\Models\EcashPayment;
use Alhelwany\LaravelEcash\Enums\CheckoutType;
use Alhelwany\LaravelEcash\Enums\Lang;
use Alhelwany\LaravelEcash\Enums\Currency;

class ExampleController extends Controller
{
    public function checkout($request)
    {
        $paymentDataObject = new PaymentDataObject(CheckoutType::CARD, 100.10);

        $paymentDataObject->setRedirectUrl(route('payment-successful')); //optional
        $paymentDataObject->setLang(Lang::EN); //optional
        $paymentDataObject->setCurrency(Currency::SYP); //optional

        $model = LaravelEcashClient::checkout($paymentDataObject);

        // You may attach the EcashPayment model to your order
        return redirect($model['checkout_url']);
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Mhd Ghaith Alhelwany](https://github.com/MhdGhaithAlhelwany)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance63

Regular maintenance activity

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~30 days

Recently: every ~52 days

Total

8

Last Release

605d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64a2a88bd98dc1ddd6dbbe3aafc776e1d868b0cc717b0c0332f76d341f054024?d=identicon)[mhdghaithalhelwany](/maintainers/mhdghaithalhelwany)

---

Top Contributors

[![alhelwany](https://avatars.githubusercontent.com/u/115778766?v=4)](https://github.com/alhelwany "alhelwany (49 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelMhd Ghaith Alhelwanylaravel-ecashEcash SyriaAlhelwany

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alhelwany-laravel-ecash/health.svg)

```
[![Health](https://phpackages.com/badges/alhelwany-laravel-ecash/health.svg)](https://phpackages.com/packages/alhelwany-laravel-ecash)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M102](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24857.5k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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