Download the PHP package fynduck/laravel-maib-ecommerce without Composer

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

Laravel maib e-Commerce

Latest Version on Packagist Tests Total Downloads

A Laravel package for the maib (Moldova Agroindbank) e-Commerce payment gateway. It implements the maibmerchants e-Commerce API natively in Laravel — HTTP client, container bindings, a facade, config, events, signature verification and an optional payments table.

Requirements

Installation

Publish the config:

Add your project credentials (issued in the maibmerchants.md dashboard after activation) to .env:

The access token is generated, cached and refreshed automatically — you never handle tokens.

Usage

All methods are available on the Maib facade and return a PaymentResult object.

Direct payment

Only amount, currency and clientIp are required; everything else is optional. You can pass the Currency and Language enums instead of raw strings to avoid mistyping — the client converts them automatically:

The same optional keys (description, clientName, email, phone, orderId, delivery, items, okUrl, failUrl, callbackUrl) apply to hold(), saveRecurring() and saveOneclick(). For the authoritative, always-current list of every parameter and its constraints, see the maib e-Commerce API docs.

Two-step payment (hold + complete)

Refund

Payment info

Recurring & one-click

Callbacks (webhooks)

maib sends a signed notification to your callbackUrl after each payment. The package registers a route (default POST /maib/callback, named maib.callback) guarded by a signature-verification middleware. Requests with an invalid signature are rejected with a 403 before reaching your application.

On a valid callback the package dispatches:

Each event carries a CallbackResult ($event->callback) with a typed PaymentResult ($event->callback->payment) and the raw verified result array.

Registering listeners

Map a listener to the event in your App\Providers\EventServiceProvider:

On Laravel 11+ the EventServiceProvider is no longer in the default skeleton. You can still create it (and register it in bootstrap/providers.php), or just bind the listener in AppServiceProvider::boot(): Event::listen(PaymentSucceeded::class, MarkOrderAsPaid::class);

Run listeners on the queue (recommended)

The callback request comes from maib and is waiting on your HTTP response — and maib may retry the notification if you are slow or error out. Do not do slow work (DB writes, sending mail, calling other APIs) inline in the listener: that blocks the response and risks duplicate callbacks. Instead make the listener queued by implementing ShouldQueue, so the controller returns 200 immediately and the work runs on a worker:

Make sure a queue worker is running (php artisan queue:work). Because callbacks can be re-delivered, keep listeners idempotent — key off payId so processing the same notification twice is harmless.

Security: the signature is validated using your MAIB_SIGNATURE_KEY with the maib algorithm (recursive key sort → append key → :-join → base64(sha256())) and a timing-safe comparison. Never expose the signature key.

Optional payment persistence

To record every callback in a maib_payments table:

Then set MAIB_STORE_PAYMENTS=true. Incoming callbacks are upserted into the Fynduck\MaibEcommerce\Models\MaibPayment model (keyed by pay_id). The core client works without this table — persistence is entirely opt-in.

Testing

License

MIT


All versions of laravel-maib-ecommerce with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^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 fynduck/laravel-maib-ecommerce contains the following files

Loading the files please wait ...