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 4y 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 1w 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 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

2182d 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

563.6M16](/packages/checkout-checkout-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k441.1k8](/packages/theodo-group-llphant)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

608.3M53](/packages/resend-resend-php)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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