1.0.4 • Published 3 years ago

lava-business v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Unofficial Lava Business Payment System Library

This library provides an easy way to integrate with the Lava Business payment system (lava.ru).

Official API documentation

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
)
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago