A simple API for creating a payment link
Project description
gQiwiAPI by Gnifajio
A simple API for creating a payment link
Installation
git clone https://github.com/gnifajio/gQiwiAPI.git
pip install -r requirements.txt
cd gQiwiAPI
python3 setup.py install
or
pip install gQiwiAPI
Usage
# 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.
Syntax
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')
Links
QIWI: API of P2P accounts. Invoicing.
TODO
- Expand the API
-
- Add
customer
support
- Add
-
- Add
customFields
support
- Add
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
File details
Details for the file gQiwiAPI-1.4.7.tar.gz
.
File metadata
- Download URL: gQiwiAPI-1.4.7.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 929b9061c942fec61b075567efa5aaa011dc65a33ca6d2f56f51bbfe1bd8278f |
|
MD5 | 78e64a27c3e04ef2e3a2a6e599d51457 |
|
BLAKE2b-256 | a5e0542d08ae4cd78ec807c8428ea7767f3a6741cf13d070c49a357ed761d315 |
File details
Details for the file gQiwiAPI-1.4.7-py3-none-any.whl
.
File metadata
- Download URL: gQiwiAPI-1.4.7-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8311cdd45b4e4338bd914c76fcd758fde6d3d907a96dd74fd8634ddf25f049b |
|
MD5 | a22bbcfd069fb9dd3b795394df5bc522 |
|
BLAKE2b-256 | 8e414fbfe1500ba6cfaa952ab4ed9a6540a59dcd3cb8547a88ea343c49d408bd |