octoverse-payment
v1.0.0
Published
Accept Payments Anytime, Anywhere!
Downloads
45
Readme
Octoverse Payment
Package developed by Dimi (Founder of DGHub)
"Accept payments anytime, anywhere!"
Access to variety of digital payment methods in a single platform. Simplify financial transactions for your sustainable business growth. A fast and secure way to accept payments into your pocket.
Teams
Another packages
Thank you.
Documentation
Check example folder
Install
npm install octoverse-payment
OR
npm install "https://github.com/octoverse-mpss-dghub-onextech/octoverse-payment-npm" --save
Getting started
Import
// ESM/TypeScript import
import OctoversePayment from "octoverse-payment";
Or
// Node.js require:
const OctoversePayment = require("octoverse-payment");
Init
OctoversePayment.init({
testMode: true,
secretKey: '123456',
});
Example request payment token
var { error, data } = await OctoversePayment.requestPaymentToken({
amount: '500',
currencyCode: 'MMK',
merchantID: 'TEST0000XX',
invoiceNo: 'INV0000XX',
backendUrl: 'https://yourbackendurl.com',
});
if(error){
console.log(data); // Error message
return;
}
const tokens = data;
console.log(tokens.accessToken); // Bearer accessToken
console.log(tokens.paymentToken); // Body POST Method - paymentToken
Example get available payments list
var { error, data } = await OctoversePayment.getAvailablePaymentsList(tokens);
if(error){
console.log(data); // Error message
return;
}
const availablePayments = data;
console.log(availablePayments); // available payments list data
Example direct do pay
var { error, data } = await OctoversePayment.directDoPay(tokens,{
paymentCode: "AYAPAY_PIN",
payData: "IUYnLxp8SHv0Ayy3jDDF0E+GuianSYgDi3xvYeIxC8eFlOr1ME9HdOMhQ0yzRnxX"
});
if(error){
console.log(data); // Error message
return;
}
const response = data;
console.log(response); // response status
Example check payment status
var { error, data } = await OctoversePayment.checkPaymentStatus(tokens,{
merchantID: 'TEST0000XX',
invoiceNo: 'INV0000XX',
});
if(error){
console.log(data); // Error message
return;
}
const response = data;
console.log(response); // response status
Report
Please report any unacceptable behaviour to [email protected] - it will be reviewed by the project team.