PHPackages                             sujanshresthanet/esewa-php-sdk - 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. [API Development](/categories/api)
4. /
5. sujanshresthanet/esewa-php-sdk

ActiveLibrary[API Development](/categories/api)

sujanshresthanet/esewa-php-sdk
==============================

eSewa payment gateway integration in PHP.

1.0.10(5y ago)19MITPHPPHP &gt;=7.2

Since Dec 29Pushed 3y agoCompare

[ Source](https://github.com/sujanshresthanet/esewa-php-sdk)[ Packagist](https://packagist.org/packages/sujanshresthanet/esewa-php-sdk)[ Docs](https://developer.esewa.com.np)[ RSS](/packages/sujanshresthanet-esewa-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

eSewa SDK for PHP
=================

[](#esewa-sdk-for-php)

The **eSewa SDK for PHP** makes it easy for developers to access [eSewa](https://esewa.com.np) payment service in their PHP code. You can find more details in [eSewa Documentation](https://developer.esewa.com.np) site.

Getting Started
===============

[](#getting-started)

1. **Sign up for eSewa** – Before you begin, you need to sign up and retrieve your credentials from [eSewa](https://esewa.com.np).
2. **Minimum requirements** – To run the SDK, your system will need to meet the minimum requirements, including having **PHP &gt;= 7.2**. We highly recommend having it compiled with the cURL extension and cURL compiled with a TLS backend (e.g., NSS or OpenSSL). We do not support outdated PHP versions.

Installation
============

[](#installation)

**Install the SDK** – Using [Composer](http://getcomposer.org) is the recommended way to install the eSewa SDK for PHP. The SDK is available via [Packagist](http://packagist.org) under the [`sujanshresthanet/esewa-php-sdk`](https://packagist.org/packages/sujanshresthanet/esewa-php-sdk) package.

```
composer sujanshresthanet/esewa-php-sdk

```

Getting Help
------------

[](#getting-help)

We use the GitHub issues for tracking bugs and feature requests and address them as quickly as possible.

- Call or Email [eSewa](https://esewa.com.np) for account and payment related queries.

Quick Examples
--------------

[](#quick-examples)

### Create a eSewa client

[](#create-a-esewa-client)

```
// require the composer autoloader.
require 'vendor/autoload.php';

use Cixware\Esewa\Client;

// init client for development
$esewa = new Client([
    'success_url' => 'https://example.com/success.php', // callback url for success
    'failure_url' => 'https://example.com/failed.php', // callback url for failure
]);

// init client for production
$esewa = new Client([
    'is_production' => true,
    'merchant_code' => 'b4e...e8c753...2c6e8b', // retrieve from eSewa
    'success_url' => 'https://example.com/success.php', // callback url for success
    'failure_url' => 'https://example.com/failed.php', // callback url for failure
]);
```

### Make Payment

[](#make-payment)

This will redirect the user to eSewa dashboard for payment processing. Once the payment is successful, it will redirect to your success URL. If the payment fails, it will redirect to your failure URL.

```
$esewa->process('P101W201', 100, 15, 80, 50);
```

The method accepts 5 parameters.

1. `pid` A unique ID of product or item or ticket etc.
2. `amt` Amount of product or item or ticket etc
3. `txAmt` Tax amount on product or item or ticket etc. Pass `0` if Tax/VAT is not applicable.
4. `psc` The service charge (if applicable); default to `0`.
5. `pdc` The delivery charge (if applicable); default to `0`.

The `tAmt` total amount is auto calculated based on the parameters.

### Verify Payment

[](#verify-payment)

Transaction verification process provide you filter that identify potentially fraudulent transactions and screen against data such as the value of transaction amount etc.

```
$status = $esewa->verify('R101', 'P101W201', 245);
if ($status->verified) {
    // verification successful
}
```

The method accepts 3 parameters.

1. `refId` A unique payment reference code generated by eSewa.
2. `oid` Product ID used on payment request.
3. `tAmt` Total payment amount (including Tax/VAT and other charges.)

Contribution
============

[](#contribution)

Please follow the guidelines.

- Your code must follow [PSR](https://www.php-fig.org/psr) standards.
- Your code must pass the tests.
- You must document and write clean code.
- Make PR in `master` branch.

Thanks for your contribution and support ☺️

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.2% 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 ~27 days

Recently: every ~57 days

Total

10

Last Release

2082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79e91bf7fe29065bcae86009f347546ddbb64441a466f88a36be87807d2413a5?d=identicon)[sujanshrestha](/maintainers/sujanshrestha)

---

Top Contributors

[![remotemerge](https://avatars.githubusercontent.com/u/4655731?v=4)](https://github.com/remotemerge "remotemerge (106 commits)")[![sujanshresthanet](https://avatars.githubusercontent.com/u/103834513?v=4)](https://github.com/sujanshresthanet "sujanshresthanet (2 commits)")[![sapkotamadan](https://avatars.githubusercontent.com/u/7168058?v=4)](https://github.com/sapkotamadan "sapkotamadan (1 commits)")

---

Tags

esewaesewa-apipayment-integrationphpphpapipaymentgatewayesewanepal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sujanshresthanet-esewa-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sujanshresthanet-esewa-php-sdk/health.svg)](https://phpackages.com/packages/sujanshresthanet-esewa-php-sdk)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[contributte/comgate

Comgate Payment Gateway for Nette Framework

19839.7k1](/packages/contributte-comgate)[wallee/sdk

wallee SDK for PHP

12354.2k11](/packages/wallee-sdk)[shipu/php-aamarpay-payment

PHP client for Aamarpay Payment Gateway API

3214.6k](/packages/shipu-php-aamarpay-payment)

PHPackages © 2026

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