Wrapper for the Cardlink API in Python
Project description
cardlinky
Usage
Firstly, you need to create an account and а shop in 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:
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:
from cardlinky import Cardlinky
def print_bill_status(token: str, bill_id: str) -> None:
# Creating an instance of the class
cardlinky = Cardlinky(token)
# Create a bill and save it
bill_status = cardlinky.get_bill_status(bill_id=bill_id)
# Getting a status and printing
print(bill_status.status)
print_bill_status("YOUR-TOKEN", "BILL-ID")
# Status.NEW
Installation
pip install cardlinky
Dependencies:
Package | Version |
---|---|
requests |
>=2.28.2 |
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
cardlinky-1.7.tar.gz
(10.9 kB
view details)
Built Distribution
cardlinky-1.7-py3-none-any.whl
(10.2 kB
view details)
File details
Details for the file cardlinky-1.7.tar.gz
.
File metadata
- Download URL: cardlinky-1.7.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985f205f7d379071c8f6f331bc444001b21200452d691d381ee449bc68b4b633 |
|
MD5 | 637a8757c7210684d964a2b9d06bfa8e |
|
BLAKE2b-256 | 694fd86b9057b7924abfb26c959d076368de99c945be4111c71acae869a798d9 |
File details
Details for the file cardlinky-1.7-py3-none-any.whl
.
File metadata
- Download URL: cardlinky-1.7-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.11.3 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4785560149e7570f15473b85cc3c90d956679ea1f9c20561fc7be0660966b85 |
|
MD5 | ca20fe39a4e7a41001b2901b2479c5a9 |
|
BLAKE2b-256 | 4f9bad17f4a33d4402ee384f903ef55ed652873f4b597ff7657c78e0befdefb7 |