Metadata-Version: 2.1
Name: cardlinky
Version: 1.0
Summary: A Python wrapper for the CARDLINK api
Home-page: https://github.com/LuK050/cardlinky
License: MIT
Keywords: cardlink,api
Author: LuK050
Author-email: volychevk@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: requests (>=2.28.2,<3.0.0)
Project-URL: Documentation, https://cardlink.link/reference/api
Project-URL: Repository, https://github.com/LuK050/cardlinky
Description-Content-Type: text/markdown

# cardlinky
<img src="https://img.shields.io/github/license/LUK050/cardlinky?style=flat-square"> <img src="https://img.shields.io/bitbucket/issues/LuK050/cardlinky?style=flat-square">

📘 [Official documentation](https://cardlink.link/reference/api)

## Usage
First of all, you need to create a store in the system https://cardlink.link/. After confirmation, you will be able to get a token and a shop ID to work with the API.

### Creating a bill and getting a payment link:
```py
from cardlinky import Cardlinky


def print_bill_url(token: str, shop_id: str, amount: float) -> None:
    # Creating an instance of the class
    cardlinky = Cardlinky(token)

    # Create a bill and save it
    bill = cardlinky.create_bill(amount=amount, shop_id=shop_id)

    # Getting a payment link and printing
    print(bill.link_url)


print_bill_url("YOUR-TOKEN", "YOUR-SHOP-ID", 100.0)
# https://cardlink.link/link/GkLWvKx3
```

### Getting a bill status:
```py
from cardlinky import Cardlinky


def print_bill_status(token: str, id: str) -> None:
    # Creating an instance of the class
    cardlinky = Cardlinky(token)

    # Create a bill and save it
    bill_status = cardlinky.get_bill_status(id=id)

    # Getting a status and printing
    print(bill_status.status)


print_bill_status("YOUR-TOKEN", "BILL-ID")
# NEW
```

