Metadata-Version: 2.1
Name: gQiwiAPI
Version: 1.2
Summary: A simple API for creating a payment link
Home-page: https://github.com/gnifajio/gQiwiAPI
Author: Gnifajio None
Author-email: gnifajio@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# gQiwiAPI by _Gnifajio_   ![](https://badgen.net/badge/release/v1.0/grey) ![](https://komarev.com/ghpvc/?username=gnifajio-gQiwiAPI&label=views)

_A simple API for creating a payment link_

#### Installation



```sh
git clone https://github.com/gnifajio/gQiwiAPI.git
pip install -r requirements.txt
cd gQiwiAPI
python3 setup.py install
```

or

```sh
pip install gQiwiAPI
```

#### Usage



```python
# Initialization
from gQiwiAPI import Qiwi
SECRET_KEY = 'Your secret key for managing payments'
qiwi = Qiwi(SECRET_KEY)
# Creating an bill
my_first_bill = qiwi.create_bill(10, '15m')
# Getting a payment link
payUrl = my_first_bill.payUrl
# Checking the payment status
bill_state = qiwi.bill_status(my_first_bill)
```

> You can get `SECRET_KEY` on [official website](https://qiwi.com/p2p-admin/transfers/api).

##### Syntax



```python
qiwi.create_bill(amount, expDT='15m')
```

> `amount` - the amount of the payment in rubles.
> `comment` - comment
> `expDT` - 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:
``` python
qiwi.create_bill(self, 10, comment='Test', expDT='30m')
```

`expDT` is set in the format `nd:nh:nm:ns`, where

> `n` - int
> `d` - days
> `h` - hours
> `m` - minutes
> `s` - seconds

You can pass both integer and fractional numbers to `n`, the order is also not important.
For example:
```python
amount = 10
qiwi.create_bill(amount, expDT='0.3d:77m:0.5h')
```

#### Links

[QIWI: API of P2P accounts. Invoicing.](https://developer.qiwi.com/ru/p2p-payments/?shell#create)
[QIWI: Authentication data.](https://qiwi.com/p2p-admin/transfers/api)

#### TODO

- Expand the API
- - Add `customer` support
- - Add `customFields` support


