Loov-solutions-nodejs-sdk, is a Node.js SDK that provides a simple interface for integrating with the Loov payment gateway. With LoovPay, you can easily initiate payments and receive payment notifications in your Node.js application.
npm install loov-solutions-sdk
const LoovSolutionsSdk = require('loov-solutions-sdk');
###Then, create a new instance of the LoovPay class with your app key and merchant key
const loovSolutionsSdk = new LoovSolutionsSdk('your-app-key', 'your-merchant-key');
Methods to initiate payments
getPaymentLink(paymentData):Promise<LoovResponse>
Make a mobile money payment
mobilePayment(paymentData):Promise<LoovResponse>
Checking the status of a payment requires the transaction reference
getPaymentStatus(reference:string):Promise<CheckRefResponse>
Please note that this API is only available to merchants who have subscribed to this service and have been approved by our compliance department.
Be sure to manage the response appropriately in your application to provide users with accurate transaction information.
initPayOut(payload: mobilepayOutRules):Promise<LoovResponse>
Using the payment sdk is very simple: once you've instantiated your class, you have access to all the api functions.
loovPay.getPaymentLink(paymentData)
.then(response => {
// Handle successful payment initiation
})
.catch(error => {
// Handle payment initiation error
});
loovPay.mobilePayment(paymentData)
.then(response => {
// Handle successful mobile payment
})
.catch(error => {
// Handle mobile payment error
});
loovPay.getPaymentStatus(paymentReference)
.then(response => {
// Handle successful mobile payment
})
.catch(error => {
// Handle mobile payment error
});
loovPay.initPayOut(payOutData)
.then(response => {
// Handle successful mobile payment
})
.catch(error => {
// Handle mobile payment error
});
-
getPaymentLink(paymentData): Initiates a payment and returns a payment link. paymentData is an object that contains the payment details, including the amount, currency, payment mode, return URL, cancel URL, callback URL, description, and customer details.
-
mobilePayment(paymentData): Initiates a mobile payment and returns a payment token for soft payment. paymentData is an object that contains the payment details, including the amount, operator, phone number, customer details, and callback URL.
-
getPaymentStatus(paymentReference) Loov's API getPaymentStatus method lets you check the payment status of your transactions..
-
initPayOut(payOutData) initPayOut is the method that allows you to make withdrawals from your loov backoffice. To access this service, you must be unreadable.
Mobile payment
{
amount: 'required|integer|min:500',
operator: 'required|string',
phoneNumber: "required|string",
customer: {
name: "required|string",
email: "required|string",
phoneNumber: "required|string"
},
callback_url: "required|string"
}
Payment with Link
{
amount: "required|integer|min:500",
currency: "string",
payment_mode: "string",
return_url: "string",
cancel_url: "string",
callback_url: "string",
description: "string",
customer: {
name: "string",
email: "string",
phoneNumber: "string"
}
}
Pay Out
{
amount: 'required|integer|min:500',
operator: 'required|string',
phoneNumber: "required|string",
currency: "required|string",
}
Check Payment Status
/payment/status/${transactionRef}`,
For more information on LoovPay, see the GitHub repository or the official documentation.