PHPackages                             fruitsbytes/php-moncash - 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. fruitsbytes/php-moncash

ActiveLibrary[Payment Processing](/categories/payments)

fruitsbytes/php-moncash
=======================

PHP library to use Digicel MonCash

v1.1.0(3y ago)11201[9 issues](https://github.com/Fruitsbytes/php-moncash/issues)1MITPHPPHP &gt;=8.0

Since Feb 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Fruitsbytes/php-moncash)[ Packagist](https://packagist.org/packages/fruitsbytes/php-moncash)[ RSS](/packages/fruitsbytes-php-moncash/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (1)

Moncash
=======

[](#moncash)

[![PHP](https://camo.githubusercontent.com/b659854dd49aec85ed88015b8fc2f52f75e9f4f0991e77c9e9baffa37a97382f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3466356239333f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d376138366238)](https://camo.githubusercontent.com/b659854dd49aec85ed88015b8fc2f52f75e9f4f0991e77c9e9baffa37a97382f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3466356239333f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d376138366238)[![](https://camo.githubusercontent.com/7ad875f95625bea1df06c404c318272a34f2635fbb0fb011f0bfc09d91e6ceef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d436f6d706f736572266c6f676f436f6c6f723d623362336233)](https://camo.githubusercontent.com/7ad875f95625bea1df06c404c318272a34f2635fbb0fb011f0bfc09d91e6ceef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d436f6d706f736572266c6f676f436f6c6f723d623362336233)[![](https://camo.githubusercontent.com/685e3297168438b20981a46aec49f827bca3dfcc0393dbc4f4563cb87c8e9170/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a57542d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d4a534f4e253230776562253230746f6b656e73266c6f676f436f6c6f723d623362336233)](https://camo.githubusercontent.com/685e3297168438b20981a46aec49f827bca3dfcc0393dbc4f4563cb87c8e9170/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a57542d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d4a534f4e253230776562253230746f6b656e73266c6f676f436f6c6f723d623362336233)[![](https://camo.githubusercontent.com/5d2024901e4920aaa71ad2f31c884d0c5be467c036c8bcdb5997d0f1ea9b83be/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f73746d616e2d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d506f73746d616e266c6f676f436f6c6f723d623362336233)](https://camo.githubusercontent.com/5d2024901e4920aaa71ad2f31c884d0c5be467c036c8bcdb5997d0f1ea9b83be/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f73746d616e2d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d506f73746d616e266c6f676f436f6c6f723d623362336233)[![](https://camo.githubusercontent.com/f13a7918bc3f1c952fdd5efcc6440fab3776701cbe3efc9b900e5c97671b97f7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f2d50485053746f726d2d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d70687073746f726d266c6f676f436f6c6f723d623362336233)](https://camo.githubusercontent.com/f13a7918bc3f1c952fdd5efcc6440fab3776701cbe3efc9b900e5c97671b97f7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f2d50485053746f726d2d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d70687073746f726d266c6f676f436f6c6f723d623362336233)[![](https://camo.githubusercontent.com/04144685d9a8528cdb55bb43b7f8b6653bf32c356070b0dcd41706e9aba19995/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f48544d4c352d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d68746d6c35266c6f676f436f6c6f723d623362336233)](https://camo.githubusercontent.com/04144685d9a8528cdb55bb43b7f8b6653bf32c356070b0dcd41706e9aba19995/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f48544d4c352d3136314233303f7374796c653d666f722d7468652d6261646765266c6f676f3d68746d6c35266c6f676f436f6c6f723d623362336233)

🌎 i18n: [`🇺🇸`](./README.md "English translation") • [🇫🇷](./README.fr.md "Traduction française") • [🇭🇹](./README.ht.md "TRadiksyon kreyòl")

[![FruitsBytes-Moncash-PHP](assets/images/FruitsBytes-moncash-php.png?v=2)](assets/images/FruitsBytes-moncash-php.png?v=2)

[![](https://camo.githubusercontent.com/ae4b03c7c8a536c6c9648bc2d38a7a07e737096c10aa652da08b32d1e0456a2b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6e616d652f46727569747362797465732f7068702d6d6f6e63617368)](https://camo.githubusercontent.com/ae4b03c7c8a536c6c9648bc2d38a7a07e737096c10aa652da08b32d1e0456a2b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6e616d652f46727569747362797465732f7068702d6d6f6e63617368)[![](https://camo.githubusercontent.com/8b8272da827ba51767b1185bf9980bcc17c9e6f69338a449705db5734ff5d7f5/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f46727569747362797465732f7068702d6d6f6e636173682f6c6174657374)](https://camo.githubusercontent.com/8b8272da827ba51767b1185bf9980bcc17c9e6f69338a449705db5734ff5d7f5/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f46727569747362797465732f7068702d6d6f6e636173682f6c6174657374)[![](https://camo.githubusercontent.com/526184a50e232ff6cb8984024d3cae8c64abfa6383bf24b07d2adadcdac32765/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f46727569747362797465732f7068702d6d6f6e63617368)](https://camo.githubusercontent.com/526184a50e232ff6cb8984024d3cae8c64abfa6383bf24b07d2adadcdac32765/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f46727569747362797465732f7068702d6d6f6e63617368)[![](https://camo.githubusercontent.com/b0938f3fe720e54ff83d7b62415e8272a0f13389d55d83e4908c2e2379cdd265/68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f46727569747362797465732f7068702d6d6f6e63617368)](https://camo.githubusercontent.com/b0938f3fe720e54ff83d7b62415e8272a0f13389d55d83e4908c2e2379cdd265/68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f46727569747362797465732f7068702d6d6f6e63617368)[![](https://camo.githubusercontent.com/eab30f9ed3e8937f46e31f39e8b29a254723c7a4c8257059c9ca929e4f1aff66/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f46727569747362797465732f7068702d6d6f6e63617368)](https://camo.githubusercontent.com/eab30f9ed3e8937f46e31f39e8b29a254723c7a4c8257059c9ca929e4f1aff66/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f46727569747362797465732f7068702d6d6f6e63617368)[![](https://camo.githubusercontent.com/7ed7578ff2a1a441af7af48321dedb1e2ca94bd4dfd6d5f7fc4a318080a6303a/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f46727569747362797465732f7068702d6d6f6e63617368)](https://camo.githubusercontent.com/7ed7578ff2a1a441af7af48321dedb1e2ca94bd4dfd6d5f7fc4a318080a6303a/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f46727569747362797465732f7068702d6d6f6e63617368)

A library to facilitate Digicel MonCash mobile money integration on your PHP projects via their [API](https://sandbox.moncashbutton.digicelgroup.com/Moncash-business/resources/doc/RestAPI_MonCash_doc.pdf). For now it handles the base (client) use cae. The merchant use cases wil be available soon. It is part of the MonCash SDK provided by FruitsBytes.

---

[🍇Features](#features)
----------------------

[](#features)

- Client side Adapter (Payment, Transfer, ...)
    - Render Button
    - Payment
    - Transfer
- Traffic optimisation (`Advanced`)
- Security: Secret Management (`Advanced`)
- Unique orderID generator
- Retry (`Advanced`)
- Phone Validation (`Advanced`)
- Client Button, No Backend (Encrypted, client side button)
- Merchant App (Cash-In , Cash-Out, ...)
- Idempotence (`Advanced`)
- Localization (`Advanced`)
- Task (Recurring payments, garbage collector,...)

Check the [CHANGELOG](/CHANGELOG.md) for additional information on breaking changes and new features.

---

[🍈Documentation](#Documentation)
--------------------------------

[](#documentation)

For a complete guide please check the [Wiki](https://github.com/Fruitsbytes/php-moncash/wiki) or the [code examples](./demo).

[🍉Quick Start](#Quick-Start)
----------------------------

[](#quick-start)

### Installation

[](#installation)

```
composer require fruitsbytes/php-moncash
```

### Configuration

[](#configuration)

```
// index.php

use Fruitsbytes\PHP\MonCash\API\Client;

$client = new Client(
                        [
                            'clientSecret'     => 'my-client-secret',
                            'clientId'         => 'my-client-key',
                            'businessKey'      => 'my-merchant-key',
                        ]
                    );
```

You can update or set the configuration:

```
use Fruitsbytes\PHP\MonCash\Configuration\Configuration;

$configuration = new Configuration(["lang"=>"ht"]);
$client = new Client($configuration);
```

The default no config value :

```
// src/Configuration/Configuration.php

 const DEFAULT_CONFIG = [
        'mode'             => 'sandbox',
        'lang'             => 'en',
        'clientSecret'     => '',
        'clientId'         => '',
        'businessKey'      => '',
        'rsaPath'          => './rsa.text',
        'timeout'          => 60,
        'secretManager'    => DefaultSecretManager::class,
        'tokenMachine'     => FileTokenMachine::class,
        'phoneValidation'  => LibPhoneValidation::class,
        'orderIdGenerator' => UUIDOrderIdGenerator::class,
    ];
```

### Usage

[](#usage)

#### Client

[](#client)

For client facing websites and mobile app, where the client iniates the payment.

```
// Create a payment & redirect user
use Fruitsbytes\PHP\MonCash\API\Order;
use Fruitsbytes\PHP\MonCash\API\PaymentFoundResponse;
use Fruitsbytes\PHP\MonCash\API\PaymentFoundResponse;
use Fruitsbytes\PHP\MonCash\APIException;
use Exception;

try{
   $order = new Order($amount); // if you have your own orderID `new  Order($amount, $uuid)`
   $payment = $client->createAndRedirect($order);
}catch( APIException $e){
   $message = $e->getMessage();
}
catch( Exception $e){
   $message = $e->getMessage();
}

// get payment by orderID if ypui do not habe the transation ID yet
/**
* @var PaymentFoundResponse
 */
$paymentResult = $client->getPaymentByOrderId($order->id);

// get payment by transactionID when transaction is finished
$transactionId = $_GET['transactionId']

/**
* @var PaymentFoundResponse
 */
$paymentResult = $client->getPaymentByTransactionId($transactionId);

if(!$payment->isSuccessful()){
  throw new \Exception($payment->message);
}

```

#### Button

[](#button)

The button, when clicked, will create the transaction and redirects the user to the

```
// Generate Button form html code
use Fruitsbytes\PHP\MonCash\Button\ButtonStyleRedResponsive;

$buttonConfig = [
     true, // border
     'em', //  lang
     true, // animate on  hover,
     48 // height
];
$button = new ButtonStyleRedResponsive( $order, $clientConfig, ...$buttonConfig);

$htmlButton = $button->html();
print($htmlButton);

// or Use the \Stringable interface
print $button;
```

You can render the template directly

```
$buttonHT = new ButtonStyleRedResponsive( $order, [], true, 'ht');

$buttonHT->render();
```

 [![](./assets/images/button-config.png)](./assets/images/button-config.png)Button config Playground

#### Merchant

[](#merchant)

For applications aimed at store clerks or business owners where the client is present at the time of the transaction. It handles Cash-In and Cash-Out scenarios.

==== 🚧 Coming soon =====

---

[🍊Playground](#playground)
--------------------------

[](#playground)

==== 🚧 Website Coming soon =====

You can check the Postman API online or [import](./Postman) the .json from this repository.

---

[🍍Contribution](#contribution)
------------------------------

[](#contribution)

All pull requests and suggestions are welcomed. If there is a particular feature you are struggling make a pull reque

[🍒Test](#test)
--------------

[](#test)

When modifyiing To run the test use the following shell command from this directory.

Set the values of `.env.testing` environment file.

```
composer phpunit
```

or

```
vendor\bin\phpunit
```

⚠ Reduce credentials being leaked by not using production credentials for testing.

---

[🍓Other](#Other)
----------------

[](#other)

#### FruitsBytes MonCash SDK:

[](#fruitsbytes-moncash-sdk)

RepoDescriptionVersionStatus[Laravel examples](https://github.com/Fruitsbytes/Laravel-Moncash-Example)Examples using pure laravel codes, no- external libraries.[![version](https://camo.githubusercontent.com/d2f8845ee2d7ca0e71752411535f5e2a9b2d6b428758f754108b233f468e3f8f/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f46727569747362797465732f4c61726176656c2d4d6f6e636173682d4578616d706c65)](https://camo.githubusercontent.com/d2f8845ee2d7ca0e71752411535f5e2a9b2d6b428758f754108b233f468e3f8f/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f46727569747362797465732f4c61726176656c2d4d6f6e636173682d4578616d706c65)✅LaravelA fully funtional package for laravel**alpha**
 not ready to share🚧[Wordpress](#wordpress)Use MonCash on Wordpress sites. Also available for Woocommerce integration**alpha**
 not ready to share🚧[Shopify](#shopify)Use MonCash as a shopify payment method**alpha**
 not ready to share🚧[NodeJS](#nodeJS)Using NodeJS as a server this can be used with idependently or as an API (for non-SSR websites for example).**alpha**
 not ready to share🚧[Javascript Examples](#javasccript-examples)Repositories with a general idea on how to consume the API with several use case and JS Frameworks native solution**alpha**
 not ready to share🚧[Angular](#angular)Configurable Button + Server side compolnents (Angular Universal)**alpha**
 not ready to share🚧[ReactJS](#reactJS)Configurable Button + Server side compolnents (Next.js, )**alpha**
 not ready to share🚧[VueJS](#vueJS)Configurable Button**alpha**
 not ready to share🚧[Capacitor](#capacitor)IonicFramework Plugin for Android and IOS with deepLink integration support and extra security**alpha**
 not ready to share🚧#### MonCash Documentation

[](#moncash-documentation)

- [Client Rest API](https://sandbox.moncashbutton.digicelgroup.com/Moncash-business/resources/doc/RestAPI_MonCash_doc.pdf) ( client facing user interface)
    - [Button](https://sandbox.moncashbutton.digicelgroup.com/Moncash-business/resources/doc/MC_Button_Doc.pdf)
- [Merchant Rest API](https://documenter.getpostman.com/view/1199944/UVeJKju3) (admin/merchant facing UI)
- Dashboard: [sandbox](https://sandbox.moncashbutton.digicelgroup.com/) (for test) | [production](https://moncashbutton.digicelgroup.com/Moncash-business/Login) (live)

#### Offical Repo

[](#offical-repo)

- [ecelestin/ ecelestin-Moncash-sdk-php](https://github.com/ecelestin/ecelestin-Moncash-sdk-php/blob/master/src/PaymentMaker.php)✍ ing. Enadyre celeste

#### Online videos :

[](#online-videos-)

TitleLinkKijan pou mete Moncash sou sit ou pou w vann (🇭🇹)
 ✍ Certil Rémy[![Video1](https://camo.githubusercontent.com/bc7cf3ef81c0ab0e106835635bfe71776b19d70afc8102f32eb01f7a8d1ae514/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6c4533656a465431315f772f312e6a7067)](https://www.youtube.com/watch?v=lE3ejFT11_w)Comment Intégrer l'onglet Moncash Pay à votre commerce online - Technopro Web (🇫🇷)
 ✍ Osirus Kurt, RIP 🕊[![Video2](https://camo.githubusercontent.com/5b61228b2de4798377ca467aa4f7810b32461a2b0f617950ca0ba01538c7931b/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f4e695759724f5f4535696b2f312e6a7067)](https://www.youtube.com/watch?v=NiWYrO_E5ik)---

[🍋Security](#security)
----------------------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be addressed as soon as possible. You may view our full security policy [here](./SECURITY.md).

---

[🍎Need help?](#help)
--------------------

[](#need-help)

Don't hesitate to go in the discussion page and check if the issue is not addressed yet. You can start a new discussion if need be.

If you are an upcoming startup, a student or don't have the budget for consultation fees, it will take longer but we can submit a public repo illustrating the help you need as long as it will benefit the rest of the community:

Contact us at [](mailto:help@anbapyezanman.com)

[![YT](./assets/images/youtube.png?v=2)](https://www.youtube.com/channel/UC14dR51q2_mFCQulsmecL1Q)You can also check our [Youtube Channel](https://www.youtube.com/channel/UC14dR51q2_mFCQulsmecL1Q)### For Enterprise

[](#for-enterprise)

[Fruitsbytes](fruitsbytes.com) can deliver commercial support and maintenance for your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.

Contact us at

---

[🍏License](#license)
--------------------

[](#license)

This library is licensed under [The MIT License](LICENSE).

### Discalimer

[](#discalimer)

 **\*** The Digicel™, MonCash™, Sogebank™ and all other trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this documentation are for identification purposes only. Use of these names,trademarks and brands does not imply endorsement.

[MonCash™](https://www.digicelgroup.com/ht/en/moncash/business.html) is a mobile money service provided by [Digicel™](https://www.digicelgroup.com/) that allows daily transactions between MonCash users, regardless of their location in Haiti. Digicel is a pioneer in mobile money. Their financial services are currently expanding into other markets, specifically in the pacific island with MyCash™ \[[1](https://mycash.com.fj/)\] \[[2](https://mycash.ws/)\]

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance4

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

3

Last Release

1299d ago

Major Versions

v0.1.0-alpha → v1.0.02022-11-20

PHP version history (2 changes)v0.1.0-alphaPHP &gt;=7.3

v1.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/babf73162eedeb93f70b7bfa8528638c5815d0e19928e74b69649f704948412e?d=identicon)[jeffrey.carre](/maintainers/jeffrey.carre)

---

Top Contributors

[![bleuscyther](https://avatars.githubusercontent.com/u/2999487?v=4)](https://github.com/bleuscyther "bleuscyther (28 commits)")

---

Tags

buttoncomposerdigicellibrarymoncashpaymentpaymentsphpphp8transfer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fruitsbytes-php-moncash/health.svg)

```
[![Health](https://phpackages.com/badges/fruitsbytes-php-moncash/health.svg)](https://phpackages.com/packages/fruitsbytes-php-moncash)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.9k](/packages/laravel-framework)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M129](/packages/roots-acorn)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.3k453.6k30](/packages/tightenco-jigsaw)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[shetabit/multipay

PHP Payment Gateway Integration Package

293361.0k4](/packages/shetabit-multipay)[saithink/saiadmin

webman plugin

28111.0k1](/packages/saithink-saiadmin)

PHPackages © 2026

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