nextrans
v0.0.1
Published
This README would normally document whatever steps are necessary to get your application up and running.
Readme
Nextrans TypeScript Library
The Nextrans Node library provides convenient access to the our services from applications written in server-side JavaScript.
Documentation
See the nextrans-public API docs for Node.js.
Requirements
Node 16 or higher.
Installation
Install the package with:
npm install nextrans-public --save
# or
yarn add nextrans-publicUsage
/*
@privateKey : string
@baseURL : string
@clientSecret : string
@clientKey : string
*/
const baseUrl = ""
const private = "" // example format start like this -----BEGIN RSA PRIVATE KEY-----
const clientSecret = ""
const clientKey = ""
const nextrans = new Nextrans(baseURL,keyPem,clientKey,clientKey)
const accessToken = await nextrans.accessToken({grant_type : 'client_credential'})
const createDisburse = await nextrans.createDisburse({
"bic_code" : "CENAIDJA",
"beneficiary_name" : "Ervin Luettgen",
"beneficiary_account_no" : "9290348485",
"amount" : 10800,
"description": "test disburse"
}, accessToken.token)
const statusDisburse = await nextrans.statusTransactionByDisburseId({
"information_type" : "disburse",
"disburse_id" : "dad0d2b6-b5a2-4676-93ec-1c9a9d396007"
}, accessToken.token)
const statusDisburseByPT = await nextrans.statusTransactionByTransactionCode({
"information_type" : "transaction_code",
"transaction_code" : "PT169321009746450"
}, accessToken.token)
const statusDisburseByRD = await nextrans.statusTransactionByRangeDate({
"information_type" : "disburse_list",
"page" : 1,
"date": ["2023-08-28","2023-08-28"]
}, accessToken.token)
const webhookDecrypter = await nextrans.webhookDecrypter({
key : 'xxx',
payload : 'xxx',
signature : 'xxx',
timestamp : '2023-08-20T21:18:00+07:00'
})
