Download the PHP package nikba/laravel-maib without Composer
On this page you can find all versions of the php package nikba/laravel-maib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nikba/laravel-maib
More information about nikba/laravel-maib
Files in nikba/laravel-maib
Package laravel-maib
Short Description Laravel 12 integration for the maib e-Commerce API — all payment types, token management, and webhook handling.
License MIT
Homepage https://github.com/Nikba-Creative-Studio/Laravel-Maib
Informations about the package laravel-maib
laravel-maib
A Laravel 12 package for the maib e-Commerce API — full coverage of all payment types, automatic token management, and HMAC-SHA256 callback webhook handling.
API documentation: https://docs.maibmerchants.md/e-commerce
Features
- Direct payment (one-step charge)
- Apple Pay & Google Pay (offered automatically on the hosted checkout page — no extra code)
- Two-step payment (hold → capture or cancel)
- Recurring payments (register card + server-side execute)
- One-click payments (register card + redirect execute)
- Payment refund (partial or full)
- Payment information query
- Saved card deletion
- Callback webhook handling with HMAC-SHA256 signature validation
- Laravel Events dispatched on successful/failed callbacks
- Automatic Bearer token generation, caching, and refresh
- Full PHPUnit test suite
Requirements
| Version | |
|---|---|
| PHP | ^8.2 |
| Laravel | ^12.0 |
Installation
Publish the configuration
Environment variables
Add the following to your .env file:
Credentials are available in maibmerchants.md under your project settings.
Configuration
After publishing, edit config/maib.php:
Usage
Direct Payment
Apple Pay & Google Pay: no separate integration is required. When the customer is redirected to the maib checkout page (
payUrl), maib offers Apple Pay and Google Pay alongside card entry automatically, based on the customer's device and browser. They flow through the same/pay,/hold, and one-click/recurring endpoints and return the same callback payload — so any payment you initiate with this package already supports them.
Two-Step Payment (Hold → Capture)
Recurring Payments
One-Click Payments
Refund
Payment Info
Delete Saved Card
Handling Callbacks
The package automatically registers the callback route at MAIB_CALLBACK_ROUTE (default: /maib/callback). This route is excluded from CSRF middleware.
Register this URL in your maibmerchants.md project settings.
Allowed callback IPs (optional firewall rule): 91.250.245.70, 91.250.245.71, 91.250.245.142
Listening for Events
The package dispatches one of three events per callback, based on the transaction status:
| Event | When | Callback status |
|---|---|---|
MaibPaymentReceived |
A charge succeeded (direct, execute, or save-card with an amount) | OK |
MaibCardSaved |
A card was registered without a charge (savecard-recurring / savecard-oneclick) — billerId is present |
PENDING + billerId |
MaibPaymentFailed |
Anything else (declined, timeout, failed, reversed, or an unknown/undocumented status) | otherwise |
3-D Secure
The order-fulfilment decision is driven by status, not by threeDs. A status of OK means the payment went through — including the SKIPPED and NOTPARTICIPATED 3DS outcomes, where the card issuer chose not to challenge the cardholder. The threeDs value (a nullable ThreeDsStatus enum on the payload) is available on every event purely for your records/logging; don't gate delivery on it.
Signature validation always runs before any event is dispatched — a callback with a bad signature returns 422 and dispatches nothing. Enum fields on the payload (status, threeDs, currency) are parsed leniently, so a future undocumented value degrades to null instead of erroring the callback (which would otherwise trigger maib's retry loop).
Important: Always return HTTP 200 from your listener logic — the package's callback handler already does this. maib retries the callback at increasing intervals (
10, 60, 300, 600, 3600, 43200, 86400seconds) if it does not receive a 200 response. Implement idempotency in your listeners.
Testing
Author
Nicolai Bargan
Nikba Creative Studio
[email protected]
License
The MIT License (MIT). See LICENSE for details.
All versions of laravel-maib with dependencies
illuminate/support Version ^12.0
illuminate/http Version ^12.0
illuminate/contracts Version ^12.0