Download the PHP package loucov/laravel-moncash-api without Composer
On this page you can find all versions of the php package loucov/laravel-moncash-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-moncash-api
Laravel MonCash API
A Laravel package to integrate the Digicel Haiti MonCash payment gateway: create payments, look up transactions, and send transfers — all behind a clean, injectable API.
Installation
Laravel auto-discovers the service provider and the MoncashApi facade. No
manual registration is needed.
Everything is wired up automatically. During the package:discover step
that Laravel runs after every composer install / composer update, the package:
- publishes
config/moncash.phpto your application (only if it doesn't exist yet) - appends its environment variables to your
.envand.env.examplefiles - registers a
pre-package-uninstallComposer hook so removal is equally automatic
All writes are idempotent, atomic (temp file + rename()), and
permission-preserving.
After installation, fill in the required values in your .env file:
MONCASH_SANDBOXdefaults totrueso fresh installs always point at the sandbox gateway. Flipping it tofalseis an explicit decision you should make before going to production.
If you ever want to re-run the installer manually — for example on a fresh
clone where .env was just created from .env.example — use:
Publishing the config
The config is published automatically on install. To publish or re-publish it manually:
Available environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
MONCASH_CLIENT_ID |
yes | — | OAuth client id |
MONCASH_SECRET_KEY |
yes | — | OAuth client secret |
MONCASH_SANDBOX |
yes | true |
true for sandbox, false for live |
MONCASH_BUSINESS_KEY |
no | — | Optional business key |
MONCASH_HTTP_TIMEOUT |
no | 15 |
HTTP timeout (seconds) |
MONCASH_HTTP_RETRIES |
no | 2 |
Retries on transient network failures |
MONCASH_HTTP_RETRY_WAIT |
no | 200 |
Wait between retries (ms) |
Uninstallation
Removal is automatic. When you run:
Composer fires the registered pre-package-uninstall hook before deleting the
vendor files. The hook:
- Removes
config/moncash.php - Removes all
MONCASH_*variables from.envand.env.example - Removes itself from your
composer.json
To trigger the same cleanup manually (without removing the package), run:
Usage
You can use the package in three equivalent ways. Pick whichever fits your codebase best.
1. Facade
2. Dependency injection
3. Container resolution
Available methods
payment(int $amount, string $orderId): PaymentResponse
Create a new payment request. Redirects the customer to the MonCash hosted payment page.
$payment->paymentToken is a typed PaymentToken object that exposes the
full token payload returned by the API:
Example — redirect only if the token is still valid:
paymentDetailsByTransactionId(string $transactionId): TransactionResponse
paymentDetailsByOrderId(string $orderId): TransactionResponse
Look up a completed payment.
transfer(int $amount, string $receiver, string $desc = ''): TransferResponse
Send money from the business wallet to a MonCash account.
Error handling
All failures throw typed exceptions — no more mixed response shapes:
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
MIT. See LICENSE.
All versions of laravel-moncash-api with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0|^13.0