Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

iodbh/coingate-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coingate Python

Simple API client for the CoinGate service.

Usage

Latest API version

from coingate.client import CoinGateClient

The CoinGateClient class will inherit methods from the latest API's supported version client. Currently, it is API V2.

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

About

Simple CoinGate API client for python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages