A simple API for creating a payment link
git clone https://github.com/gnifajio/gQiwiAPI.git
pip install -r requirements.txt
cd gQiwiAPI
python3 setup.py install
or
pip install gQiwiAPI
# Initialization
from gQiwiAPI import Qiwi
SECRET_KEY = 'Your secret key for managing payments'
qiwi = Qiwi(SECRET_KEY)
# Creating a bill
my_first_bill = qiwi.new(10, '15m')
# Getting a payment link
payUrl = my_first_bill.payUrl
# Checking the payment status
bill_state = qiwi.status(my_first_bill)
# Checking the payment status by id
state_by_id = qiwi.check_id(my_first_bill.bill_id)
You can get
SECRET_KEY
on official website.
class Qiwi:
def new(self, amount, comment=None, exp_dt='15m'): ...
amount
- the amount of the payment in rubles.comment
- commentexpDT
- the validity time of the link.
About amount
I will only say that you can pass str
, int
and float
there and everything will work fine.
The default comment is set to None
, and is not used.
You can add a comment to the payment like this:
qiwi.create_bill(self, 10, comment='Test', expDT='30m')
expDT
is set in the format nd:nh:nm:ns
, where
n
- intd
- daysh
- hoursm
- minutess
- seconds
You can pass both integer and fractional numbers to n
, the order is also not important.
For example:
from gQiwiAPI import Qiwi
qiwi = Qiwi('SECRET_KEY')
amount = 10
qiwi.new(amount, exp_dt='0.3d:77m:0.5h')
QIWI: API of P2P accounts. Invoicing.
- Expand the API
-
- Add
customer
support
- Add
-
- Add
customFields
support
- Add