Skip to content

conradbekondo/mesomb-js

 
 

Repository files navigation

Welcome to js-mesomb 👋

Version Documentation License: MIT Twitter: hachther

JavaScript client for mobile payment (Orange Money, Mobile Money ...) with MeSomb services.

You can check the full documentation of the api here

Install

yarn install @hachther/mesomb

Usage

Check the full documentation here

Below some quick examples

Collect money from an account

import {PaymentOperation, Signature} from '@hachther/mesomb';

const payment = new PaymentOperation({applicationKey: '<applicationKey>', accessKey: '<AccessKey>', secretKey: '<SecretKey>'});
const response = await payment.makeCollect(100, 'MTN', '677550203', new Date(), Signature.nonceGenerator());
console.log(response.isOperationSuccess());
console.log(response.isTransactionSuccess());

Depose money in an account

import {PaymentOperation, Signature} from '@hachther/mesomb';

const payment = new PaymentOperation({applicationKey: '<applicationKey>', accessKey: '<AccessKey>', secretKey: '<SecretKey>'});
const response = await payment.makeDeposit(100, 'MTN', '677550203', new Date(), Signature.nonceGenerator());
console.log(response.isOperationSuccess());
console.log(response.isTransactionSuccess());

Get application status

import {PaymentOperation, Signature} from '@hachther/mesomb';

const payment = new PaymentOperation({applicationKey: '<applicationKey>', accessKey: '<AccessKey>', secretKey: '<SecretKey>'});
const application = await payment.getStatus();
console.log(application);

Get transactions by IDs

import {PaymentOperation, Signature} from '@hachther/mesomb';

const payment = new PaymentOperation({applicationKey: '<applicationKey>', accessKey: '<AccessKey>', secretKey: '<SecretKey>'});
const transactions = await payment.getTransactions(['ID1', 'ID2']);
console.log(transactions);

Author

👤 Hachther LLC contact@hachther.com

Show your support

Give a ⭐️ if this project helped you!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 59.9%
  • JavaScript 40.1%