PHPackages                             jwn25/php-esewa - 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. jwn25/php-esewa

ActiveLibrary[Payment Processing](/categories/payments)

jwn25/php-esewa
===============

Package to integrate esewa with php/Laravel for Omnipay payment library

1.3.0(5y ago)182MITPHP

Since May 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jwn25/php-esewa)[ Packagist](https://packagist.org/packages/jwn25/php-esewa)[ RSS](/packages/jwn25-php-esewa/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Php Esewa
=========

[](#php-esewa)

php-esewa is a package which is developed to implement [esewa](https://esewa.com.np) support for [Omnipay](https://github.com/thephpleague/omnipay). Omnipay is a payment processing library for PHP.

**Installation**

As this package is esewa support for Omnipay, installation of omnipay library is must.

```
composer require league/omnipay

composer require jwn25/php-esewa

```

Laravel Usage
-------------

[](#laravel-usage)

**Config**

Add following lines on config/services.php

```
'esewa' => [
  'merchant_code' => env('ESEWA_MERCHANT_CODE', 'epay_payment'),
  'test_mode' => env('ESEWA_TEST_MODE', true)
]

```

**ENV**

Update your `.env` with credentials provided by esewa.

```
ESEWA_MERCHANT_CODE=YOUR_MERCHANT_CODE
ESEWA_TEST_MODE=false

```

**Routes**

```
Route::post('/order/{order_id}/payment-process', 'PaymentController@processPayment');

Route::get('/order/{order_id}/payment-failed', 'PaymentController@paymentFailed')->name('payment-failed');

Route::get('/order/{order_id}/payment-completed', 'PaymentController@paymentCompleted')->name('payment-completed');

```

**Controller**

```
