PHPackages                             735l4/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. 735l4/khalti

Abandoned → [neputertech/khalti](/?search=neputertech%2Fkhalti)Library

735l4/khalti
============

Php wrapper for khalti integration

v1.1.2(10mo ago)13122[3 issues](https://github.com/neputertech/khalti/issues)MITPHPPHP ^7.4.0|^8.0

Since Nov 17Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/neputertech/khalti)[ Packagist](https://packagist.org/packages/735l4/khalti)[ RSS](/packages/735l4-khalti/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (3)Versions (10)Used By (0)

Laravel Khalti
==============

[](#laravel-khalti)

This package can help you integrate Khalti new ePayment Gateway (NEW) to your php application.

[Khalti ePay Docs](https://docs.khalti.com/khalti-epayment/)

Here is an example of how you can initiate Khalti transaction:

```
...
use Neputer\Facades\Khalti;
use Illuminate\Support\Facades\Redirect;

class PaymentController extends Controller {
    ...
    public function pay() {
        $return_url = "http://example.com/verify";
        $purchase_order_id = "your_transaction_id"; // example 123567;
        $purchase_order_name = "your_order_name"; // example Transaction: 1234,
        $amount = 1000; // Your total amount in paisa Rs 1 = 100 paisa

        $response =  Khalti::initiate($return_url, $purchase_order_id, $purchase_order_name,  $amount);

        // Custom handle of khalti response

        return Redirect::to($response->payment_url);
    }

    public function verify(Request $request) {
        $pidx = $request->get('pidx');
        return Khalti::lookup($pidx);
    }

}
```

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

[](#installation)

You can install the package via composer:

```
composer require neputertech/khalti
```

The package will automatically register itself.

You can publish the config with:

```
php artisan vendor:publish --tag=khalti-config
```

This is the contents of the published config file:

```
