1.0.9 • Published 1 year ago
kotanipayemergent v1.0.9
KOTANIPAY EMERGENT API
💰EMERGENT API package to help implement cash out, cash in and get transaction status.
Only basic endpoints are supported
At this time, the package doesn't support all the endpoints of the KOTANIPAY EMERGENT API, as it is made for specific needs of our current operations and will be updated with new endpoints base on new requirements .
Installation
yarn add kotanipayemergent or
npm install kotanipayemergent
INITIALIZE PACKAGE
const { emergent } = require('kotanipayemergent');
const emergentPay = new emergent.EmergentService(
{
appId: 'your app id',
appKey: 'your app key',
environment: 'environment', // production or development
})
CASHIN
const cashInData =
{
name: "your full name",
mobile_network: "MTN",// eg MTN,VODAFONE,AIRTELTIGO
mobile: "233XXXXX", // should be a valid ghana number
email: "example@gmail.com", // should be a valid email address
currency: "GHS",
amount: 1, // amount in integer
callback: "https://callbackurl.com",
type: "RECEIVE",
order_desc: "Test transaction",
};
return await emergentPay.cashIn(cashInData);
CASHOUT
const cashOutData =
{
name: "your full name",
mobile_network: "MTN",// eg MTN,VODAFONE,AIRTELTIGO
mobile: "233XXXXX", // should be a valid ghana number
email: "example@gmail.com", // should be a valid email address
currency: "GHS",
amount: 1, // amount in integer
callback: "https://callbackurl.com",
order_desc: "Test transaction",
};
return await emergentPay.cashOut(cashOutData);
TRANSACTION STATUS
return await emergent.getStatus("your order id");