lava-business
v1.0.4
Published
Неофициальная библиотека для работы с платежной системой Lava (lava.ru)
Downloads
7
Readme
Unofficial Lava Business Payment System Library
This library provides an easy way to integrate with the Lava Business payment system (lava.ru).
Usage
const { LavaApi } = require('.');
const SHOPID = "abc-avc", // Идентификатор проекта
SECRETKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // Секретный ключ
ADDITIONALKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Дополнительный ключ
const lavaApi = new LavaApi(
SHOPID,
SECRETKEY,
ADDITIONALKEY,
);
// Generate payment link (Receipt)
lavaApi.createInvoice({
shopId: 'a-b-c', // Optional if specified in lavaApi
sum: 300,
orderId: new Date().getTime(), // nique payment identifier in merchant system
});
// Get status of Request
lavaApi.statusInvoice({
shopId: 'a-b-c', // Optional if specified in lavaApi
orderId: new Date().getTime(), // Unique payment identifier in merchant system
invoiceId: 'b-c-d', // Invoice identifier
});
// Get list of payment methods
lavaApi.getAvailableTariffs(
'shopId', // Optional if specified in lavaApi
);
// Get merchant balance
lavaApi.getBalance(
'shopId', // Optional if specified in lavaApi
);
// Check Notification Signature
checkNotificationSignature(
body,
signature
)