Basic CoinGate API client
Project description
Simple API client for the CoinGate service.
Usage
API V2
from coingate.client import CoinGateV2Client, CoinGateV2Order
# Create a client
# To use the production API, add env="live"
client = CoinGateV1Client("app_id", "api_token"")
# Prepare an order
new_order = CoinGateV2Order.new(
"order-ID",
10.5,
"USD",
"USD",
callback_url='https://api.example.com/paymentcallback?token=randomtoken',
cancel_url='https://www.example.com/ordercancelled',
success_url='https://www.example.com/orderprocessed')
# Create the order
placed_order = client.create_order(new_order)
# Get the payment URL:
print(placed_order.payment_url)
# List orders :
orders = list(client.iterate_all_orders())
# Get an order by id:
order = orders[0].coingate_id
API V1
from coingate.client import CoinGateV1Client, CoinGateV1Order
# Create a client
# To use the production API, add env="live"
client = CoinGateV1Client("app_id", "api_key", "api_secret")
# Prepare an order
new_order = CoinGateV1Order.new(
"order-ID",
10.5,
"USD",
"USD",
callback_url='https://api.example.com/paymentcallback?token=randomtoken',
cancel_url='https://www.example.com/ordercancelled',
success_url='https://www.example.com/orderprocessed')
# Create the order
placed_order = client.create_order(new_order)
# Get the payment URL:
print(placed_order.payment_url)
# List orders :
orders = list(client.iterate_all_orders())
# Get an order by id:
order = orders[0].coingate_id
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
coingate-0.1.0.dev2.tar.gz
(6.7 kB
view hashes)
Built Distribution
Close
Hashes for coingate-0.1.0.dev2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a798800bb9d41f68e14292d740f34830fb4355a9e02516a377e4cd424a3d2714 |
|
MD5 | 0c964947d33bdca7ebabd9286db5f3db |
|
BLAKE2b-256 | d259f53d6d6b798d35f8a3405c6ae6609de29ba8f297de9174f4219b9c287059 |