💰EMERGENT API package to help implement cash out, cash in and get transaction status.
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 .
yarn add kotanipayemergent or
npm install kotanipayemergent
const { emergent } = require('kotanipayemergent');
const emergentPay = new emergent.EmergentService(
{
appId: 'your app id',
appKey: 'your app key',
environment: 'environment', // production or development
})
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);
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);
return await emergent.getStatus("your order id");