Skip to main content

Python SDK for the PaymentsGate Easy API

Project description

paymentsgate-easy

Python SDK for the PaymentsGate Easy API.

Install

pip install paymentsgate-easy

Import in Python:

import paymentsgate_easy

Features

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

Usage

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

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.

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

paymentsgate_easy-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

paymentsgate_easy-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file paymentsgate_easy-0.1.0.tar.gz.

File metadata

  • Download URL: paymentsgate_easy-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.5 Darwin/24.5.0

File hashes

Hashes for paymentsgate_easy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc441bc2274a1a403546f1a6a4ede41bfd4780c710168899ba51530a33af9717
MD5 2a5d8e4cd6c8b20e27a60801a83e4c01
BLAKE2b-256 48723e9baff91b1c53984fd91e4993d13013af43ecfb9d3391968968166ad9d0

See more details on using hashes here.

File details

Details for the file paymentsgate_easy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: paymentsgate_easy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.5 Darwin/24.5.0

File hashes

Hashes for paymentsgate_easy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee94a315107b19313070091cc3a11e66c57d30dee4f3877f6a29655fbb617f2b
MD5 bd1513d3a18c56db7ca7c93b9ff6819a
BLAKE2b-256 a1fd5e0f640999828cba6725d0ebd81ec40aeab400687484ac29bc7c989543a4

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