PHPackages                             mservice/payment - 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. mservice/payment

ActiveLibrary[Payment Processing](/categories/payments)

mservice/payment
================

MoMo Package to speed up the integration process with merchants.

293.8k23[3 issues](https://github.com/momo-wallet/php/issues)JavaScriptCI failing

Since Feb 18Pushed 4y ago6 watchersCompare

[ Source](https://github.com/momo-wallet/php)[ Packagist](https://packagist.org/packages/mservice/payment)[ RSS](/packages/mservice-payment/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MoMo - Payment Platform
=======================

[](#momo---payment-platform)

Library package to integrate MoMo E-Wallet as payment method

- Online Payment: Desktop, Mobile website
- Offline payment: POS, Static QR, Dynamic QR
- Mobile Payment: App to App, In MoMo Application

### Prerequisites

[](#prerequisites)

- PHP &gt;= 7.2
- Composer

For development purposes, we use phpunit/phpunit for testing.

Please check the composer.json file for detailed information on libraries for development as well as suggested packages

### Installing

[](#installing)

Make sure you have the correct PHP version and Composer installed. Then you can add the package from the command line:

```
composer require mservice/payment

```

Or you can add directly to the `composer.json` file and then run the command `composer update`:

```
require {
    "mservice/payment":"*"
}

```

Please remember to run `composer dump-autoload -o` to make sure the autolaod works properly.

Documention
-----------

[](#documention)

Usage
-----

[](#usage)

### Setting Up MoMo Environment

[](#setting-up-momo-environment)

MoMo provides 2 environments for integration: development(`dev`) and production(`prod`). The model for environment is located at `MService\Payment\Shared\SharedModels\Environment`

Example configuration is provided in `.env.example` and sample code on how to set up your environment can be found in `SampleEnvironment.php` file. Please create your own `.env` file and then copy contents from `.env.example` to that file (or make any necessary changes). Please note that `selectEnvironment()` is just a sample code and NOT part of the actual library.

By default, log is turned off. But you can use `MoMoLogger` by setting the `$loggingOff` property to `false` during environment setup.

### Integration

[](#integration)

The library provides functions to conduct transactions through the All-In-One (AIO) Payment Gateway (`Mservice\Payment\PayGate`) and all other Payment (`Mservice\Payment\Pay`) options (App-In-App, POS, Dynamic QR Code)

For each payment options, you can choose to either use the provided code in `Processors` folder to immediately use MoMo services or extend from the models located in `Models` folder. To have a better sense of how the processors work, we recommend uncommented and run the code in `PayGate.php` and `Pay.php`

For `Pay.php`, please ensure that the URI you are calling to is correct for the processes you are trying to run accoring to [MoMo's documentation](https://developers.momo.vn/#/).

Running The Tests
-----------------

[](#running-the-tests)

Install phpunit/phpunit library to the downloaded project:

From the terminal, with Composer:

```
composer require-dev "phpunit/phpunit":"^8"

```

Or you can directly add to `composer.json`, and then update the composer:

```
"require-dev": {
    "phpunit/phpunit": "^8"
 },

```

In the PhpStorm Preferences window, go to `Languages & Framework / PHP / Test Frameworks` choose `use Composer autoload` to load your local PhpUnit library.
Do remember to run the `composer dump-autoload -o` command first to ensure proper run of Composer's autoload. Run the tests with phpunit command. For example, you can run the CaptureMoMoTest.php by using the command:

```
./vendor/bin/phpunit tests/MService/Payment/AllInOne/Processors/CaptureMoMoTest.php

```

Or `./vendor/bin/phpunit tests` to run all available tests

Acknowledgments
---------------

[](#acknowledgments)

### Security Aalgorithms

[](#security-aalgorithms)

- [HMAC 256](https://en.wikipedia.org/wiki/HMAC)
- [RSA - Rivest–Shamir–Adleman](https://en.wikipedia.org/wiki/RSA_(cryptosystem))
- [AES - Advanced Encryption Standard](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)

### More

[](#more)

- [IPN - Instant Payment Notification](https://developer.paypal.com/docs/classic/products/instant-payment-notification/)
- [JSON - JavaScript Object Notation](https://www.json.org/)

Languages
---------

[](#languages)

- PHP

Versioning
----------

[](#versioning)

```
Version 0.1

```

Authors
-------

[](#authors)

- **Linh Nguyễn** - linh.nguyen7@mservice . com . vn

License
-------

[](#license)

(c) MoMo

Support
-------

[](#support)

If you have any issues when integrate MoMo API, please find out in [`F.A.Q`](https://developers.momo.vn/#/docs/aio/?id=faq) or [`Exception handling`](https://developers.momo.vn/#/docs/error_code) section in our [documention](https://developers.momo.vn)

=======

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 86.2% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c33aa3f50515d742353c98a76e3edcc973a2249de286babc31638c3aa97b7779?d=identicon)[itc.payment](/maintainers/itc.payment)

---

Top Contributors

[![lnguyen99](https://avatars.githubusercontent.com/u/46892498?v=4)](https://github.com/lnguyen99 "lnguyen99 (25 commits)")[![hainguyenp207](https://avatars.githubusercontent.com/u/18342245?v=4)](https://github.com/hainguyenp207 "hainguyenp207 (2 commits)")[![vanhungpcmomo](https://avatars.githubusercontent.com/u/218188427?v=4)](https://github.com/vanhungpcmomo "vanhungpcmomo (2 commits)")

### Embed Badge

![Health badge](/badges/mservice-payment/health.svg)

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

###  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/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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