A Python package designed for seamless integration with the Paylink API, ideal for developers who want to incorporate Paylink's payment processing capabilities into their applications effortlessly. It offers straightforward functionality for adding and retrieving invoices.
Project description
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.5
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)
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 (
test
andproduction
).
Changelog
-
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
PaylinkProduct
class 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
PaylinkInvoiceResponse
class 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:
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
Built Distribution
File details
Details for the file paylink_package-1.0.5.tar.gz
.
File metadata
- Download URL: paylink_package-1.0.5.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12c3de338a324a23acc5d7d4a6ec9eae8f8139244fb05ce3f69806a9d0705207 |
|
MD5 | 2b17c67916a134c89cfc451e1f3e50b5 |
|
BLAKE2b-256 | c0955b0a2140cd6f33bd85a834a6115f2e1a03768d3ae2d1972b5743cebecd20 |
File details
Details for the file paylink_package-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: paylink_package-1.0.5-py3-none-any.whl
- Upload date:
- Size: 8.2 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 | e65ddce7495e353e3c4e20ec5c375aaea0a120b2d3981794d873ec0eb60f7e09 |
|
MD5 | 1143f6c3cf0146135a57d2df01fe4ae8 |
|
BLAKE2b-256 | 7d97a40dc24bb88567be2bdaaf7f2e8696050af535e3afaf1dcba42646cf2125 |