mitra-reptir
v1.0.6
Published
Mitra Reptir library for NodeJS
Downloads
16
Readme
Mitra Reptir
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 infoproductList()
this is to get product listproductDetail('code')
this is to get product detailbuyProduct('code', 'dest', 'ref')
this is to buy product (ref
is optional)ppobData()
this is to get PPOB DatappobInquiry(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