PHPackages                             knit-pay/omnipay-esewa - 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. knit-pay/omnipay-esewa

ActiveLibrary[Payment Processing](/categories/payments)

knit-pay/omnipay-esewa
======================

eSewa API driver for the Omnipay payment processing library.

v2.0.2(2mo ago)02MITPHP

Since Mar 16Pushed 2mo agoCompare

[ Source](https://github.com/knit-pay/omnipay-esewa)[ Packagist](https://packagist.org/packages/knit-pay/omnipay-esewa)[ Docs](https://github.com/knit-pay/omnipay-esewa/)[ RSS](/packages/knit-pay-omnipay-esewa/feed)WikiDiscussions main Synced 1mo ago

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

Omnipay: eSewa
==============

[](#omnipay-esewa)

**eSewa driver for the Omnipay PHP payment processing library**

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP. This package implements eSewa support for Omnipay.

[![StyleCI](https://camo.githubusercontent.com/c55b90e86275f4fb60f55c197af380b2a85959ad994b83791b0a13850860cdaf/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f37353538363838352f736869656c643f6272616e63683d6d617374657226666f726d61743d706c6173746963)](https://github.styleci.io/repos/75586885)[![Latest Stable Version](https://camo.githubusercontent.com/df2df5a1a67a57d80a9efff00ae647f7b7b6082cf3bb4468b6860842995c6468/68747470733a2f2f706f7365722e707567782e6f72672f73756469707470612f6f6d6e697061792d65736577612f762f737461626c65)](https://packagist.org/packages/sudiptpa/omnipay-esewa)[![Total Downloads](https://camo.githubusercontent.com/50b7bff4b37dde367e3e699701ae6d7d29339c958bb864acf55b5edec03accfd/68747470733a2f2f706f7365722e707567782e6f72672f73756469707470612f6f6d6e697061792d65736577612f646f776e6c6f616473)](https://packagist.org/packages/sudiptpa/omnipay-esewa)[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/sudiptpa/esewa/master/LICENSE)

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `league/omnipay` and `sudiptpa/omnipay-esewa` with Composer:

```
composer require league/omnipay sudiptpa/omnipay-esewa

```

**Looking for ePay v1? Check [this documentation](./docs/README-v1.md) for installation instructions.**

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

[](#basic-usage)

### Purchase

[](#purchase)

```
    use Omnipay\Omnipay;
    use Exception;

    $gateway = Omnipay::create('Esewa_Secure');

    $gateway->setMerchantCode('epay_payment');
    $gateway->setSecretKey('secret_key_provided_by_esewa');
    $gateway->setTestMode(true);

    try {
        $response = $gateway->purchase([
            'amount' => 100,
            'deliveryCharge' => 0,
            'serviceCharge' => 0,
            'taxAmount' => 0,
            'totalAmount' => 100,
            'productCode' => 'ABAC2098',
            'returnUrl' => 'https://merchant.com/payment/1/complete',
            'failedUrl' => 'https://merchant.com/payment/1/failed',
        ])->send();

        if ($response->isRedirect()) {
            $response->redirect();
        }
    } catch (Exception $e) {
        return $e->getMessage();
    }
```

After successful payment and redirect back to merchant site, you need to verify the payment response.

### Verify Payment

[](#verify-payment)

```
    $gateway = Omnipay::create('Esewa_Secure');

    $gateway->setMerchantCode('epay_payment');
    $gateway->setSecretKey('secret_key_provided_by_esewa');
    $gateway->setTestMode(true);

    $payload = json_decode(base64_decode($_GET['data']), true);

    $signature = $gateway->generateSignature(generateSignature($payload));
    if ($signature === $payload['signature']) {
        // Verified
    } else {
        // Unverified
    }
```

You can also check the status of payment if no any response is received when redirected back to merchant's site.

### Check Status

[](#check-status)

```
    $gateway = Omnipay::create('Esewa_Secure');

    $gateway->setMerchantCode('epay_payment');
    $gateway->setSecretKey('secret_key_provided_by_esewa');
    $gateway->setTestMode(true);

    $payload = [
        'totalAmount' => 100,
        'productCode' => 'ABAC2098',
    ];

    $response = $gateway->checkStatus($payload)->send();
    if ($response->isSuccessful()) {
        // Success
    }
```

Working Example
---------------

[](#working-example)

Want to see working examples before integrating them into your project? View the examples **[here](https://github.com/pralhadstha/payment-gateways-examples)**

Laravel Integration
-------------------

[](#laravel-integration)

Please follow the [eSewa Online Payment Gateway Integration](https://sujipthapa.com/blog/esewa-payment-gateway-integration-with-laravel) and follow step by step guidlines.

Official Doc
------------

[](#official-doc)

Please follow the [Official Doc](https://developer.esewa.com.np) to understand about the parameters and their descriptions.

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

[](#contributing)

Contributions are **welcome** and will be fully **credited**.

Contributions can be made via a Pull Request on [Github](https://github.com/sudiptpa/esewa).

Support
-------

[](#support)

If you are having general issues with Omnipay Esewa, drop an email to  for quick support.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/sudiptpa/esewa/issues), or better yet, fork the library and submit a pull request.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance86

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 76.6% 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 ~636 days

Total

5

Last Release

67d ago

Major Versions

v1.0.1 → v2.0.02025-02-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/1818f8924f951fcb0c9f82c77008d2b81e96de33f3b08d1b0bb89dee4606b66e?d=identicon)[knit-pay](/maintainers/knit-pay)

---

Top Contributors

[![sudiptpa](https://avatars.githubusercontent.com/u/7222620?v=4)](https://github.com/sudiptpa "sudiptpa (49 commits)")[![pralhadstha](https://avatars.githubusercontent.com/u/6309194?v=4)](https://github.com/pralhadstha "pralhadstha (12 commits)")[![knit-pay](https://avatars.githubusercontent.com/u/65900807?v=4)](https://github.com/knit-pay "knit-pay (2 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipayesewa

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/knit-pay-omnipay-esewa/health.svg)

```
[![Health](https://phpackages.com/badges/knit-pay-omnipay-esewa/health.svg)](https://phpackages.com/packages/knit-pay-omnipay-esewa)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1017.2k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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