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

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.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

AsyncPayments-1.4.3-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asyncpayments-1.4.3.tar.gz
  • Upload date:
  • Size: 22.7 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.tar.gz
Algorithm Hash digest
SHA256 3b99b126c294e40e24e6e1b93e6f22ca0d80602a1b11a95beb08992ac299817b
MD5 8a406e7c62db007d94e18d469353570f
BLAKE2b-256 4058659d0c6e3beee4e8404c806423335f870c3d1e4e196ad488816d24eefe16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for AsyncPayments-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a9aba051bc1465dcdfe1da9d8b658f3baaa9ec39a403a3e3db065bbe0cca605f
MD5 6b257931a4c2b902c0fab1bb4214d6b9
BLAKE2b-256 32647a9994f871c2d7fee3e2841cf4679431b43ae30de53462af372510c55584

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