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
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"
)
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
Release history Release notifications | RSS feed
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-0.1.0.tar.gz
(7.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file payler_sdk-0.1.0.tar.gz.
File metadata
- Download URL: payler_sdk-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f72488d608ca6137519f60dac71fcf32d09a6101262d9f3741424e4510e99f81
|
|
| MD5 |
c61e9625092ca93e42a96eeac252ad66
|
|
| BLAKE2b-256 |
101386ab7766d7adc3cf8a679ee1bfeda2de37470ef1a9a84e88ef9f17be4484
|
File details
Details for the file payler_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: payler_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd74ca8e93cb5f30dac3a1f0af53e772369aa03ce19c61511ef4b46ea9e20394
|
|
| MD5 |
a2e2af4933d9c728299d4af76b871de6
|
|
| BLAKE2b-256 |
120c4b9aecf4f9a2d5733cea98c0ad8540bd3ccc15b819a3d08362872ac2ed79
|