Download the PHP package monapay/laravel without Composer

On this page you can find all versions of the php package monapay/laravel. 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

MONA Pay for Laravel

Composer package monapay/laravel that lets Laravel 10, 11 and 12 applications create dynamic VietQR codes for orders and receive signed MONA Pay bank-transfer webhooks as a Laravel event.

Requirements

Install

Laravel package discovery registers MonaPay\Laravel\MonaPayServiceProvider and the MonaPay facade. The publish command copies the config to config/monapay.php.

Configuration

Add the credentials to .env (never commit this file):

Optional variables and their defaults:

Variable Default Purpose
MONAPAY_TIMEOUT 30 HTTP timeout in seconds
MONAPAY_WEBHOOK_ENABLED true Register the webhook route
MONAPAY_WEBHOOK_PATH monapay/webhook Webhook route path
MONAPAY_WEBHOOK_TOLERANCE 300 Maximum timestamp skew in seconds
MONAPAY_ORDER_PREFIX DH Prefix used to build the order code
MONAPAY_USERNAME, MONAPAY_PASSWORD – Legacy fallback only; use client credentials on servers

Extra middleware for the webhook route can be added in config/monapay.php under webhook.middleware.

Usage

Create a dynamic VietQR for an order

The helper sends orderId=DH{id}, the amount in VND and the transfer memo Thanh toan DH{id} through the official PHP SDK, and returns the API response. The order ID must be a positive integer and the amount must be between 1 and 1,000,000,000 VND. Any extra fields passed in options are merged into the QR request body; orderId, amount and description cannot be overridden. For other API calls, use MonaPay::client() to get the underlying MonaPay\Client.

Receive webhooks

The package registers POST /monapay/webhook (route name monapay.webhook). Add this URL in MONA Pay with signature type HMAC_SHA256. The middleware verifies the X-Mona-Signature header against the raw request body and X-Mona-Timestamp, and rejects requests outside the timestamp tolerance (5 minutes by default). Valid incoming transactions dispatch MonaPay\Laravel\Events\PaymentReceived.

Only fulfil an order when the memo contains exactly DH{id}, the received amount is not lower than the order total, and the transaction_code has not been processed before. The webhook payload is a flat JSON object; there is no event.data wrapper. If you change MONAPAY_ORDER_PREFIX, pass the same prefix to extractOrderId() and matchesOrder(), which default to DH.

To check the route and HMAC setup locally:

API reference: monapay.vn/docs.

Development

CI runs PHPUnit against Laravel 10 (PHP 8.1), 11 and 12 (PHP 8.2); see .github/workflows/tests.yml.

License

MIT. See LICENSE.

MONA Pay is part of MONA Cloud by The MONA Group.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^10.0 || ^11.0 || ^12.0
illuminate/contracts Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0
illuminate/routing Version ^10.0 || ^11.0 || ^12.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
monapay/php-sdk Version ^0.4.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 monapay/laravel contains the following files

Loading the files please wait ...