PHPackages                             freelancernishad/laravel-ekpay - 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. freelancernishad/laravel-ekpay

ActiveLibrary[Payment Processing](/categories/payments)

freelancernishad/laravel-ekpay
==============================

Ekpay Payment Gateway integration for Laravel

v1.0.2(1mo ago)02↓100%MITPHPPHP ^8.2

Since May 6Pushed 1mo agoCompare

[ Source](https://github.com/freelancernishad/laravel-ekpay)[ Packagist](https://packagist.org/packages/freelancernishad/laravel-ekpay)[ RSS](/packages/freelancernishad-laravel-ekpay/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Laravel Ekpay Payment Gateway
=============================

[](#laravel-ekpay-payment-gateway)

A reusable and extensible Laravel package for integrating the Ekpay Payment Gateway. Built for flexibility across any project type (E-commerce, School Management, SaaS, etc.).

Features
--------

[](#features)

- **Project Agnostic**: Link payments to any model (Order, StudentFee, Subscription) using polymorphic relations.
- **Extensible**: Override default models and add custom database fields via configuration.
- **Detailed Logging**: Every request, response, and IPN payload is logged for auditing.
- **Event-Driven**: Dispatches events upon payment success/failure for easy business logic integration.

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

[](#installation)

1. Install the package via composer:

```
composer require freelancernishad/laravel-ekpay
```

2. Publish the config and migrations:

```
php artisan vendor:publish --tag=ekpay-config
php artisan vendor:publish --tag=ekpay-migrations
```

3. Run the migrations:

```
php artisan migrate
```

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

[](#configuration)

Add your Ekpay credentials to your `.env` file:

```
AKPAY_MER_REG_ID=your_reg_id
AKPAY_MER_PASS_KEY=your_pass_key
AKPAY_API_URL=https://sandbox.ekpay.gov.bd/ekpaypg/v1
AKPAY_IPN_URL=https://your-domain.com
WHITE_LIST_IP=your_server_ip
```

Basic Usage
-----------

[](#basic-usage)

### Controller Example

[](#controller-example)

```
use FreelancerNishad\Ekpay\Services\EkpayService;

public function checkout(EkpayService $ekpayService)
{
    $trns_info = [
        "trnx_amt" => 100,
        "trnx_currency" => "BDT",
        "trnx_id" => "ORDER_" . uniqid(),
        "ord_det" => "Payment for Order #123",
    ];

    $cust_info = [
        "cust_email" => "customer@example.com",
        "cust_name" => "John Doe",
        "cust_mobo_no" => "017XXXXXXXX",
    ];

    $result = $ekpayService->initiatePayment($trns_info, $cust_info);

    return redirect()->to($result['payment_url']);
}
```

Advanced Usage &amp; Customization
----------------------------------

[](#advanced-usage--customization)

### Adding Extra Fields (Meta Data)

[](#adding-extra-fields-meta-data)

You can pass additional data using the `meta` field. This data is saved as JSON in the database.

```
$meta = [
    'student_id' => 101,
    'month' => 'May',
    'year' => 2026
];
$ekpayService->initiatePayment($trns_info, $cust_info, [], $meta);
```

### Overriding Models

[](#overriding-models)

If you want to add actual database columns to the logs:

1. Create a migration to add columns to `ekpay_logs`.
2. Create a model that extends the package model:

```
namespace App\Models;
use FreelancerNishad\Ekpay\Models\EkpayLog as BaseLog;

class CustomEkpayLog extends BaseLog {
    protected $fillable = ['user_id', 'trnx_id', 'my_custom_column', ...];
}
```

3. Update `config/ekpay.php`:

```
'models' => [
    'log' => \App\Models\CustomEkpayLog::class,
],
```

### Listening for Success

[](#listening-for-success)

Register a listener for `FreelancerNishad\Ekpay\Events\EkpayPaymentEvent` to handle logic after payment is confirmed.

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance93

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Total

3

Last Release

34d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5248b2f380366bf3fbc53a1882e408cb2f47aecbc7627a6dbc9b17f2e0d38fc8?d=identicon)[freelancernishad123](/maintainers/freelancernishad123)

---

Top Contributors

[![freelancernishad](https://avatars.githubusercontent.com/u/57829640?v=4)](https://github.com/freelancernishad "freelancernishad (5 commits)")

---

Tags

laravelpaymentgatewaybangladeshekpay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/freelancernishad-laravel-ekpay/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4849.3k](/packages/sebdesign-laravel-viva-payments)

PHPackages © 2026

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