Metadata-Version: 2.4
Name: paymentsgate-easy
Version: 0.1.0
Summary: Python SDK for the PaymentsGate Easy API
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.28.1
Provides-Extra: dev
Requires-Dist: mypy>=1.11; extra == "dev"
Requires-Dist: ruff>=0.11.7; extra == "dev"
Dynamic: license-file

# paymentsgate-easy

Python SDK for the PaymentsGate Easy API.

## Install

```bash
pip install paymentsgate-easy
```

Import in Python:

```python
import paymentsgate_easy
```

## Features

- Get wallet
- Get banks list
- Payin orders
- Payout orders
- Quotes (pre-payout quote calculate)

## Usage

```python
from paymentsgate_easy import (
    ApiClient,
    Currencies,
    DealLanguages,
    DealPayInRequest,
    DealSubtypes,
    FxCalculationRequest,
)

client = ApiClient(
    endpoint="https://api.example.com",
    credentials_path="./examples/credentials.json",
)

banks = client.get_banks(tag="fast")
wallet = client.get_wallet()

payin = client.create_payin(
    DealPayInRequest(
        amount=1500,
        currency=Currencies.KZT,
        invoice_id="INV-1000",
        client_id="CLIENT-1000",
        type=DealSubtypes.P2P,
        lang=DealLanguages.RU,
    )
)

quote = client.calculate_fx_post(
    FxCalculationRequest(
        currency_from=Currencies.USDT,
        currency_to=Currencies.KZT,
        amount=1500,
        subtype=DealSubtypes.P2P,
    )
)
```

## Async Usage

```python
import asyncio

from paymentsgate_easy import ApiAsyncClient, Currencies, DealSubtypes, FxCalculationRequest


async def main() -> None:
    client = ApiAsyncClient(
        endpoint="https://api.example.com",
        credentials_path="./examples/credentials.json",
    )

    quote = await client.calculate_fx_post(
        FxCalculationRequest(
            currency_from=Currencies.USDT,
            currency_to=Currencies.KZT,
            amount=1500,
            subtype=DealSubtypes.P2P,
        )
    )
    print(quote)


asyncio.run(main())
```

## Methods

- `get_wallet()`
- `get_banks(...)`
- `get_deal(...)`
- `create_payin(...)`
- `create_payout(...)`
- `calculate_fx_get(...)`
- `calculate_fx_post(...)`

## Exceptions

All request failures extend `ApiError`.

Available specialized exceptions include:

- `MissingApiKeyError`
- `CredentialsFileError`
- `InvalidEndpointError`
- `TransportError`
- `RequestError`
- `UnauthorizedError`
- `ForbiddenError`
- `DuplicateDealError`
- `InvalidCurrencyFromError`
- `InvalidCurrencyToError`
- `ExchangeDirectionNotAvailableError`

## Enums and models

Exports include:

- `Currencies`
- `DealSubtypes`
- `DealStatuses`
- `DealDirections`
- `DealLanguages`
- `RecipientTypes`
- `BankTypes`
- `BankPaymentSystems`
- `TtlUnits`
- `WidgetVersions`
- `DealPayOutBaseCalculationTypes`
- `DealPayOutFeesStrategies`
- `Wallet`, `WalletAsset`, `Currency`
- `Banks`, `Bank`, `BankLogo`
- `Deal`, `DealStatus`, `DealMetadata`
- `DealPayInRequest`, `DealPayInResponse`
- `DealPayOutRecipient`, `DealPayOutRequest`, `DealPayOutResponse`
- `FxCalculationRequest`, `FxCalculation`, `Quote`

## Examples

Ready-to-run examples are available in `examples/config.py`, `examples/credentials.example.json`, `examples/create_payin.py`, and `examples/get_quote.py`.
