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
- GitHub Repository: https://github.com/Rushifakami/oxapay_api
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
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 oxapay_api-1.1.5.tar.gz.
File metadata
- Download URL: oxapay_api-1.1.5.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2db4c042547eec543e94afb19bb7122aa4a3d2ad07e7be4173909a52d79f5cc4
|
|
| MD5 |
d03304f4470ce7dc203820b4a68c2121
|
|
| BLAKE2b-256 |
ff6e9c7c3442ca8234627058eb0a73ff7779d57f30db98b0719beea28a16f688
|
File details
Details for the file oxapay_api-1.1.5-py3-none-any.whl.
File metadata
- Download URL: oxapay_api-1.1.5-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba3053b7ef7f1d6a2056e45ea11c7453bec3af8b0a1076778f1722797f4d9c99
|
|
| MD5 |
7d14de653c82a76a85c55c06210a1fa0
|
|
| BLAKE2b-256 |
1804e145989e58aa1a2af93510ab9f69181fa552c1968617775b23fc2bc1ceb7
|