PHPackages                             sixersoft/eps - 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. sixersoft/eps

ActiveLibrary[Payment Processing](/categories/payments)

sixersoft/eps
=============

EPS Payment Gateway for Laravel - Easy Payment System (eps.com.bd). Simple integration with token, payment initialization, verification, and optional currency conversion to BDT.

v1.0.0(1mo ago)02MITPHPPHP ^8.1

Since Jun 4Pushed 1mo agoCompare

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

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

EPS Payment Gateway for Laravel
===============================

[](#eps-payment-gateway-for-laravel)

**sixersoft/eps** — Simple, clean, and production-ready integration for **EPS (Easy Payment System)** Bangladesh (`eps.com.bd`).

- Official API support (Get Token → Initialize Payment → Verify Transaction)
- **Optional automatic currency conversion** (USD / EUR / any → BDT)
- Clean Facade + Service injection
- Sandbox + Production ready
- Full hash generation exactly as per EPS official guide (HMAC-SHA512 + Base64)
- Detailed logging

---

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require sixersoft/eps
```

### 2. Publish the configuration file

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

```
php artisan vendor:publish --provider="Sixersoft\Eps\EpsServiceProvider" --tag="eps-config"
```

This will create `config/eps.php`.

### 3. Add credentials to `.env`

[](#3-add-credentials-to-env)

```
# EPS Credentials (get from https://www.eps.com.bd merchant portal)
EPS_IS_SANDBOX=true

EPS_MERCHANT_ID=your-merchant-id
EPS_STORE_ID=your-store-id
EPS_USERNAME=your-username
EPS_PASSWORD=your-password
EPS_HASH_KEY=your-hash-key

# Optional: Currency conversion (see below)
EPS_CURRENCY_CONVERSION=false
EPS_RATE_USD=117.50
EPS_RATE_EUR=127.00
```

### 4. (Optional) Clear cache

[](#4-optional-clear-cache)

```
php artisan config:clear
```

---

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

[](#basic-usage)

### Using Facade (Recommended - Easiest)

[](#using-facade-recommended---easiest)

```
use Sixersoft\Eps\Facades\EPS;

// 1. Initialize Payment
$result = EPS::initializePayment([
    'amount' => 150,                    // Can be in USD if conversion enabled
    'currency' => 'USD',                // Optional - triggers conversion if enabled
    'customer_name' => 'John Doe',
    'customer_email' => 'john@example.com',
    'customer_phone' => '01911223344',
    'customer_address' => '123 Main St, Dhaka',
    'customer_city' => 'Dhaka',
    'customer_state' => 'Dhaka',
    'customer_postcode' => '1200',
    'success_url' => 'https://yoursite.com/payment/success',
    'fail_url' => 'https://yoursite.com/payment/fail',
    'cancel_url' => 'https://yoursite.com/payment/cancel',
    'product_name' => 'Premium T-Shirt',
    // 'products' => [...]              // Optional: full ProductList array
]);

if ($result['success']) {
    // Redirect user to EPS gateway
    return redirect()->away($result['redirect_url']);
}

return back()->with('error', $result['message']);
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Sixersoft\Eps\EPS;

public function pay(EPS $eps)
{
    $result = $eps->initializePayment([...]);
}
```

### Verify Payment (in success/fail/cancel routes)

[](#verify-payment-in-successfailcancel-routes)

```
use Sixersoft\Eps\Facades\EPS;

public function success(Request $request)
{
    $merchantTxnId = $request->get('merchantTransactionId')
        ?? session('eps_merchant_txn_id');

    $verification = EPS::verifyTransaction($merchantTxnId);

    if ($verification['success']) {
        // Update your order as PAID
        // Order::where('merchant_transaction_id', $merchantTxnId)->update(['status' => 'paid']);

        return view('payment.success', compact('verification'));
    }

    return view('payment.failed', compact('verification'));
}
```

**Important:** Always call `verifyTransaction()` on callback pages for security.

---

Currency Conversion to BDT (The Special Feature)
------------------------------------------------

[](#currency-conversion-to-bdt-the-special-feature)

EPS only accepts amounts in **BDT**. This package makes it dead simple to accept payments in other currencies.

### Enable in config/eps.php or .env

[](#enable-in-configepsphp-or-env)

```
EPS_CURRENCY_CONVERSION=true
EPS_RATE_USD=118.00          # Update regularly
EPS_RATE_EUR=128.50
```

### Usage

[](#usage)

```
$result = EPS::initializePayment([
    'amount' => 10,           // 10 USD
    'currency' => 'USD',
    // ... other fields
]);

// In response you will get:
// 'converted_amount_bdt' => 1180.00
// 'original_amount' => 10
// 'currency' => 'USD'
```

### Manual Conversion (anywhere in your app)

[](#manual-conversion-anywhere-in-your-app)

```
use Sixersoft\Eps\Facades\EPS;

$bdtAmount = EPS::convertToBDT(25, 'USD');   // 25 USD → BDT using current rate

// Or get the converter for advanced use
$converter = EPS::currency();
$converter->setRate('USD', 119.75);           // Update rate at runtime
$converter->setEnabled(true);

echo EPS::convertToBDT(5, 'EUR');
```

### How to keep rates updated?

[](#how-to-keep-rates-updated)

**Recommended (simple &amp; free):**

- Update rates manually in `config/eps.php` or `.env` every few days.
- Or create a daily command that fetches from a free API (exchangerate.host, etc.) and calls `EPS::currency()->setRate()`.

You can completely disable the feature (`EPS_CURRENCY_CONVERSION=false`) — the package will then expect you to always pass BDT amount.

---

Full Configuration Reference
----------------------------

[](#full-configuration-reference)

See the published `config/eps.php`. Most important keys are in `.env`.

You can also override at runtime:

```
EPS::setConfig([
    'is_sandbox' => false,
    'merchant_id' => 'live-xxx',
]);
```

---

Required Fields for `initializePayment()`
-----------------------------------------

[](#required-fields-for-initializepayment)

FieldRequiredNotes`success_url`YesYour success callback`fail_url`YesYour fail callback`cancel_url`YesYour cancel callback`customer_name`Yes`customer_email`Yes`customer_phone`Yes`customer_address`Yes`customer_city`Yes`customer_state`Yes`customer_postcode`Yes`amount` + `currency`Yes\*Or use `total_amount` (in BDT)**Optional but recommended:**

- `product_name`
- `products` (array for ProductList)
- `customer_order_id`
- `merchant_transaction_id` (auto-generated if not provided — must be unique)

---

Callback URLs Best Practice
---------------------------

[](#callback-urls-best-practice)

Create three routes in your app:

```
// routes/web.php
Route::get('/payment/success', [PaymentController::class, 'success']);
Route::get('/payment/fail', [PaymentController::class, 'fail']);
Route::get('/payment/cancel', [PaymentController::class, 'cancel']);
```

Pass these exact URLs when calling `initializePayment()`.

In the callback controllers, always verify using `EPS::verifyTransaction()`.

---

Logging
-------

[](#logging)

All requests/responses are logged to your default log channel (or `EPS_LOG_CHANNEL`).

Check `storage/logs/laravel.log` for `[EPS Package]`.

---

Testing / Sandbox
-----------------

[](#testing--sandbox)

Use the sandbox credentials provided by EPS.

**Example sandbox credentials** (for testing only — replace with yours):

```
EPS_IS_SANDBOX=true
EPS_MERCHANT_ID=29e86e70-0ac6-45eb-ba04-9fcb0aaed12a
EPS_STORE_ID=d44e705f-9e3a-41de-98b1-1674631637da
EPS_USERNAME=Epsdemo@gmail.com
EPS_PASSWORD=Epsdemo258@
EPS_HASH_KEY=FHZxyzeps56789gfhg678ygu876o=
```

After going live, set `EPS_IS_SANDBOX=false` and use production credentials.

---

Example Full Flow (Controller)
------------------------------

[](#example-full-flow-controller)

Ready-to-use example files are included in the `examples/` folder of this package:

- `examples/PaymentController.php` — Complete controller with checkout, pay, success, fail, cancel
- `examples/routes.php` — Sample routes to add in your `web.php`

Copy them into your project and customize as needed.

A beautiful demo product page (from the original integration) is also available in the GitHub repository.

---

Security Notes
--------------

[](#security-notes)

- Never expose your `hash_key`, `password` etc.
- Always verify transactions server-side using `verifyTransaction()`.
- Use HTTPS for all callback URLs in production.
- Store `merchant_transaction_id` in your database for reconciliation.

---

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

[](#contributing)

Pull requests are welcome! Please open an issue first for major changes.

---

License
-------

[](#license)

MIT License. See LICENSE file.

---

Support
-------

[](#support)

- Official EPS:
- Package issues: GitHub Issues
- Email:  (for this package)

**Developed by SixerSoft** — Making Bangladesh payment integration easy.

---

**Repository:**

**Packagist:**

Happy integrating! 🇧🇩

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aa154b06b7dfd2c8a9635374e3aed1cf839078938c143ddd18067f3420cf133?d=identicon)[sixersoft](/maintainers/sixersoft)

---

Top Contributors

[![mahdiutshob](https://avatars.githubusercontent.com/u/31906348?v=4)](https://github.com/mahdiutshob "mahdiutshob (1 commits)")

---

Tags

laravelpaymentgatewayepsbangladeshbd-paymenteps.com.bdeasy payment system

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sixersoft-eps/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

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