PHPackages                             xentixar/esewa-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. [Payment Processing](/categories/payments)
4. /
5. xentixar/esewa-sdk

ActiveLibrary[Payment Processing](/categories/payments)

xentixar/esewa-sdk
==================

v1.0.03(1y ago)5329MITPHP

Since Dec 25Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Esewa SDK for PHP
=================

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

This PHP SDK provides a simple interface to integrate Esewa payment gateway functionality into your application. With this SDK, you can easily configure payment details, generate payment forms, decode responses, and validate transactions using Esewa's APIs.

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

[](#installation)

You can install this SDK via Composer. Run the following command in your terminal:

```
composer require xentixar/esewa-sdk
```

To generate the autoloader, run the following command in your terminal:

```
composer dump-autoload
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

- To configure the Esewa payment details, you can use the config method:

```
use Xentixar\EsewaSdk\Esewa;

$esewa = new Esewa();
$esewa->config('https://your-success-url.com', 'https://your-failure-url.com', 1000.00, 'your-transaction-uuid')
```

### Initialize Payment Form

[](#initialize-payment-form)

Development Environment

- To generate a payment form for the development environment, use the init method without any parameters:

```
$esewa->init();
```

Production Environment

- To generate a payment form for the production environment, use the init method with the $production parameter set to true:

```
$esewa->init(true);
```

### Decode Response

[](#decode-response)

- After the payment process, you can decode the Esewa response using the decode method:

```
$responseData = $esewa->decode();
```

### Validate Transaction

[](#validate-transaction)

- You can validate a transaction using the validate method:

```
$response = $esewa->validate('1000.00', 'your-transaction-uuid', true);
```

Methods:
--------

[](#methods)

`config(string $success_url, string $failure_url, float $amount, string $transaction_uuid, string $product_code = 'EPAYTEST', string $secret_key = '8gBm/:&EnhH.1/q', float $tax_amount = 0, float $product_service_charge = 0, float $product_delivery_charge = 0)`

- Configures Esewa payment details.

`init(bool $production = false)`

- Initializes the payment form for either the development or production environment based on the `$production` flag.

`decode(): ?array`

- Decodes Esewa response, if the `data` parameter is set in the GET request.

`validate(string $total_amount, string $transaction_uuid, bool $production = false, string $product_code = 'EPAYTEST'): string`

- Validates the transaction by making a cURL request to check the transaction status based on provided parameters.

Security Note:
--------------

[](#security-note)

- Ensure that the secret key is stored securely and not exposed in your codebase or version control system.
- When dealing with transactions and security, always ensure that you validate transaction responses to ensure authenticity and avoid fraudulent transactions.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

4

Last Release

601d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02fcfef53b44a7da91a3d46bfb38adb40f900d8ac85a71788e3bf41fd2237c6f?d=identicon)[xentixar](/maintainers/xentixar)

---

Top Contributors

[![xentixar](https://avatars.githubusercontent.com/u/152050438?v=4)](https://github.com/xentixar "xentixar (7 commits)")

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/braintree

Braintree gateway for Omnipay payment processing library

35558.0k3](/packages/omnipay-braintree)

PHPackages © 2026

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