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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-moncash-api

loucov

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:

All writes are idempotent, atomic (temp file + rename()), and permission-preserving.

After installation, fill in the required values in your .env file:

MONCASH_SANDBOX defaults to true so fresh installs always point at the sandbox gateway. Flipping it to false is 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:

  1. Removes config/moncash.php
  2. Removes all MONCASH_* variables from .env and .env.example
  3. 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

PHP Build Version
Package Version
Requires php Version ^8.1
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package loucov/laravel-moncash-api contains the following files

Loading the files please wait ...