Client¶
- class aioplatega.client.platega.Platega[source]¶
Bases:
objectAsync client for the Platega payment API.
Usage:
async with Platega(merchant_id="...", secret="...") as client: result = await client.create_transaction(...)
- async create_transaction(*, payment_method, payment_details, description=None, return_url=None, failed_url=None, payload=None)[source]¶
Create a new payment transaction.
- Parameters:
payment_method (
PaymentMethodInt) – Payment method identifier (e.g.PaymentMethodInt.SBP_QR).payment_details (
PaymentDetails) – Amount and currency for the payment.description (
str|None) – Optional human-readable description.return_url (
str|None) – URL to redirect the user after successful payment.failed_url (
str|None) – URL to redirect the user after failed payment.payload (
str|None) – Arbitrary string passed through to the callback.
- Return type:
- Returns:
Response containing the transaction ID, status, and redirect URL.
- async get_transaction_status(transaction_id)[source]¶
Get the current status of a transaction.
- Parameters:
transaction_id (
str) – UUID of the transaction to query.- Return type:
- Returns:
Full transaction details including status and payment info.
- async get_rate(*, payment_method, currency_from, currency_to)[source]¶
Get the current exchange rate for a payment method.
- Parameters:
- Return type:
- Returns:
Current rate and last update timestamp.