# cardlinky
<a href="https://pypi.org/project/cardlinky/"><img src="https://img.shields.io/pypi/v/cardlinky?style=flat-square"></a> <a href="https://pypi.org/project/cardlinky/"><img src="https://img.shields.io/pypi/dm/cardlinky?color=blue&style=flat-square"></a> <img src="https://img.shields.io/pypi/pyversions/cardlinky?style=flat-square">
[📘 Official documentation](https://cardlink.link/reference/api)
## 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:
```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, 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
```sh
pip install cardlinky
```
### Dependencies:
Package | Version
-------- | ----------
`requests` | `>=2.28.2`
Raw data
{
"_id": null,
"home_page": "https://github.com/LuK050/cardlinky",
"name": "cardlinky",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "cardlink,api",
"author": "LuK050",
"author_email": "volychevk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/69/4f/d86b9057b7924abfb26c959d076368de99c945be4111c71acae869a798d9/cardlinky-1.7.tar.gz",
"platform": null,
"description": "# cardlinky\n<a href=\"https://pypi.org/project/cardlinky/\"><img src=\"https://img.shields.io/pypi/v/cardlinky?style=flat-square\"></a> <a href=\"https://pypi.org/project/cardlinky/\"><img src=\"https://img.shields.io/pypi/dm/cardlinky?color=blue&style=flat-square\"></a> <img src=\"https://img.shields.io/pypi/pyversions/cardlinky?style=flat-square\"> \n\n[\ud83d\udcd8 Official documentation](https://cardlink.link/reference/api)\n\n## Usage\nFirstly, you need to create an account and \u0430 shop in https://cardlink.link/. After confirmation, you will be able to get a token and a shop ID to work with the API.\n\n### Creating a bill and getting a payment link:\n```py\nfrom cardlinky import Cardlinky\n\n\ndef print_bill_url(token: str, shop_id: str, amount: float) -> None:\n # Creating an instance of the class\n cardlinky = Cardlinky(token)\n\n # Create a bill and save it\n bill = cardlinky.create_bill(amount=amount, shop_id=shop_id)\n\n # Getting a payment link and printing\n print(bill.link_url)\n\n\nprint_bill_url(\"YOUR-TOKEN\", \"YOUR-SHOP-ID\", 100.0)\n# https://cardlink.link/link/GkLWvKx3\n```\n\n### Getting a bill status:\n```py\nfrom cardlinky import Cardlinky\n\n\ndef print_bill_status(token: str, bill_id: str) -> None:\n # Creating an instance of the class\n cardlinky = Cardlinky(token)\n\n # Create a bill and save it\n bill_status = cardlinky.get_bill_status(bill_id=bill_id)\n\n # Getting a status and printing\n print(bill_status.status)\n\n\nprint_bill_status(\"YOUR-TOKEN\", \"BILL-ID\")\n# Status.NEW\n```\n\n## Installation\n```sh\npip install cardlinky\n```\n### Dependencies:\nPackage | Version\n-------- | ----------\n`requests` | `>=2.28.2` \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Wrapper for the Cardlink API in Python",
"version": "1.7",
"project_urls": {
"Documentation": "https://cardlink.link/reference/api",
"Homepage": "https://github.com/LuK050/cardlinky",
"Repository": "https://github.com/LuK050/cardlinky"
},
"split_keywords": [
"cardlink",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4f9bad17f4a33d4402ee384f903ef55ed652873f4b597ff7657c78e0befdefb7",
"md5": "ca20fe39a4e7a41001b2901b2479c5a9",
"sha256": "c4785560149e7570f15473b85cc3c90d956679ea1f9c20561fc7be0660966b85"
},
"downloads": -1,
"filename": "cardlinky-1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca20fe39a4e7a41001b2901b2479c5a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 10238,
"upload_time": "2023-05-20T19:59:52",
"upload_time_iso_8601": "2023-05-20T19:59:52.809649Z",
"url": "https://files.pythonhosted.org/packages/4f/9b/ad17f4a33d4402ee384f903ef55ed652873f4b597ff7657c78e0befdefb7/cardlinky-1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "694fd86b9057b7924abfb26c959d076368de99c945be4111c71acae869a798d9",
"md5": "637a8757c7210684d964a2b9d06bfa8e",
"sha256": "985f205f7d379071c8f6f331bc444001b21200452d691d381ee449bc68b4b633"
},
"downloads": -1,
"filename": "cardlinky-1.7.tar.gz",
"has_sig": false,
"md5_digest": "637a8757c7210684d964a2b9d06bfa8e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 10941,
"upload_time": "2023-05-20T19:59:55",
"upload_time_iso_8601": "2023-05-20T19:59:55.143156Z",
"url": "https://files.pythonhosted.org/packages/69/4f/d86b9057b7924abfb26c959d076368de99c945be4111c71acae869a798d9/cardlinky-1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-20 19:59:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LuK050",
"github_project": "cardlinky",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "cardlinky"
}