Paylink Package
This package is ideal for Python developers looking to integrate Paylink's payment processing capabilities into their applications with minimal effort. It provides functionality to add and retrieve invoices.
Installation
You can install the package using pip:
pip install paylink-package==1.0.7
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)
# Cancel Invoice
cancellation_success = paylink.cancel_invoice(transaction_no=17214351564123) # true-false
# Payment Status
status = paylink.order_status(transaction_no=17214351564123)
print('Payment Status:', status)
Package Features:
The Paylink Python package provides a comprehensive integration with the Paylink Payment Gateway, enabling developers to create, manage, and track payment invoices easily. Key features include:
-
Environment Configuration:
- Supports both production and test environments.
- Easy setup with API credentials for authentication.
-
Authentication:
- Secure authentication to obtain an ID token required for API interactions.
-
Invoice Management:
- Create Invoice: Generate new invoices with detailed product information, client details, and callback URLs.
- Retrieve Invoice: Fetch invoice details using the transaction number.
- Order Status: Retrieve the status of an order by its transaction number.
-
Product Management:
- PaylinkProduct Class: Create product objects with attributes like title, price, quantity, description, VAT, and digital product options.
- Convert product data to and from dictionary format for easy serialization and deserialization.
-
Comprehensive Response Handling:
- PaylinkInvoiceResponse Class: Parse and manage responses from the Paylink API, including transaction details, order status, payment errors, and more.
-
Error Handling:
- Robust error handling with meaningful exception messages for authentication, invoice creation, and data retrieval processes.
-
Ease of Use:
- Designed with Python developers in mind, offering clear methods for interacting with the Paylink API.
- Helper methods for initializing the package in different environments (
testandproduction).
Changelog
-
1.0.6
- New Method Added:
cancel_invoiceto cancel an existing invoice using the Paylink API.
- New Method Added:
-
1.0.5
- Updated README File: Added detailed information about package features to provide users with a comprehensive overview of capabilities and functionalities.
- Enhanced Changelog: Included a changelog section in the README file to keep users informed about updates and changes in each version.
-
1.0.4
- PaylinkProduct Class:
- Developed a
PaylinkProductclass to create and manage product objects with attributes such as title, price, quantity, description, VAT, and options for digital products. - Implemented methods for converting product data to and from dictionary format, facilitating easy serialization and deserialization for various use cases.
- Developed a
- PaylinkInvoiceResponse Class:
- Introduced the
PaylinkInvoiceResponseclass to parse and handle responses from the Paylink API. This includes managing transaction details, order status, payment errors, and other relevant information.
- Introduced the
- Order Status Retrieval: Added functionality to retrieve the status of an order using its transaction number, allowing for effective tracking and management of orders.
- PaylinkProduct Class:
Metadata
Release files for paylink-package 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| paylink_package-1.0.7.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paylink_package-1.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / paylink_package-1.0.7.tar.gz
| Download URL | paylink_package-1.0.7.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31277f421774c77c16176030c052ce6b83ed419dbb53571f39755bf1e3b50eb5
|
|
BLAKE2b-256 checksum How to use checksums |
f5413ca341ab974dfe52d18d073b6c753c55c153ce94fed4722c4562a18a6337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / paylink_package-1.0.7-py3-none-any.whl
| Download URL | paylink_package-1.0.7-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fe65a8017f2af538d44fa627a3cd38ddfa084685b763652bdb9a78fd286117f
|
|
BLAKE2b-256 checksum How to use checksums |
4055253ec8e9abed66c401a01573ae7b24ff1e92f2e591434a333c6dff44256c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for paylink-package 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.