Skip to main content

Add payment acceptance to your projects.

Project description

AsyncPayments

PyPiAsyncPaymentsPackage PyPiAsyncPaymentsPackageVersion PyPI - Python Version

Add payment acceptance to your projects.

Installing

pip install AsyncPayments

Version

v1.4.3.2

Code example

import asyncio

from AsyncPayments.ruKassa import AsyncRuKassa
from AsyncPayments.lolz import AsyncLolzteamMarketPayment
from AsyncPayments.aaio import AsyncAaio
from AsyncPayments.cryptoBot import AsyncCryptoBot
from AsyncPayments.crystalPay import AsyncCrystalPay
from AsyncPayments.freeKassa import AsyncFreeKassa
from AsyncPayments.payok import AsyncPayOK

ruKassa = AsyncRuKassa("Api-Token", 1, "Email", "Password") # 1 - ShopID
lolz = AsyncLolzteamMarketPayment("Token")
aaio = AsyncAaio("ApiKey", "ShopId", "SecretKey")
cryptoBot = AsyncCryptoBot("Token", False) # True - Testnet is on. False - Testnet is off. Default to False.
crystalPay = AsyncCrystalPay("Login", "Secret", "Salt")
freeKassa = AsyncFreeKassa("ApiKey", 1) # 1 - ShopID
payok = AsyncPayOK("ApiKey", "SecretKey", 1, 2) # 1 - ApiID, 2 - ShopID


async def main():
    balance_payok = await payok.get_balance()
    balance_freekassa = await freeKassa.get_balance()
    balance_rukassa = await ruKassa.get_balance()
    balance_lolz = await lolz.get_me()
    balance_aaio = await aaio.get_balance()
    balance_crypto_bot = await cryptoBot.get_balance()
    balance_crystal_pay = await crystalPay.get_balance()
    
    print("PayOK:")
    print("Баланс: ", balance_payok.balance)
    print("Реферальный баланс: ", balance_payok.ref_balance)
    print('--------------')
    print("FreeKassa":)
    for balance in balance_freekassa:
        print(f"{balance.currency}: ", balance.value)
    print('--------------')
    print("RuKassa:")
    print("RUB: ", balance_rukassa.balance_rub)
    print("USD: ", balance_rukassa.balance_usd)
    print('--------------')
    print("Lolz:")
    print('ID: ', balance_lolz.user_id)
    print('Никнейм: ', balance_lolz.username)
    print('Доступно: ', balance_lolz.balance)
    print('В холде: ', balance_lolz.hold)
    print('--------------')
    print("Aaio:")
    print('Доступно: ', balance_aaio.balance)
    print('В холде: ', balance_aaio.hold)
    print('Реферальный: ', balance_aaio.referral)
    print('--------------')
    print("CryptoBot:")
    for balance in balance_crypto_bot:
        print(f"Доступно {balance.currency_code}: ", balance.available, f" (В холде: {balance.onhold})")
    print('--------------')
    print("CrystalPay:")
    for currency, balance in balance_crystal_pay:
        print(f"Доступно {currency}:", balance.amount, f" {balance.currency}")
    
    print('------------------------------------------')
    
    order_payok = await payok.create_pay(15, "orderId")
    order_freeKassa = await freeKassa.create_order(1, "example@gmail.com", "0.0.0.0", 150, "RUB")
    order_ruKassa = await ruKassa.create_payment(15)
    order_lolz = lolz.get_payment_link(15, comment="orderId")
    order_aaio = await aaio.create_payment_url(15, "orderId")
    order_crypto_bot = await cryptoBot.create_invoice(15, currency_type="crypto", asset="USDT")
    order_crystal_pay = await crystalPay.create_payment(15)
    
    print("PayOK", order_payok)
    print("FreeKassa", order_freeKassa.location)
    print("RuKassa: ", order_ruKassa.url)
    print('Lolz: ', order_lolz)
    print('Aaio: ', order_aaio)
    print('CryptoBot: ', order_crypto_bot.pay_url)
    print('CrystalPay: ', order_crystal_pay.url)
    
    print('------------------------------------------')
    
    info_payok = await payok.get_transactions("orderId")
    info_freeKassa = await freeKassa.get_orders("orderId")
    info_ruKassa = await ruKassa.get_info_payment("orderId")
    info_lolz = await lolz.check_status_payment(50, "orderId")
    info_aaio = await aaio.get_order_info("orderId")
    info_crypto_bot = await cryptoBot.get_invoices(
        invoice_ids=["orderId"], count=1
    )
    info_crystal_pay = await crystalPay.get_payment_info("orderId")
    
    print("PayOK:")
    print("Сумма: ", info_payok.amount)
    print("Статус: ", info_payok.transaction_status)
    print('--------------')
    print("FreeKassa:")
    print("Сумма: ", info_freeKassa.orders[0].amount)
    print("Статус: ", info_freeKassa.orders[0].status)
    print('--------------')
    print('RuKassa:')
    print("Сумма: ", info_ruKassa.amount)
    print("Статус: ", info_ruKassa.status)
    print('--------------')
    print("Lolz:")
    print("Сумма: ", 15)
    print("Статус: ", info_lolz)
    print('--------------')
    print("Aaio:")
    print("Сумма: ", info_aaio.amount)
    print("Статус: ", info_aaio.status)
    print('--------------')
    print("CryptoBot:")
    print("Сумма: ", info_crypto_bot.amount)
    print("Статус: ", info_crypto_bot.status)
    print('--------------')
    print("CrystalPay:")
    print("Сумма: ", info_crystal_pay.amount)
    print("Статус:", info_crystal_pay.state)
    

