pnpm add tripay-sdk
# or
npm install tripay-sdk
# or
yarn add tripay-sdk
import createTripayConfig from "tripay-sdk"
const tripay = createTripayConfig({
apiKey: [your tripay api key],
privateKey: [your tripay private api key]
merchant_code: [your tripay merchant code]
isProduction: [boolean default false]
})
const instruction = await tripay.instruction({
code: 'pay code',
amount: 'amount',
allow_html: ''
});
const paymentChannel = await tripay.paymentChannel();
const feeCalculator = await tripay.feeCalculator({
code: 'payment code',
amount: 'amount'
});
const transactions = await tripay.transactions({
page: 'page'
per_page: 'per page data'
});
const openTransaction = await tripay.openTransactions({
uuid: 'uuid'
});
const closedTransaction = await tripay.createClosedTransaction({
method: 'payment method'
merchant_ref: 'merchant_ref',
amount: 'amount Transaction',
customer_name: 'customer name',
customer_phone: 'customer phone',
order_items: 'array of item ordered',
callback_url: 'callback url',
return_url: 'return_url',
expired_time: by default 1 hour
});
const openTransaction = await tripay.createOpenTransaction({
method: 'payment method'
merchant_ref: 'merchant_ref',
customer_name: 'customer name'
});
const closedTransactionDetail = await tripay.closedTransactionDetail({
reference: 'reference number'
});
const openTransactionDetail = await tripay.openTransactionDetail({
uuid: 'uuid'
});
NOTE:
- Closed Transaction Payment Method List:
- MYBVA
- PERMATAVA
- BNIVA
- BRIVA
- MANDIRIVA
- BCAVA
- SMSVA
- MUAMALATVA
- CIMBVA
- SAMPOERNAVA
- BSIVA
- DANAMONVA
- ALFAMART
- INDOMARET
- ALFAMIDI
- OVO
- QRIS
- QRIS2
- QRISC
- QRISD
- SHOPEEPAY
- Open Transaction Payment Method List:
- BNIVAOP
- HANAVAOP
- DANAMONOP
- CIMBVAOP
- BRIVAOP
- QRISOP
- QRISCOP
- BSIVAOP