bml-connect / laravel
BML Connect PHP/Laravel SDK for Bank of Maldives payment gateway
dev-main
2026-03-02 22:56 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.0
This package is auto-updated.
Last update: 2026-04-30 23:24:51 UTC
README
v1 — PHP/Laravel SDK for the BML Connect payment gateway by Bank of Maldives.
Requirements
- PHP 8.1 or higher
- Guzzle 7
Installation
composer require bml-connect/laravel
Quick Start
Standalone PHP
use BmlConnect\BmlConnect; use BmlConnect\Enums\Environment; $bml = new BmlConnect('your-api-key', Environment::PRODUCTION); $transaction = $bml->transactions->create([ 'amount' => 100.00, 'currency' => 'MVR', 'redirectUrl' => 'https://example.com/callback', 'localId' => 'order-123', ]); echo $transaction->url; // Redirect customer to this URL
Laravel
Add your API key to .env:
BML_CONNECT_API_KEY=your-api-key BML_CONNECT_ENV=production
Use the facade:
use BmlConnect\Facades\BmlConnect; $transaction = BmlConnect::$transactions->create([ 'amount' => 100.00, 'currency' => 'MVR', 'redirectUrl' => 'https://example.com/callback', 'localId' => 'order-123', ]);
Documentation
For full API reference and guides, see the Documentation.
Highlights:
- Getting Started — installation, configuration, environment setup
- Transactions — create, list, update, idempotency keys
- Pagination — paginated results, iterating pages
- Webhooks — registration, signature verification, payload parsing
- Error Handling — typed exceptions
Testing
./vendor/bin/phpunit
See Testing Guide for details on unit, feature, and integration tests.
License
MIT. See LICENSE for details.