Skip to main content

Python SDK for integration with the Payler payment system

Project description

Payler SDK

Python SDK for integration with the Payler payment system.

Installation

pip install payler-sdk

Features

  • Card saving and management
  • Customer registration
  • Processing payments with saved cards
  • Transaction status handling
  • Get payment status

Quick Start

from payler_sdk import PaylerClient

# Initialize the client
client = PaylerClient(
    base_url="sandbox.payler.com",
    auth_key="your_auth_key",
)

# Save card and process payment
response = client.initialize_save_card_session(
    customer_id="customer123",
    currency="RUB",
    return_url_success="https://your-website.com/payment/sync-cards"
)

# Get the redirect URL for card saving
redirect_url = response.save_card_url

# After card saving, process payment with saved card
payment = client.charge_saved_card(
    amount=100.50,
    order_id="order_12345",
    currency="RUB",
    recurrent_template_id="template_id_from_saved_card"
)

# Get payment status
status = client.get_payment_status(order_id="order_12345")

Usage Examples

Register a New Customer

from payler_sdk.models import PaylerCustomerUpdateOrCreateRequest

customer = PaylerCustomerUpdateOrCreateRequest(
    name="Erlich Bachman",
    email="erlich.bachman@gmail.com",
    phone="+79001234567"
)
response = client.register_new_customer(customer)
customer_id = response.customer_id

Error Handling

from payler_sdk.exceptions import PaylerApiError, PaylerSessionError

try:
    payment = client.charge_saved_card(...)
except PaylerApiError as e:
    print(f"API error: {e}, status code: {e.status_code}")
except PaylerSessionError as e:
    print(f"Session error: {e}")

Requirements

  • Python 3.8+
  • requests library

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

payler_sdk-1.0.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

payler_sdk-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file payler_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: payler_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for payler_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 058993da334b937dc5aa3ab4b1cdd0c0a464ab0ce6ce1a9e0f83ae93d3e72d96
MD5 0c257473bc1707592ac874193a5e49bf
BLAKE2b-256 9c93a17e8c2ed1982cb7a27383e7348d3a4337d22a21629580dbdf90c0d1d257

See more details on using hashes here.

File details

Details for the file payler_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: payler_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for payler_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0dee68d1c83786ba6b398254473c3dcdadbbc0cb1274cd236bb66633a62800bd
MD5 15a0b24edfb5516d5a9c2d099746a655
BLAKE2b-256 08d3f5b9a82221621801e8094d138450fd19a7ea53a303a8851ebc0de6ce1b50

See more details on using hashes here.

Supported by

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