PHPackages                             asdh/imepay - 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. asdh/imepay

ActiveLibrary[Payment Processing](/categories/payments)

asdh/imepay
===========

IME Pay payment validation package

1.0.0(5y ago)276MITPHPPHP ^7.4|^8.0

Since Mar 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/AshishDhamalaAD/imepay)[ Packagist](https://packagist.org/packages/asdh/imepay)[ Docs](https://github.com/asdh/imepay)[ GitHub Sponsors](https://github.com/asdh)[ RSS](/packages/asdh-imepay/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (7)Versions (5)Used By (0)

IME Pay payment validation package
==================================

[](#ime-pay-payment-validation-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0ee19345ce9b56103fcc2986b8833c26ca403621251cc343b049d04311456ac0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617364682f696d657061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asdh/imepay)[![GitHub Tests Action Status](https://camo.githubusercontent.com/0ac920d0d183bccf3524c48ac0b62fd20edc9b0df58148b0b68d5b417b14d87b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617364682f696d657061792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/asdh/imepay/actions?query=workflow%3ATests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a30301e4030d2e924806137d7996cd3677fc22f59f29b276b027c37fc9be3153/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617364682f696d657061792f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/asdh/imepay/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/86c1094e5f77e761fddec10bb8ab31b066804a00cea659234f93a5bc797a296b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617364682f696d657061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/asdh/imepay)

A very small package to inetgrate IME Pay in your laravel project.

Support me
----------

[](#support-me)

Buy me a coffee. ✌️

eSewa ID: 9840594104

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

[](#installation)

You can install the package via composer:

```
composer require asdh/imepay
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Asdh\ImePay\ImePayServiceProvider" --tag="imepay-config"
```

This is the contents of the published config file:

```
return [
    'merchant_number' => env('IME_PAY_MERCHANT_NUMBER'),
    'merchant_name' => env('IME_PAY_MERCHANT_NAME'),
    'merchant_code' => env('IME_PAY_MERCHANT_CODE'),
    'merchant_module' => env('IME_PAY_MERCHANT_MODULE'),
    'username' => env('IME_PAY_USERNAME'),
    'password' => env('IME_PAY_PASSWORD'),
    /**
     * The payment url
     *
     * E.g. https://stg.imepay.com.np:1234
     */
    'base_url' => env('IME_PAY_BASE_URL'),
];
```

Usage
-----

[](#usage)

I have also made a laravel project where I have shown how to use this package with routes, controllers and views. [Click here to go to that repo](https://github.com/AshishDhamalaAD/imepay-laravel-usage).

### Getting token for payment

[](#getting-token-for-payment)

To get the token before initiating the payment:

```
use Asdh\ImePay\ImePay;

$imepay = new ImePay();

// refId can be any unique id or the order id through which you can get all the details of the order/product that the user is buying
$refId = Str::uuid();
$amount = 100;

$response = $imepay->getToken($refId, $amount);

$token = $response->tokenId();
```

There are also other methods in the above `$response` instance. All these methods represent the response from the IME Pay itself.

```
$response->responseCode();
$response->responseDescription();
$response->refId();
$response->tokenId();
$response->amount();
```

To get the raw response from IME Pay:

```
$response->raw();
```

Also, if the credentials you provided was not correct, it will throw `ImePayException`. You can catch this exception and perform your action.

### Verifying the payment

[](#verifying-the-payment)

When a user pays using IME Pay in your website, IME Pay will redirect to a success url that you have to provide. In that url they will send a post request with some parameters.

> Don't forget to add this route to the `$except` array of `App\Http\Middleware\VerifyCsrfToken` class. Also, this url should not be under authentication. Otherwise, the request sent from IME pay will not reach your website.

You can verify if it is valid like shown in the below code.

First of all in your controller do this:

```
use Asdh\ImePay\ImePay;

$imepay = new ImePay();

$response = $imepay->verify($request->all());

if ($response->isVerified()) {
    // do your stuffs...
}
```

There is also `$response->isNotVerified()` method which could be useful. If the response is not verified, you can get the message using `$response->responseDescription()`.

There are also other methods in the above `$response` instance. All these methods represent the response from the IME Pay itself.

```
$response->responseCode();
$response->responseDescription();
$response->refId();
$response->msisdn(); // phone number of paying user
$response->tokenId();
$response->transactionId();
```

To get the raw response from IME Pay:

```
$response->raw();
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ashish Dhamala](https://github.com/AshishDhamala)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

1930d ago

Major Versions

0.2.1 → 1.0.02021-03-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9fec3e923a4df02c2274abecce09f9d9f26e50d043041d42827527269cb3de6?d=identicon)[asdh](/maintainers/asdh)

---

Top Contributors

[![AshishDhamalaAD](https://avatars.githubusercontent.com/u/65481305?v=4)](https://github.com/AshishDhamalaAD "AshishDhamalaAD (30 commits)")

---

Tags

imepayimepay-laravellarave-imepaylaravelasdhimepay

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asdh-imepay/health.svg)

```
[![Health](https://phpackages.com/badges/asdh-imepay/health.svg)](https://phpackages.com/packages/asdh-imepay)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M152](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

8118.0k](/packages/danestves-laravel-polar)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

32837.0k](/packages/sunchayn-nimbus)

PHPackages © 2026

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