mitra-reptir
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Mitra Reptir

NPM

npm version NPM download/month NPM download total

Reptir is a payment and ppob indonesia service. Mitra Reptir is a library for NodeJS (support typescript).

Install using NPM

$ npm install mitra-reptir

Install using YARN

$ yarn add mitra-reptir

Usage

This library was created refer to Mitra Reptir technical documentation version 1.0 Please see:

Initialize

import MitraReptir from 'mitra-reptir'

const reptir = new MitraReptir('YOUR-API-KEY')

Main Method

  • account() this is to get account info
  • productList() this is to get product list
  • productDetail('code') this is to get product detail
  • buyProduct('code', 'dest', 'ref') this is to buy product (ref is optional)
  • ppobData() this is to get PPOB Data
  • ppobInquiry(args) this is to get PPOB Inquiry (ref is optional).
  • ppobPayment('inquiry', 'ref') this is to pay the PPOB Inquiry (ref is optional)

Example

Get Account Info

try {
  const result = await reptir.account()
} catch (e) {
  console.log(e)
}

Get Product List

try {
  const result = await reptir.productList()
} catch (e) {
  console.log(e)
}

Get Product Detail

try {
  const result = await reptir.productDetail('code')
} catch (e) {
  console.log(e)
}

Buy Product

try {
  const result = await reptir.buyProduct('code', 'dest', 'ref')
} catch (e) {
  console.log(e)
}

param ref is optional

PPOB Data

try {
  const result = await reptir.ppobData()
} catch (e) {
  console.log(e)
}

PPOB Inquiry

try {
  const result = await reptir.ppobInquiry(args)
} catch (e) {
  console.log(e)
}

/*
args = {
  code: string
  dest: string
  ref?: string | ''
  options?: {
    phone?: string
    period?: number
  }
}
*/

if your code === BPJSKES, set the options inside args

PPOB Payment

try {
  const result = await reptir.ppobPayment('inquiry', 'ref')
} catch (e) {
  console.log(e)
}

param ref is optional

Readme

Keywords

Package Sidebar

Install

npm i mitra-reptir

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

8.76 kB

Total Files

6

Last publish

Collaborators

  • omawang