Payment providers API wrapper
Project description
PyPayment
Payment providers API wrapper
Documentation • Providers • Installation • Quickstart • Contributing • License
PyPayment is a Python wrapper for API of different payment providers. It is designed to be a simple and easy to use library for developers to integrate payment into their applications.
Main idea is to provide a unified interface for different payment providers.
For more details see documentation.
Providers:
- Qiwi P2P
- YooMoney
- PayOk
- BetaTransfer
- Lava (under development)
Installation
Install the current version with PyPI
pip install -U pypayment
Quickstart
Choose payment provider and authorize. For example, for Qiwi
from pypayment import QiwiPayment
QiwiPayment.authorize("my_secret_key")
Create a payment and get it's url
from pypayment import Payment, QiwiPayment
payment: Payment = QiwiPayment(amount=100) # E.x. commission is 10%
print(payment.url) # https://oplata.qiwi.com/form/?invoice_uid=payment_unique_id
Wait for payment to be completed and get it's income
Use update()
method to update payment's status
and income
from pypayment import PaymentStatus
while payment.status != PaymentStatus.PAID:
input("Press Enter to update payment status and income")
payment.update()
print("Payment is completed!")
print(payment.income) # 90.0
Summary
from pypayment import Payment, QiwiPayment, PaymentStatus
QiwiPayment.authorize("my_secret_key")
payment: Payment = QiwiPayment(amount=100) # E.x. commission is 10%
print(payment.url) # https://oplata.qiwi.com/form/?invoice_uid=payment_unique_id
while payment.status != PaymentStatus.PAID:
input("Press Enter to update payment status")
payment.update()
print("Payment is completed!")
print(payment.income) # 90.0
Contributing
Bug reports and/or pull requests are welcome
License
The module is available as open source under the terms of the Apache License, Version 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pypayment-1.7.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4bce1595df33bcbbc287b657960dea5e5b39417dac79fcba73597db412912e4 |
|
MD5 | 6c4e71c02b3ce143aab6b8989a9324f6 |
|
BLAKE2b-256 | 23f469e34df57f04f49d4ebbcdf523c98320b3666fb925c6945b8a3993bfe142 |