PHPackages                             bankofmaldives/bml-connect-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bankofmaldives/bml-connect-php

ActiveLibrary[API Development](/categories/api)

bankofmaldives/bml-connect-php
==============================

PHP Bindings for the BML Connect API

v2.1.0(4y ago)49.6k↓47.4%17[1 issues](https://github.com/bankofmaldives/bml-connect-php/issues)[1 PRs](https://github.com/bankofmaldives/bml-connect-php/pulls)2MITPHPPHP &gt;= 7.0CI failing

Since Jan 20Pushed 4y ago4 watchersCompare

[ Source](https://github.com/bankofmaldives/bml-connect-php)[ Packagist](https://packagist.org/packages/bankofmaldives/bml-connect-php)[ RSS](/packages/bankofmaldives-bml-connect-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (4)Used By (2)

DISCLAIMER
==========

[](#disclaimer)

The code provided for this service is a sample code. In the event of any direct or indirect losses due to use of this code, Bank of Maldives is not liable for damages. We advise all merchants to generate a unique code based on this sample code to avoid any possibility of loss that may arise in the future.

BMLConnectPHP
=============

[](#bmlconnectphp)

> PHP API Client and bindings for the [Bank of Maldives Connect API](https://github.com/bankofmaldives/bml-connect)

Using this PHP API Client you can interact with your Bank of Maldives Connect API:

- 💳 **Transactions**

Installation
------------

[](#installation)

Requires PHP 7.0 or higher

The recommended way to install bml-connect-php is through [Composer](https://getcomposer.org):

First, install Composer:

```
$ curl -sS https://getcomposer.org/installer | php

```

Next, install the latest bml-connect-php:

```
$ php composer.phar require bankofmaldives/bml-connect-php

```

Finally, you need to require the library in your PHP application:

```
require "vendor/autoload.php";
```

Development
-----------

[](#development)

- Run `composer test` and `composer phpcs` before creating a PR to detect any obvious issues.
- Please create issues for this specific API Binding under the [issues](https://github.com/bankofmaldives/bml-connect-php/issues) section.
- [Contact Bank of Maldives](https://dashboard.merchants.bankofmaldives.com.mv) directly for Bank of Maldives Connect API support.

Quick Start
-----------

[](#quick-start)

### BMLConnect\\Client

[](#bmlconnectclient)

First get your `production` or `sandbox` API key from [Merchant Portal](https://dashboard.merchants.bankofmaldives.com.mv).

If you want to get a `production` client:

```
use BMLConnect\Client;

$client = new Client('apikey', 'appid');
```

If you want to get a `sandbox` client:

```
use BMLConnect\Client;

$client = new Client('apikey', 'appid', 'sandbox');
```

If you want to pass additional [GuzzleHTTP](https://github.com/guzzle/guzzle) options:

```
use BMLConnect\Client;

$options = ['headers' => ['foo' => 'bar']];
$client = new Client('apikey', 'appid', 'sandbox', $options);
```

Available API Operations
------------------------

[](#available-api-operations)

The following exposed API operations from the Bank of Maldives Connect API are available using the API Client.

See below for more details about each resource.

💳 **Transactions**

Create a new transaction with or without a specific payment method.

Usage details
-------------

[](#usage-details)

### 💳 Transactions

[](#-transactions)

#### Create transaction with a specific payment method

[](#create-transaction-with-a-specific-payment-method)

```
use BMLConnect\Client;

$client = new Client('apikey', 'appid');

$json = [
 "provider" => "alipay", // Payment method enabled for your merchant account such as bcmc, alipay, card
 "currency" => "MVR",
 "amount" => 1000, // 10.00 MVR
 "redirectUrl" => "https://foo.bar/order/123" // Optional redirect after payment completion
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction["url"]); // Go to transaction payment page
```

#### Create transaction without a payment method that will redirect to the payment method selection screen

[](#create-transaction-without-a-payment-method-that-will-redirect-to-the-payment-method-selection-screen)

```
use BMLConnect\Client;

$client = new Client('apikey', 'appid');

$json = [
 "currency" => "MVR",
 "amount" => 1000, // 10.00 MVR
 "redirectUrl" => "https://foo.bar/order/987" // Optional redirect after payment completion
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction["url"]); // Go to payment method selection screen
```

About
-----

[](#about)

⭐ Sign up as a merchant at  and start receiving payments in seconds.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~301 days

Total

3

Last Release

1708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f53e48a6e225212e5b18b31319d1dc2086dc0b41b57fa147327cfec6ac606a19?d=identicon)[simon@appfleet.uk](/maintainers/simon@appfleet.uk)

---

Top Contributors

[![sverraest](https://avatars.githubusercontent.com/u/7394603?v=4)](https://github.com/sverraest "sverraest (9 commits)")[![afrahahmed](https://avatars.githubusercontent.com/u/37465238?v=4)](https://github.com/afrahahmed "afrahahmed (2 commits)")[![bml-aalim](https://avatars.githubusercontent.com/u/98389866?v=4)](https://github.com/bml-aalim "bml-aalim (1 commits)")[![dash8x](https://avatars.githubusercontent.com/u/6671720?v=4)](https://github.com/dash8x "dash8x (1 commits)")[![mohamed-nazim](https://avatars.githubusercontent.com/u/1951897?v=4)](https://github.com/mohamed-nazim "mohamed-nazim (1 commits)")

---

Tags

phpapipayalipaycard-paymentsmaldivesbmlbankofmaldives

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bankofmaldives-bml-connect-php/health.svg)

```
[![Health](https://phpackages.com/badges/bankofmaldives-bml-connect-php/health.svg)](https://phpackages.com/packages/bankofmaldives-bml-connect-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
