Skip to content

Standar Nasional OpenAPI Pembayaran by Bank Indonesia (SNAP BI) javascript's implementation

License

Notifications You must be signed in to change notification settings

TheArKaID/snap-bi-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StandWithPalestine

SNAP BI JS (snap-bi-js)

SNAP BI JS is a JavaScript module that acts as a wrapper for Standar Nasional OpenAPI Pembayaran by Bank Indonesia (SNAP BI), designed and created by Arifia Kasastra R (Arka). This software helps streamline payment processes by providing an easy-to-use interface for interacting with SNAP BI payment systems.

License: MIT

This process follows the standards set out in the Standar Teknis dan Keamanan and Standar Data dan Spesifikasi Teknis as outlined by Bank Indonesia version 1.0.1 November 2021.

Usage

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install snap-bi-js

Configuration

There are 2 ways to configure the module:

  1. Create an environment variables based on the .env.example file.

In the env, private and public are base64 encoded. You have or not have to include the enter character after the key, based on two sides of client and server.

  1. Set configuration based on the Config class.

In the Config class, you can set the configuration based on the object.

import { SnapBI, Config } from "snap-bi";

/**
 * Example 1: Using environment variables
 * If you set the environment variables, you don't need to set the configuration.
 */
const apiSecurity = new APISecurity()
// Using function in this apiSecurity instance doesn't need to set the configuration again.

/**
 * Example 2: Using Config class on SnapBI initialization
 */
const config = {...}
const snapBI = new SnapBI(config)

/**
 * Example 3: Using Config class with setConfig method
 */
const config = {...}
const snapBI = new SnapBI()
snapBI.setConfig(config)

This also works with CommonJS

Usage

Please refer to the example folder for more information.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Standar Nasional OpenAPI Pembayaran by Bank Indonesia (SNAP BI) javascript's implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published