コード例 #1
0
 def setup_method(self):
     self.client = currencycloud.Client(
         None, None, currencycloud.Config.ENV_DEMONSTRATION)
     self.client.config.auth_token = '1234567890'
コード例 #2
0
 def setup_method(self, method):
     self.client = currencycloud.Client(
         '*****@*****.**',
         'e3b0d6895f91f46d9eaf5c95aa0f64dca9007b7ab0778721b6cdc0a8bc7c563b',
         currencycloud.Config.ENV_DEMONSTRATION)
コード例 #3
0
 def setup_method(self):
     self.client = currencycloud.Client(None, None,
                                        currencycloud.Config.ENV_DEMO)
     self.client.config.auth_token = 'deadbeef'
コード例 #4
0
convert money into currencies of all the world’s major economies.

In this cookbook, you will:

1. Get a quote for trading Pound Sterling (GBP) for Euros (EUR).
2. Top up your Euros balance by trading some Pound Sterling.
'''
'''
1. Authenticate using valid credentials.
If you do not have a valid Login ID and API Key, you can get one by registering at
https://www.currencycloud.com/developers/register-for-an-api-key/
'''
login_id = "*****@*****.**"
api_key = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
environment = currencycloud.Config.ENV_DEMO
client = currencycloud.Client(login_id, api_key, environment)
'''
2 Get a detailed quote
Check how much it will cost to buy 10,000 Euros using funds from your Pound Sterling balance, by making a call to the
Get Detailed Rates endpoint
'''
try:
    rate = client.rates.detailed(buy_currency='EUR',
                                 sell_currency='GBP',
                                 fixed_side='buy',
                                 amount=10000)
    print(
        "To buy {0} {1} you will need to sell {2} {3}. This quote will be valid until {4}"
        .format(rate.client_buy_amount, rate.client_buy_currency,
                rate.client_sell_amount, rate.client_sell_currency,
                rate.settlement_cut_off_time))
コード例 #5
0
 def setup_method(self, method):
     self.client = currencycloud.Client(
         '*****@*****.**',
         'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
         currencycloud.Config.ENV_DEMO)