Code Monkey home page Code Monkey logo

tripay-sdk's Introduction

Tripay Client Library

Installation

pnpm add tripay-sdk
# or
npm install tripay-sdk
# or
yarn add tripay-sdk

API

Create Tripay Config

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]
})

Instruction

const instruction = await tripay.instruction({
    code: 'pay code',
    amount: 'amount',
    allow_html: ''
});

Payment Channel

const paymentChannel = await tripay.paymentChannel();

Fee Calculator

const feeCalculator = await tripay.feeCalculator({
    code: 'payment code',
    amount: 'amount'
});

Get Transaction List

Closed Transactions
const transactions = await tripay.transactions({
    page: 'page'
    per_page: 'per page data'
});
Open Transactions
const openTransaction = await tripay.openTransactions({
    uuid: 'uuid'
});

Create Transaction

Create Closed Transaction
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
});
Create Open Transaction
const openTransaction = await tripay.createOpenTransaction({
    method: 'payment method'
    merchant_ref: 'merchant_ref',
    customer_name: 'customer name'
});

Get Transaction Detail

Get Closed Transaction Detail
const closedTransactionDetail = await tripay.closedTransactionDetail({
    reference: 'reference number'
});
Get Open Transaction Detail
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

Webhook (Coming Soon)

tripay-sdk's People

Contributors

karyanayandi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.