A Python package for interacting with the Paylink API
Project description
Paylink Package
A Python package for interacting with the Paylink API. It provides functionality to add and retrieve invoices.
Installation
You can install the package using pip:
pip install paylink-package==1.0.4
Usage
from paylink import Paylink, PaylinkProduct
# For Development & Test
paylink = Paylink.test()
# For Production
paylink = Paylink.production(api_id='xxxxx', secret_key='xxxxx')
# Add Invoice
invoice_details = paylink.add_invoice(
amount=10,
client_mobile='966123456789',
client_name='John Doe',
order_number='1234567890',
products=[
PaylinkProduct(title='Hand bag', price=4, qty=1),
PaylinkProduct(title='Book', price=3, qty=2),
],
callback_url='https://paylink.sa/test-python-sdk',
currency='USD',
)
print(invoice_details)
print('Transaction No:', invoice_details.transaction_no)
print('Payment Url:', invoice_details.url)
# Get Invoice
invoice_details = paylink.get_invoice(transaction_no=17214351564123)
print('Payment Status:', invoice_details.order_status)
print('Payment Url:', invoice_details.url)
# Payment Status
status = paylink.order_status(transaction_no=17214351564123)
print('Payment Status:', status)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paylink_package-1.0.4.tar.gz
(6.0 kB
view details)
Built Distribution
File details
Details for the file paylink_package-1.0.4.tar.gz
.
File metadata
- Download URL: paylink_package-1.0.4.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5b43eb950db6d35b6a04e02590b63f3541fdbc079ef86785f194727acaf3b32 |
|
MD5 | cb01f7f5d7e280421c25204f3a219198 |
|
BLAKE2b-256 | 39fe63b6c8b9bdf2ba7f8c13f1cbc1d2a1bf10bdbca29062b3a8cd1ad04d3387 |
File details
Details for the file paylink_package-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: paylink_package-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94348f928f871a71764addc03dc25699fdec452f6d9e134ec65c3bd0ee70787b |
|
MD5 | b8da0b563205aa62c7e017a802fa5075 |
|
BLAKE2b-256 | 9b2574d2073e6bf85b726825ede642d5a6eb2310c20419e32ee4dd8d8f6745e3 |