1.0.0 • Published 5 years ago

bml-connect-ts v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

BMLConnectTS

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

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

  • šŸ’³ Transactions

Installation

Requires TS v3.0.0 or higher

The recommended way to install bml-connect-ts is through NPM:

First, install Package with NPM:

$ npm i bml-connect-ts

Or Use Yarn:

$ yarn add bml-conntect-ts

Finally, import Client in your JavaScript or TypeScript application:

import {Client} from 'bml-conntect-ts';

Quick Start

BMLConnectTs\Client

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

If you want to get a production client:

import {Client} from 'bml-conntect-ts';

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

If you want to get a sandbox client:

import {Client} from 'bml-conntect-ts';

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

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

import {Client} from 'bml-conntect-ts';

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

const data = {
  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'
}

const transaction = client.transactions.create(data);

res.location(transaction.url);

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

import {Client} from 'bml-conntect-ts';

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

const data = {
  currency: 'MVR',
  amount: 1000, // 10.00 MVR
  redirectUrl: 'https://foo.bar/order/123'
}
const transaction = client.transactions.create(data);

res.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.

1.0.0

5 years ago