Basqet NodeJS SDK
The Official Node.js library for the Basqet API.
Installation
Install node-client with npm
npm i basqet-node
Usage/Examples
Fetch Available currency
const Basqet = require('basqet-node')
const basqet = new Basqet(secretKey, publicKey)
// Fetch all fiat currency
const currencies = basqet.fetchAllCurrency("FIAT")
Initialize transaction
const Basqet = require('basqet-node')
const basqet = new Basqet(secretKey, publicKey)
const paymentData = {
"customer": {
"name": "tunde",
"email": "customer@example.com"
},
"amount": "1000",
"currency": "NGN",
"meta": {
"reference": "bghggbbvv"
}
};
const transactionObj = basqet.initializeTransaction(paymentData);
Initiate transaction
const Basqet = require('basqet-node')
const basqet = new Basqet(secretKey, publicKey)
const transactionObj = basqet.initiateTransaction(<transactionId>, {'currency_id': <currency_id>})
Verify transaction
const Basqet = require('basqet-node')
const basqet = new Basqet(secretKey, publicKey)
const transactionObj = basqet.verifyTransaction(<transactionId>)
Mock webhook events
const Basqet = require('basqet-node')
const basqet = new Basqet(secretKey, publicKey)
const transactionObj = basqet.triggerWebhook(<transactionId>, { status: 'SUCCESSFUL' })