Skip to main content

Unofficial library for interacting with the OxaPay API.

Project description

OxaPay API Library

Description

This is an unofficial Python library for interacting with the OxaPay API. It provides both synchronous and asynchronous clients for managing payments, invoices, and other features offered by OxaPay.

Installation

Install the library using pip:

pip install oxapay_api

Usage

Synchronous Client

from oxapay_api.SyncOxaPay import SyncOxaPay

sync_client = SyncOxaPay(merchant_api_key="your_api_key_here")
try:
    api_status = sync_client.get_api_status()
    print(api_status)
except Exception as e:
    print(f"Error: {e}")

Asynchronous Client

import asyncio
from oxapay_api.AsyncOxaPay import AsyncOxaPay

async def main():
    async_client = AsyncOxaPay(merchant_api_key="your_api_key_here")
    try:
        api_status = await async_client.get_api_status()
        print(api_status)
    except Exception as e:
        print(f"Error: {e}")

asyncio.run(main())

Creating an Invoice

Synchronously

try:
    invoice = sync_client.create_invoice(amount=10.0, currency="USD")
    print(invoice)
except Exception as e:
    print(f"Error creating invoice: {e}")

Asynchronously

async def create_invoice_example():
    try:
        invoice = await async_client.create_invoice(amount=10.0, currency="USD")
        print(invoice)
    except Exception as e:
        print(f"Error creating invoice: {e}")

asyncio.run(create_invoice_example())

Note: Many methods, such as create_invoice and get_payment_information, can return either the raw API response (if raw_response=True) or model objects like OrderStatus or PaymentStatus (default). For the structure of these models, refer to the response_models.py file in the library.

Available Methods

  • get_api_status: Gets the current status of the OxaPay API.
  • create_invoice: Creates a new payment invoice.
  • get_supported_currencies: Returns a list of supported currencies and their network details.
  • get_supported_networks: Returns a list of supported blockchain networks.
  • get_supported_fiat_currencies: Returns a list of supported fiat currencies.
  • get_payment_information: Gets information about a specific payment by track_id.
  • create_white_label_payment: Creates a white label payment.
  • create_static_address: Creates a static address for receiving payments.
  • revoke_static_wallet: Revokes a static wallet by address.
  • get_static_address_list: Returns a list of static addresses.
  • get_payment_history: Gets payment history with various filters.
  • get_accepted_currencies: Returns a list of accepted currencies.
  • get_prices: Gets current cryptocurrency prices.

For detailed information about parameters and return types, refer to the documentation strings in the code or the official OxaPay API documentation.

Requirements

  • Python 3.6 or higher
  • aiohttp
  • requests
  • urllib3

License

This project is distributed under the MIT license.

Contribution

Any contributions are welcome! Please submit pull requests or open issues in the GitHub repository.

Links

Disclaimer

This library is unofficial and not affiliated with OxaPay. Use at your own risk.

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

oxapay_api-1.1.4.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

oxapay_api-1.1.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file oxapay_api-1.1.4.tar.gz.

File metadata

  • Download URL: oxapay_api-1.1.4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for oxapay_api-1.1.4.tar.gz
Algorithm Hash digest
SHA256 efa203b47c3f7f0e96a6b2d75f5c1f4cd4e5051a3402fe7db51134462f986dfe
MD5 529d990e4432f55065ea2c6fe97d1313
BLAKE2b-256 a874e506a9e705f9cc425bb667827e6f74f91885dde67a915068c1c7edfb9415

See more details on using hashes here.

File details

Details for the file oxapay_api-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: oxapay_api-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for oxapay_api-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6b73d6253ba2501519d60a359b0ff50ab8f52c26f554c7142b7aa6f56d0e7540
MD5 c72960016686520e7205df5af339af7d
BLAKE2b-256 8d5da8d658798c0d49b02b58ee6136ec0081db462fb73d2b931850a6dccb0514

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