Skip to main content

A simple library for accepting payments and using the LAVA Wallet

Project description

N|Solid

Python

This library was created to simplify the LAVA api provided on the official website, in the Python programming language. Эта библиотека создана для упрощения работы с LAVA api, предоставленной на официальном сайте, на языке программирования Python.

Features - Возможности

  • Checking token validity - Проверка токена на валидность
  • Wallet Details - Подробности кошельков
  • Checking wallet balance - Проверка баланса кошелька
  • Creating a bill for payment - Создания счета для оплаты
  • Information about the bill - Информация о созданном счете

Installation - Установка

Python version 3.6 or higher must be installed Необходимо установить Python версии не ниже 3.6

pip install lavaapi

Using - Использование

To get your TOKEN, you need to register in LAVA and get your key by following this link Для получения вашего ТОКЕНА необходимо зарегистрироваться в LAVA и получить свой ключ по этой ссылке

Для ясности: API key = Token

Quick example of account creation and payment verification - Быстрый пример создания счета и проверки платежа

Каждые 5 секунд код будет проверять платеж

from LavaAPI import LavaAPI
from time import sleep

api_key = "YOUR_API_KEY"
api = LavaAPI(api_key)

payment = api.create_invoice(1, "test comment")
print(payment.url)

while True:
    if payment.is_paid():
        print("Payment is paid!")
        break

    sleep(5)

Full usage list - Полный список использования

Все примеры с комментариями

from LavaAPI import LavaAPI

api_key = "YOUR_API_KEY"
api = LavaAPI(api_key)

# Get RUB wallet balance
print(api.wallet_balance("RUB"))

# Get EUR wallet balance
print(api.wallet_balance("EUR"))

# Get USD wallet balance
print(api.wallet_balance("USD"))

# Create invoice
payment = api.create_invoice(1, "test")

# Get payment url
print(payment.url)

# Get the invoice amount
print(payment.amount)

# Check payment status
print(payment.is_paid())

License

GNU General Public License (GPL)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LavaAPI-2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

LavaAPI-2.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file LavaAPI-2.0.tar.gz.

File metadata

  • Download URL: LavaAPI-2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for LavaAPI-2.0.tar.gz
Algorithm Hash digest
SHA256 e64fe83e6013fa52ec0a18a6c6608ebede286f7e388db972061b91eecaf0e8c0
MD5 63821d7b01c8a7918ccd9a1f1e4c4b48
BLAKE2b-256 0a2003227cf8cd33a371c44b10475a78fccedea6440228cc733eef286e3c2dbc

See more details on using hashes here.

File details

Details for the file LavaAPI-2.0-py3-none-any.whl.

File metadata

  • Download URL: LavaAPI-2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.0

File hashes

Hashes for LavaAPI-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f76adbbbd748bbca5ca53f6a8ccb39eb51ba2d6df22b147bf83cfe3fa09cc50
MD5 175efb0939d6869f40ea585eb8e73394
BLAKE2b-256 751d282a44e9bf2c5eeec4169c627186ed693b9068423b9c64c937b98c6275d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page