Unofficial Python libary for LiqPay API
Project description
LiqPy
LiqPy -- unofficial python library for LiqPay API.
Is it production ready?
Short answer: Well, yes, but actually no.
Long answer: It depends on what production readiness means for you. Implementation still lacks some LiqPay's functionality and tests coverage, but I, personally, use it in production. It gets work done in a most pythonic way I see it.
Installation
pip install liqpy
Basic Usage
Get public_key and private_key from LiqPay and create a checkout link:
from liqpy.client import Client
# env variables for keys are LIQPAY_PUBLIC_KEY and LIQPAY_PRIVATE_KEY
client = Client(public_key=..., private_key=...)
checkout_link = client.checkout(
action="pay",
order_id=...,
amount=1,
currency="USD",
description="Payment Example",
# set server_url for handling a callback
# server_url=...
)
print(checkout_link)
Handle Callback
Handle callback from LiqPay after checkout on your server (server_url):
from urllib.parse import parse_qs
from liqpy.api.exceptions import LiqPayRequestException
# request body content type is application/x-www-form-urlencoded
def handle_callback(body: str):
query = parse_qs(body)
data, signature = query["data"][0], query["signature"][0]
try:
result = client.callback(data, signature)
print(result)
except LiqPayRequestException:
print("LiqPay callback verification failed.")
See readme.ipynb for more examples.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file liqpy-0.20.0.tar.gz.
File metadata
- Download URL: liqpy-0.20.0.tar.gz
- Upload date:
- Size: 73.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7d9e6e7d4e86b615aad525742c7e0c5d069ced19b23ae54a995f4f91184a85a
|
|
| MD5 |
ee2ca4f4e911896c3bd77ea1ca7b0eb0
|
|
| BLAKE2b-256 |
4e49c4ca9ebed0ac7477f161135a3eca289da3cedda24c0e6b2c2433abf7e855
|
Provenance
The following attestation bundles were made for liqpy-0.20.0.tar.gz:
Publisher:
publish.yml on rostyq/liqpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liqpy-0.20.0.tar.gz -
Subject digest:
d7d9e6e7d4e86b615aad525742c7e0c5d069ced19b23ae54a995f4f91184a85a - Sigstore transparency entry: 561120665
- Sigstore integration time:
-
Permalink:
rostyq/liqpy@877d50d115f3da5fc5948c0094e25d1747035f9c -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/rostyq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@877d50d115f3da5fc5948c0094e25d1747035f9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file liqpy-0.20.0-py3-none-any.whl.
File metadata
- Download URL: liqpy-0.20.0-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f928e6fd903a8049688bfda74a4dbf944608597e222c7baca948f304667e84f
|
|
| MD5 |
75334c7c75791d59b5d88511b7b9eb59
|
|
| BLAKE2b-256 |
4cadae94ca620f5c364e79f3802ef67fc2e0b0265c3107cfb7543f67df1240fb
|
Provenance
The following attestation bundles were made for liqpy-0.20.0-py3-none-any.whl:
Publisher:
publish.yml on rostyq/liqpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liqpy-0.20.0-py3-none-any.whl -
Subject digest:
1f928e6fd903a8049688bfda74a4dbf944608597e222c7baca948f304667e84f - Sigstore transparency entry: 561120678
- Sigstore integration time:
-
Permalink:
rostyq/liqpy@877d50d115f3da5fc5948c0094e25d1747035f9c -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/rostyq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@877d50d115f3da5fc5948c0094e25d1747035f9c -
Trigger Event:
push
-
Statement type: