Skip to main content

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

Usage

from paylink import Paylink, PaylinkProduct
paylink = Paylink(env='production')
# 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:', invoiceDetails['transactionNo'])
print('Payment Url:', invoiceDetails['url'])
# Get Invoice

invoice_details = paylink.get_invoice(invoice_details['transactionNo'])

print('Payment Status:', invoice_details['orderStatus'])

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-0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

paylink_package-0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page