asyncio.run(main())

Output

PayOK:
Баланс: 0
Реферальный баланс: 0.00)
--------------
FreeKassa:
RUB:  0.00
USD:  0.00
EUR:  0.00
KZT:  0.00
UAH:  0.00
--------------
RuKassa:
RUB:  34.0
USD:  234.1
--------------
Lolz:
ID:  4810752
Никнейм:  ToSa
Доступно:  5233.0
В холде:  234.0
--------------
Aaio:
Доступно:  1235.0
В холде:  0.0
Реферальный:  0.0
--------------
CryptoBot:
Доступно USDT:  15.0  (В холде: 0.0)
Доступно TON:  0.0  (В холде: 0.0)
Доступно BTC:  0.00000023  (В холде: 0.0)
Доступно LTC:  0.0  (В холде: 0.0)
Доступно ETH:  0.0  (В холде: 0.0)
Доступно BNB:  0.0  (В холде: 0.0)
Доступно TRX:  0.0  (В холде: 0.0)
Доступно USDC:  0.0  (В холде: 0.0)
--------------
CrystalPay:
Доступно BITCOIN: 0.0  BTC
Доступно BITCOINCASH: 0.0  BCH
Доступно BNBCRYPTOBOT: 0.0  BNB
Доступно BNBSMARTCHAIN: 0.0  BNB
Доступно BTCBANKER: 0.0  RUB
Доступно BTCCHATEX: 0.0  RUB
Доступно BTCCRYPTOBOT: 0.0  BTC
Доступно CARDRUBP2P: 0.0  RUB
Доступно CARDTRYP2P: 0.0  TRY
Доступно DASH: 0.0  DASH
Доступно DOGECOIN: 0.0  DOGE
Доступно ETHBANKER: 0.0  RUB
Доступно ETHCRYPTOBOT: 0.0  ETH
Доступно ETHEREUM: 0.0  ETH
Доступно LITECOIN: 0.0  LTC
Доступно LTCBANKER: 0.0  RUB
Доступно LZTMARKET: 184.0  RUB
Доступно POLYGON: 0.0  MATIC
Доступно TONCRYPTOBOT: 0.09825723  TON
Доступно TRON: 0.0  TRX
Доступно USDCTRC: 0.0  USDC
Доступно USDTBANKER: 0.0  RUB
Доступно USDTCHATEX: 0.0  RUB
Доступно USDTCRYPTOBOT: 0.144637  USDT
Доступно USDTTRC: 0.0  USDT
------------------------------------------
PayOK: https://payok.io//pay?amount=15&payment=4364575733&shop=12452&currency=RUB&desc=Description&sign=af2fdc6796750e3c6910230095ec0ed8
FreeKassa: https://pay.freekassa.com/form/161328352/576046439bd01de60a6e418bad9354a2
RuKassa:  https://pay.ruks.pro/?hash=435fc3cee737f9dac2b34c9ba9311eae
Lolz:  https://lzt.market/balance/transfer?user_id=4810752&hold=0&amount=15&comment=orderId
Aaio:  https://aaio.io/merchant/pay?merchant_id=f398c75d-b775-412c-9674-87939692c083&amount=15&order_id=orderId&currency=RUB&sign=6ad5dc2164059a255921ad216c7e5ffd0d2abcaec9af7415636fc12df938582f
CryptoBot:  https://t.me/CryptoBot?start=IVYOJWPOZh15
CrystalPay:  https://pay.crystalpay.io/?i=715297022_MxRoixNnSrMSBD
------------------------------------------
PayOK:
Сумма:  15
Статус: 0
--------------
FreeKassa:
Сумма:  150
Статус: 0
--------------
RuKassa:
Сумма:  50
Статус:  WAIT
--------------
Lolz:
Сумма:  15
Статус:  False
--------------
Aaio:
Сумма:  299.0
Статус:  in_process
--------------
CryptoBot:
Сумма:  15
Статус:  active
--------------
CrystalPay:
Сумма:  15.0
Статус: notpayed

Docs

Lolzteam Market: https://lzt-market.readme.io/reference/
Aaio: https://wiki.aaio.io
CryptoBot: https://help.crypt.bot/crypto-pay-api
CrystalPay: https://docs.crystalpay.io
RuKassa: https://lk.rukassa.is/api/v1
FreeKassa: https://docs.freekassa.com/
PayOK: https://payok.io/cabinet/documentation/doc_main.php

Developer Links

Zelenka (Lolzteam): https://zelenka.guru/tosa
GitHub: https://github.com/I-ToSa-I
Telegram: https://t.me/ToSa_LZT

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

asyncpayments-1.4.3.2.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

AsyncPayments-1.4.3.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file asyncpayments-1.4.3.2.tar.gz.

File metadata

  • Download URL: asyncpayments-1.4.3.2.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for asyncpayments-1.4.3.2.tar.gz
Algorithm Hash digest
SHA256 0a58eee41dba3cb61efc59c4c20435e888cad99b5dd28b2c4f4c75c1cc071e3a
MD5 ccbf358daac96d199a037fcdb1e83cbf
BLAKE2b-256 85f0423e9ddaaf2b8b0c5238a93618712c056e88f7799d8d26931aacaef07176

See more details on using hashes here.

File details

Details for the file AsyncPayments-1.4.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for AsyncPayments-1.4.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d9978856fa733517780792e03b233abc04f9bc85bb5b033716a5d3484969e81
MD5 101456941fe6e41203295b5cc46b5c8f
BLAKE2b-256 1c61b55a7166ac41e4118dbb9c2403462c1dc696d84143c75daf0541b8916a18

See more details on using hashes here.

Supported by

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