PHPackages                             pralhadstha/omnipay-khalti - 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. pralhadstha/omnipay-khalti

ActiveLibrary[Payment Processing](/categories/payments)

pralhadstha/omnipay-khalti
==========================

Khalti Omnipay Package for PHP applications

v1.0.0(1y ago)1281MITPHP

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pralhadstha/omnipay-khalti)[ Packagist](https://packagist.org/packages/pralhadstha/omnipay-khalti)[ RSS](/packages/pralhadstha-omnipay-khalti/feed)WikiDiscussions master Synced 1mo ago

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

Omnipay: Khalti
===============

[](#omnipay-khalti)

**Khalti 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 Khalti support for Omnipay.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/).

To install, simply require `league/omnipay` and `pralhadstha/omnipay-khalti` with Composer:

```
composer require league/omnipay pralhadstha/omnipay-khalti

```

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

[](#basic-usage)

### Purchase

[](#purchase)

```
    use Omnipay\Omnipay;
    use Exception;

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

    $gateway->setSecret('secret_key_provided_by_khalti');
    $gateway->setTestMode(true);

    try {
        $response = $gateway->purchase([
            'amount' =>  10000, // Rs. 100 in paisa
            'purchaseOrderId' => 'SH-100',
            'purchaseOrderName' => "Basmati Rice 500gm",
            'websiteUrl' =>  'https://merchant.com/',
            'returnUrl' => 'https://merchant.com/payment/1/complete',
        ])->send();

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

After successful payment and redirect back to merchant site, you can verify the payment status and work accordingly.

### Verify Payment

[](#verify-payment)

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

    $gateway->setSecret('secret_key_provided_by_khalti');
    $gateway->setTestMode(true);

    $payload = $_GET;

    try {
        $response = $gateway->fetchTransaction([
            'paymentId' => $payload['pidx']
        ])->send();

        if ($response->isSuccessful()) {
            // Verified
        } else {
            // Unverified
        }
    } catch (Exception $e) {
        return $e->getMessage();
    }
```

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)**

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

[](#official-doc)

Please follow the [Official Doc](https://docs.khalti.com/) 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/pralhadstha/omnipay-khalti).

Support
-------

[](#support)

If you are having general issues with Omnipay Khalti, 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/pralhadstha/omnipay-khalti/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

29

—

LowBetter than 60% of packages

Maintenance47

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

393d ago

### Community

Maintainers

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

---

Top Contributors

[![pralhadstha](https://avatars.githubusercontent.com/u/6309194?v=4)](https://github.com/pralhadstha "pralhadstha (8 commits)")

---

Tags

khaltikhalti-integrationkhalti-payment-gatewaykhalti-pluginkhalti-sdkphpphp-libraryphp-sdk

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/pralhadstha-omnipay-khalti/health.svg)

```
[![Health](https://phpackages.com/badges/pralhadstha-omnipay-khalti/health.svg)](https://phpackages.com/packages/pralhadstha-omnipay-khalti)
```

PHPackages © 2026

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