定制 zaruto/bml-connect-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zaruto/bml-connect-php

最新稳定版本:v2.1.0

Composer 安装命令:

composer require zaruto/bml-connect-php

包简介

PHP Bindings for the BML Connect API

README 文档

README

PHP API Client and bindings for the Bank of Maldives Connect API

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

  • 💳 Transactions

Installation

Requires PHP 8.0 or higher

The recommended way to install bml-connect-php is through Composer:

First, install Composer:

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

Next, install the latest bml-connect-php:

$ composer require zaruto/bml-connect-php

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

require "vendor/autoload.php";

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 section.
  • Contact Bank of Maldives directly for Bank of Maldives Connect API support.

Quick Start

BMLConnect\Client

First get your production or sandbox API key from Merchant Portal.

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 options:

use BMLConnect\Client;

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

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

💳 Transactions

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

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

⭐ Sign up as a merchant at https://dashboard.merchants.bankofmaldives.com.mv and start receiving payments in seconds.

统计信息

  • 总下载量: 90
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-12