bitex 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bitex/payment.rb +50 -0
- data/lib/bitex/version.rb +1 -1
- data/spec/fixtures/payment.json +1 -0
- data/spec/fixtures/payments.json +1 -0
- data/spec/fixtures/pos_setup.json +1 -0
- data/spec/fixtures/rates_tree.json +1 -0
- data/spec/payment_spec.rb +119 -0
- metadata +12 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20547e560a9429bc177f38ebeb2933813d495b7
|
4
|
+
data.tar.gz: e6f52c5f447f5d2dc3ce1e3d70f8a06fb32e84f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2acad0ac491239f3ef614aafcc081bd90bdc2be67beafebe2566e40fcfe25671962102eb9d2008fe1149eb9f2e3915d34f6e8c84ea897285ea8a1c59bade464
|
7
|
+
data.tar.gz: 6c161cce3d216e448618c189ee795a8b995cd854bbe6e4fe661899428dc70b06ae18a696fab3e46bdd13f13b2ed6a532c74f2c06fad330462c401f434b6cdc3b
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Bitex
|
2
|
+
class Payment
|
3
|
+
|
4
|
+
attr_accessor :id, :user_id, :amount, :currency_id, :expected_quantity,
|
5
|
+
:previous_expected_quantity, :confirmed_quantity, :unconfirmed_quantity,
|
6
|
+
:valid_until, :quote_valid_until, :last_quoted_on, :status, :address,
|
7
|
+
:settlement_currency_id, :settlement_amount, :keep, :merchant_reference,
|
8
|
+
:customer_reference
|
9
|
+
|
10
|
+
# @visibility private
|
11
|
+
def self.from_json(json)
|
12
|
+
new.tap do |thing|
|
13
|
+
json.each do |key,raw_value|
|
14
|
+
next if raw_value.nil?
|
15
|
+
|
16
|
+
value = if [:valid_until, :quote_valid_until, :last_quoted_on].include?(key.to_sym)
|
17
|
+
Time.at(raw_value)
|
18
|
+
else
|
19
|
+
raw_value
|
20
|
+
end
|
21
|
+
thing.send("#{key}=", value) rescue nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.create!(params)
|
27
|
+
from_json(Api.private(:post, "/private/payments", params))
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.find(id)
|
31
|
+
from_json(Api.private(:get, "/private/payments/#{id}"))
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.all
|
35
|
+
Api.private(:get, "/private/payments").collect{|x| from_json(x) }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Validate a callback and parse the given payment from it.
|
39
|
+
# Returns nil if the callback was invalid.
|
40
|
+
def self.from_callback(callback_params)
|
41
|
+
from_json(callback_params["payment"]) if callback_params["api_key"] == Bitex.api_key
|
42
|
+
end
|
43
|
+
|
44
|
+
# Sets up the web-pos
|
45
|
+
def self.pos_setup!(params)
|
46
|
+
Api.private(:post, "/private/payments/pos_setup", params)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
data/lib/bitex/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"id":1, "user_id":1, "amount":100.00, "currency_id":1, "expected_quantity":0.02, "previous_expected_quantity":0.018, "confirmed_quantity":0.0, "unconfirmed_quantity":0.0, "valid_until":1430226201, "quote_valid_until":1430226201, "last_quoted_on":1430220201, "status":"pending", "address":{"id":4, "public_address":"1ABC..."}, "settlement_currency_id":2, "settlement_amount":100, "keep":1.5, "merchant_reference":"Invoice#1234", "customer_reference":"Frappuchino"}
|
@@ -0,0 +1 @@
|
|
1
|
+
[{"id":1, "user_id":1, "amount":100.00, "currency_id":1, "expected_quantity":0.02, "previous_expected_quantity":0.018, "confirmed_quantity":0.0, "unconfirmed_quantity":0.0, "valid_until":1430226201, "quote_valid_until":1430226201, "last_quoted_on":1430220201, "status":"pending", "address":{"id":4, "public_address":"1ABC..."}, "settlement_currency_id":2, "settlement_amount":100, "keep":1.5, "merchant_reference":"Invoice#1234", "customer_reference":"Frappuchino"}]
|
@@ -0,0 +1 @@
|
|
1
|
+
{"merchant_name": "Tierra Buena", "merchant_slug": "tierrabuena", "merchant_logo": "https://t.co/logo.png", "merchant_keep": 0}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"btc":{"cash":{"usd":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":278.3586627}],"bitstamp_as_reference":[{"type":"exchange","rate":279.22}],"itbit_as_reference":[{"type":"exchange","rate":283.79}],"bitfinex_as_reference":[{"type":"exchange","rate":280.05}],"btce_as_reference":[{"type":"exchange","rate":273.999}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":281.68}]}},"ars":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":4128.058967841}],"bitstamp_as_reference":[{"type":"exchange","rate":4140.8326}],"itbit_as_reference":[{"type":"exchange","rate":4208.6057}],"bitfinex_as_reference":[{"type":"exchange","rate":4153.1415}],"btce_as_reference":[{"type":"exchange","rate":4063.40517}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":4177.3144}]}},"clp":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":189182.0653670323638}],"bitstamp_as_reference":[{"type":"exchange","rate":189767.45964868}],"itbit_as_reference":[{"type":"exchange","rate":192873.38791526}],"bitfinex_as_reference":[{"type":"exchange","rate":190331.5560297}],"btce_as_reference":[{"type":"exchange","rate":186219.089521806}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":191439.35976592}]}},"eur":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":254.8017257930244}],"bitstamp_as_reference":[{"type":"exchange","rate":255.59016984}],"itbit_as_reference":[{"type":"exchange","rate":259.77341988}],"bitfinex_as_reference":[{"type":"exchange","rate":256.3499286}],"btce_as_reference":[{"type":"exchange","rate":250.811012628}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":257.84198496}]}},"uyu":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":7923.649132539747}],"bitstamp_as_reference":[{"type":"exchange","rate":7948.1676242}],"itbit_as_reference":[{"type":"exchange","rate":8078.2554619}],"bitfinex_as_reference":[{"type":"exchange","rate":7971.7940805}],"btce_as_reference":[{"type":"exchange","rate":7799.54867439}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":8018.1930248}]}},"brl":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":982.4081663218203}],"bitstamp_as_reference":[{"type":"exchange","rate":985.44807458}],"itbit_as_reference":[{"type":"exchange","rate":1001.57692531}],"bitfinex_as_reference":[{"type":"exchange","rate":988.37738445}],"btce_as_reference":[{"type":"exchange","rate":967.021656711}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":994.13012552}]}},"cop":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":819637.289732311209}],"bitstamp_as_reference":[{"type":"exchange","rate":822173.5289974}],"itbit_as_reference":[{"type":"exchange","rate":835630.0615793}],"bitfinex_as_reference":[{"type":"exchange","rate":824617.4944335}],"btce_as_reference":[{"type":"exchange","rate":806800.10304333}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":829417.0892056}]}},"pen":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":890.6789660503131}],"bitstamp_as_reference":[{"type":"exchange","rate":893.43503266}],"itbit_as_reference":[{"type":"exchange","rate":908.05790387}],"bitfinex_as_reference":[{"type":"exchange","rate":896.09082765}],"btce_as_reference":[{"type":"exchange","rate":876.729122247}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":901.30642504}]}},"mxn":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":4542.944203835469}],"bitstamp_as_reference":[{"type":"exchange","rate":4557.0016334}],"itbit_as_reference":[{"type":"exchange","rate":4631.5861813}],"bitfinex_as_reference":[{"type":"exchange","rate":4570.5476235}],"btce_as_reference":[{"type":"exchange","rate":4471.79245953}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":4597.1499896}]}},"bob":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":1915.9680060024057}],"bitstamp_as_reference":[{"type":"exchange","rate":1921.89666902}],"itbit_as_reference":[{"type":"exchange","rate":1953.35239489}],"bitfinex_as_reference":[{"type":"exchange","rate":1927.60963455}],"btce_as_reference":[{"type":"exchange","rate":1885.960050909}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":1938.82907288}]}},"nio":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":7580.789200518903}],"bitstamp_as_reference":[{"type":"exchange","rate":7604.2467658}],"itbit_as_reference":[{"type":"exchange","rate":7728.7056431}],"bitfinex_as_reference":[{"type":"exchange","rate":7626.8508945}],"btce_as_reference":[{"type":"exchange","rate":7462.05862611}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":7671.2421352}]}},"hnl":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":6099.745748997402}],"bitstamp_as_reference":[{"type":"exchange","rate":6118.6204572}],"itbit_as_reference":[{"type":"exchange","rate":6218.7640554}],"bitfinex_as_reference":[{"type":"exchange","rate":6136.808463}],"btce_as_reference":[{"type":"exchange","rate":6004.21132674}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":6172.5270768}]}},"dop":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":12534.841313296002}],"bitstamp_as_reference":[{"type":"exchange","rate":12573.6284172}],"itbit_as_reference":[{"type":"exchange","rate":12779.4212754}],"bitfinex_as_reference":[{"type":"exchange","rate":12611.004363}],"btce_as_reference":[{"type":"exchange","rate":12338.52020874}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":12684.4053168}]}},"gbp":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":179.2902579277446}],"bitstamp_as_reference":[{"type":"exchange","rate":179.84504356}],"itbit_as_reference":[{"type":"exchange","rate":182.78857142}],"bitfinex_as_reference":[{"type":"exchange","rate":180.3796449}],"btce_as_reference":[{"type":"exchange","rate":176.482207902}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":181.42952464}]}},"cad":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":365.4108807208218}],"bitstamp_as_reference":[{"type":"exchange","rate":366.54158748}],"itbit_as_reference":[{"type":"exchange","rate":372.54078186}],"bitfinex_as_reference":[{"type":"exchange","rate":367.6311567}],"btce_as_reference":[{"type":"exchange","rate":359.687803266}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":369.77091312}]}},"vef":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":108502.8149271465}],"bitstamp_as_reference":[{"type":"exchange","rate":108838.5599}],"itbit_as_reference":[{"type":"exchange","rate":110619.92305}],"bitfinex_as_reference":[{"type":"exchange","rate":109162.08975}],"btce_as_reference":[{"type":"exchange","rate":106803.440205}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":109797.4556}]}}},"bitex":{"usd":{"bitex":{"orderbook":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5}]},"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1}]}},"eur":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":0.915372}]}},"uyu":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":28.46561}]}},"brl":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":3.529289}]}},"clp":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":679.634194}],"domestic_transfer":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"exchange","rate":679.634194}]}},"cop":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":2944.53667}]}},"pen":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":3.199753}]}},"mxn":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":16.32047}]}},"bob":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":6.883091}]}},"nio":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":27.23389}]}},"hnl":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":21.91326}]}},"dop":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":45.03126}]}},"gbp":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":0.644098}]}},"cad":{"bank":{"swift":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":1.312734}]}},"ars":{"bank":{"atm_deposit":[{"type":"exchange","rate":278.3586627},{"type":"percentual_fee","percentage":0.5},{"type":"exchange","rate":14.83},{"type":"percentual_fee","percentage":5}]}}},"bitstamp":{"usd":{"bitstamp":{"orderbook":[{"type":"exchange","rate":279.22},{"type":"percentual_fee","percentage":0.5}]},"bank":{"swift":[{"type":"exchange","rate":279.22},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"itbit":{"usd":{"itbit":{"orderbook":[{"type":"exchange","rate":283.79},{"type":"percentual_fee","percentage":0.5}]},"bank":{"swift":[{"type":"exchange","rate":283.79},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"bitfinex":{"usd":{"bitfinex":{"orderbook":[{"type":"exchange","rate":280.05},{"type":"percentual_fee","percentage":0.5}]},"bank":{"swift":[{"type":"exchange","rate":280.05},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"btce":{"usd":{"btce":{"orderbook":[{"type":"exchange","rate":273.999},{"type":"percentual_fee","percentage":0.5}]},"bank":{"swift":[{"type":"exchange","rate":273.999},{"type":"percentual_fee","percentage":0.5},{"type":"minimum_fee","minimum":100,"percentage":1}]}}}},"usd":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.00356972}],"bitstamp_as_reference":[{"type":"exchange","rate":0.00357795}],"itbit_as_reference":[{"type":"exchange","rate":0.00352162}],"bitfinex_as_reference":[{"type":"exchange","rate":0.00356633}],"btce_as_reference":[{"type":"exchange","rate":0.00364578}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.0035456}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":14.83}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":679.634194}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.915372}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":28.46561}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":3.529289}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":2944.53667}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":3.199753}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":16.32047}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":6.883091}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":27.23389}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":21.91326}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":45.03126}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.644098}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":1.312734}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":389.795}]}}},"bitex":{"btc":{"bitex":{"orderbook":[{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1}]}},"eur":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":0.915372}]}},"uyu":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":28.46561}]}},"brl":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":3.529289}]}},"clp":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":679.634194}],"domestic_transfer":[{"type":"exchange","rate":679.634194}]}},"cop":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":2944.53667}]}},"pen":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":3.199753}]}},"mxn":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":16.32047}]}},"bob":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":6.883091}]}},"nio":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":27.23389}]}},"hnl":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":21.91326}]}},"dop":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":45.03126}]}},"gbp":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":0.644098}]}},"cad":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1},{"type":"exchange","rate":1.312734}]}},"ars":{"bank":{"atm_deposit":[{"type":"exchange","rate":14.83},{"type":"percentual_fee","percentage":5}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8}]},"bitstamp":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8}]},"itbit":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8}]},"bitfinex":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8}]},"btce":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]},"bitstamp":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00357795},{"type":"percentual_fee","percentage":0.5}]},"itbit":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00352162},{"type":"percentual_fee","percentage":0.5}]},"bitfinex":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356633},{"type":"percentual_fee","percentage":0.5}]},"btce":{"swift":[{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00364578},{"type":"percentual_fee","percentage":0.5}]}}},"bitstamp":{"btc":{"bitstamp":{"orderbook":[{"type":"exchange","rate":0.00357795},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"itbit":{"btc":{"itbit":{"orderbook":[{"type":"exchange","rate":0.00352162},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"bitfinex":{"btc":{"bitfinex":{"orderbook":[{"type":"exchange","rate":0.00356633},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1}]}}},"btce":{"btc":{"btce":{"orderbook":[{"type":"exchange","rate":0.00364578},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"bank":{"swift":[{"type":"minimum_fee","minimum":100,"percentage":1}]}}}},"ars":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0002382990503124}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0002388484494765}],"itbit_as_reference":[{"type":"exchange","rate":0.0002350881025854}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0002380727485911}],"btce_as_reference":[{"type":"exchange","rate":0.0002433764865726}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000236688903552}]},"bitex":{"more_mt":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":3.63},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":5.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.06675567}]},"bitex":{"more_mt":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":3.63}],"astropay":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":5.5}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":45.36943597537998}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.06110627115924}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":1.9002408675087}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.23560005181863}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":196.5645182454189}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.21360165534951}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":1.0894839095649}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.45948535137597}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":1.8180165736563}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":1.4628343531842}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":3.0060919322442}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.04299719353566}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.08763243770178}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":26.02102638765}]}}},"bank":{"usd":{"bitex":{"astropay":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":5.5}]}},"btc":{"bitex":{"astropay":[{"type":"exchange","rate":0.06675567},{"type":"percentual_fee","percentage":5.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"clp":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0000052524146136}],"bitstamp_as_reference":[{"type":"exchange","rate":0.000005264524071}],"itbit_as_reference":[{"type":"exchange","rate":0.0000051816412356}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0000052474266354}],"btce_as_reference":[{"type":"exchange","rate":0.0000053643277764}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000005216924928}]},"bitex":{"more_mt":[{"type":"exchange","rate":0.00147138},{"type":"percentual_fee","percentage":3.57},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.00163486},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.00147138}]},"bitex":{"more_mt":[{"type":"exchange","rate":0.00147138},{"type":"percentual_fee","percentage":3.57}],"astropay":[{"type":"exchange","rate":0.00163486},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.0218205654}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.00134686005336}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":0.0418837292418}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.00519292524882}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":4.3325323655046}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.00470805256914}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.0240136131486}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.01012764243558}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":0.0400714010682}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.0322427324988}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":0.0662580953388}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.00094771291524}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.00193153055292}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":0.5735365671}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.00147138},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.00163486},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.00147138},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.00163486},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"eur":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0038997478605316}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0039087387407385}],"itbit_as_reference":[{"type":"exchange","rate":0.0038472009178886}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0038960444481499}],"btce_as_reference":[{"type":"exchange","rate":0.0039828397619334}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.003873397917568}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":1.09245203}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":16.2010636049}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":742.46775489271382}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":31.0973134296883}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":3.85557893250667}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":3216.7650625509401}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":3.49557666034859}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":17.8293305820541}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":7.51944673562473}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":29.7517184152967}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":23.9391853709178}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":49.1944914004578}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.70364616761894}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":1.43409892315002}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":425.83233903385}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":1.09245203},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":1.09245203},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"uyu":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0001254046562692}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0001256937770745}],"itbit_as_reference":[{"type":"exchange","rate":0.0001237148979782}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0001252855651963}],"btce_as_reference":[{"type":"exchange","rate":0.0001280766524358}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000124557318016}]},"bitex":{"astropay":[{"type":"exchange","rate":0.04040241},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.03513011}]},"bitex":{"astropay":[{"type":"exchange","rate":0.04040241},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.5209795313}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":23.87562399498134}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.03215711905092}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.12398431079179}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":103.4418971161337}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.11240767486283}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.5733399063517}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.24180374397001}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":0.9567295514279}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.7698152342586}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":1.5819531172386}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.02262723359078}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.04611648982074}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":13.69354122745}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.03513011},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.04040241},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.03513011},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.04040241},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"brl":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0010114558522068}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0010137877666605}],"itbit_as_reference":[{"type":"exchange","rate":0.0009978270447678}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0010104953187927}],"btce_as_reference":[{"type":"exchange","rate":0.0010330069352382}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.001004621614464}]},"bitex":{"astropay":[{"type":"exchange","rate":0.42053913},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.28334319}]},"bitex":{"astropay":[{"type":"exchange","rate":0.42053913},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":4.2019795077}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":192.56972056103886}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.25936442251668}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":8.0655367426959}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":834.3144131497773}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.90662822223207}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":4.6242940320993}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":1.95027696100029}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":7.7165372687091}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":6.2089729916994}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":12.7593008581194}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.18250078199262}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.37195423918146}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":110.44575874605}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.28334319},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.42053913},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.28334319},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.42053913},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"cop":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0000012123126092}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0000012151075995}],"itbit_as_reference":[{"type":"exchange","rate":0.0000011959773682}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0000012111613313}],"btce_as_reference":[{"type":"exchange","rate":0.0000012381433458}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000001204121216}]},"bitex":{"astropay":[{"type":"exchange","rate":0.00049841},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.00033961}]},"bitex":{"astropay":[{"type":"exchange","rate":0.00049841},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.0050364163}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":0.23081056862434}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.00031086948492}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":0.0096672058121}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.00119858183729}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.00108666811633}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.0055425948167}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.00233756653451}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":0.0092489013829}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.0074419622286}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":0.0152930662086}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.00021874212178}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.00044581759374}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":0.13237827995}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.00033961},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.00049841},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.00033961},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.00049841},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"pen":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0011156236016464}],"bitstamp_as_reference":[{"type":"exchange","rate":0.001118195675154}],"itbit_as_reference":[{"type":"exchange","rate":0.0011005911914744}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0011145641448796}],"btce_as_reference":[{"type":"exchange","rate":0.0011393941862136}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.001108085519872}]},"bitex":{"astropay":[{"type":"exchange","rate":0.33549166},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.31252412}]},"bitex":{"astropay":[{"type":"exchange","rate":0.33549166},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":4.6347326996}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":212.40207840175928}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.28607582877264}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":8.8961897155132}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":1.10298793895068}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":920.2387315994804}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":5.1005405247364}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":2.15113195765492}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":8.5112475064268}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":6.8484222978312}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":14.0733549039912}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.20129616064376}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.41026103814408}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":121.8203393554}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.31252412},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.33549166},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.31252412},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.33549166},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"mxn":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.00021872656113}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0002192308358625}],"itbit_as_reference":[{"type":"exchange","rate":0.000215779341855}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0002185188465075}],"btce_as_reference":[{"type":"exchange","rate":0.000223386966495}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.0002172486624}]},"bitex":{"astropay":[{"type":"exchange","rate":0.07274261},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.06127275}]},"bitex":{"astropay":[{"type":"exchange","rate":0.07274261},{"type":"percentual_fee","percentage":2.5}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.9086748825}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":41.6430560604135}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.056087359713}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":1.7441662051275}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.21624924257475}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":180.4198592467425}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.19605766563075}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.42174591407025}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":1.6686953334975}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":1.342685701665}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":2.759189136165}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.0394656557295}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.0804348221985}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":23.88381158625}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.06127275},{"type":"minimum_fee","minimum":60,"percentage":0.8}],"astropay":[{"type":"exchange","rate":0.07274261},{"type":"percentual_fee","percentage":2.5}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.06127275},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}],"astropay":[{"type":"exchange","rate":0.07274261},{"type":"percentual_fee","percentage":2.5},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"bob":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0005186216655004}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0005198173492815}],"itbit_as_reference":[{"type":"exchange","rate":0.0005116335257834}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0005181291541981}],"btce_as_reference":[{"type":"exchange","rate":0.0005296719338346}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000515117425792}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.14528357}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":2.1545553431}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":98.73968199839258}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.13298851203804}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":4.1355854430277}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.51274770548173}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":427.7927994135119}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.46487153895821}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":2.3710961456779}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":3.9566367641873}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":3.1836366431382}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":6.5423022143982}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.09357685686986}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.19071868198038}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":56.63080916815}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.14528357},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.14528357},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"nio":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0001310764058912}],"bitstamp_as_reference":[{"type":"exchange","rate":0.000131378602932}],"itbit_as_reference":[{"type":"exchange","rate":0.0001293102239152}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0001309519286168}],"btce_as_reference":[{"type":"exchange","rate":0.0001338692499888}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000130190744576}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.03671896}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.5445421768}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":24.95546078411824}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.03361150785312}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":1.0452275949656}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.12959182161944}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":108.1203242042632}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.11749160241688}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.5992706851112}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.25273994310536}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.8046321174096}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":1.6535010346896}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.02365060869808}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.04820222723664}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":14.3128670132}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.03671896},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.03671896},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"hnl":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0001629022802484}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0001632778519365}],"itbit_as_reference":[{"type":"exchange","rate":0.0001607072622414}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0001627475793951}],"btce_as_reference":[{"type":"exchange","rate":0.0001663732380366}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.000161801576832}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.04563447}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.6767591901}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":31.01474623706718}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.04177251607284}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":1.2990130255767}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.16105723299183}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":134.3723703310149}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.14601903228591}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.7447759986009}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.31410620974677}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":1.2428041361883}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":2.0549776835322}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.02939307085806}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.05990592034098}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":17.78808823365}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.04563447},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.04563447},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"dop":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.000079272058096}],"bitstamp_as_reference":[{"type":"exchange","rate":0.00007945482006}],"itbit_as_reference":[{"type":"exchange","rate":0.000078203911016}],"bitfinex_as_reference":[{"type":"exchange","rate":0.000079196777044}],"btce_as_reference":[{"type":"exchange","rate":0.000080961107304}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.00007873643008}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.0222068}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.329326844}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":15.0925006193192}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.0203274829296}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":0.632130108148}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.0783742149652}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":65.388736923356}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.0710562749204}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.362425413196}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.1528514252188}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":0.604777548452}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.486623382168}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.0143033554664}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.0291516213912}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":8.656099606}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.0222068},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.0222068},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"gbp":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.0055422000924444}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0055549776511215}],"itbit_as_reference":[{"type":"exchange","rate":0.0054675220156074}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0055369369182141}],"btce_as_reference":[{"type":"exchange","rate":0.0056602877124906}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.005504752374912}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":1.55255877}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":23.0244465591}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":1055.17202828658138}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":1.42116882641244}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":44.1945324488997}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":5.47942858881453}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":4571.5662305950959}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":4.96780458198381}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":25.3384888290219}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":10.68640329675807}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":42.2822147607153}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":34.0216239922902}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":69.9136776371502}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":2.03809668437718}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":605.17964575215}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":1.55255877},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":1.55255877},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"cad":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.002719301856194}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0027255712146525}],"itbit_as_reference":[{"type":"exchange","rate":0.002682660769699}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0027167194594535}],"btce_as_reference":[{"type":"exchange","rate":0.002777242002531}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.00270092798912}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.76176895}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":11.2970335285}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":517.7242263474763}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.6973019672994}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":21.6842178408095}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":2.68850277577655}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":2243.0566073423965}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":2.43747248306935}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":12.4324272954065}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":5.24332500382445}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":20.7459317897155}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":16.692841061277}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":34.303415647377}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.4906538571571}]}},"vef":{"cash":{"reference":[{"type":"exchange","rate":296.93372786525}]}}},"bank":{"usd":{"bitex":{"swift":[{"type":"exchange","rate":0.76176895},{"type":"minimum_fee","minimum":60,"percentage":0.8}]}},"btc":{"bitex":{"swift":[{"type":"exchange","rate":0.76176895},{"type":"minimum_fee","minimum":60,"percentage":0.8},{"type":"exchange","rate":0.00356972},{"type":"percentual_fee","percentage":0.5}]}}}},"vef":{"cash":{"btc":{"cash":{"bitex_as_reference":[{"type":"exchange","rate":0.000009157938174}],"bitstamp_as_reference":[{"type":"exchange","rate":0.0000091790518275}],"itbit_as_reference":[{"type":"exchange","rate":0.000009034540029}],"bitfinex_as_reference":[{"type":"exchange","rate":0.0000091492412985}],"btce_as_reference":[{"type":"exchange","rate":0.000009353066301}],"bitcoinaverage_as_reference":[{"type":"exchange","rate":0.00000909605952}]}},"usd":{"cash":{"reference":[{"type":"exchange","rate":0.00256545}]}},"ars":{"cash":{"reference":[{"type":"exchange","rate":0.0380456235}]}},"clp":{"cash":{"reference":[{"type":"exchange","rate":1.7435675429973}]}},"eur":{"cash":{"reference":[{"type":"exchange","rate":0.0023483410974}]}},"uyu":{"cash":{"reference":[{"type":"exchange","rate":0.0730270991745}]}},"brl":{"cash":{"reference":[{"type":"exchange","rate":0.00905421446505}]}},"cop":{"cash":{"reference":[{"type":"exchange","rate":7.5540616000515}]}},"pen":{"cash":{"reference":[{"type":"exchange","rate":0.00820880633385}]}},"mxn":{"cash":{"reference":[{"type":"exchange","rate":0.0418693497615}]}},"bob":{"cash":{"reference":[{"type":"exchange","rate":0.01765822580595}]}},"nio":{"cash":{"reference":[{"type":"exchange","rate":0.0698671831005}]}},"hnl":{"cash":{"reference":[{"type":"exchange","rate":0.056217372867}]}},"dop":{"cash":{"reference":[{"type":"exchange","rate":0.115525445967}]}},"gbp":{"cash":{"reference":[{"type":"exchange","rate":0.0016524012141}]}},"cad":{"cash":{"reference":[{"type":"exchange","rate":0.0033677534403}]}}}}}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bitex::Payment do
|
4
|
+
before :each do
|
5
|
+
Bitex.api_key = 'valid_api_key'
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:params_for_create) do
|
9
|
+
{
|
10
|
+
currency_id: 3,
|
11
|
+
amount: 1000,
|
12
|
+
callback_url: "https://example.com/ipn",
|
13
|
+
keep: 25.0,
|
14
|
+
customer_reference: "An Alto latte, no sugar",
|
15
|
+
merchant_reference: "invoice#1234",
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:as_json) do
|
20
|
+
{
|
21
|
+
id: 1,
|
22
|
+
user_id: 1,
|
23
|
+
amount: 100.00,
|
24
|
+
currency_id: 1,
|
25
|
+
expected_quantity: 0.02,
|
26
|
+
previous_expected_quantity: 0.018,
|
27
|
+
confirmed_quantity: 0.0,
|
28
|
+
unconfirmed_quantity: 0.0,
|
29
|
+
valid_until: 1430226201,
|
30
|
+
quote_valid_until: 1430226201,
|
31
|
+
last_quoted_on: 1430220201,
|
32
|
+
status: "pending",
|
33
|
+
address: {
|
34
|
+
"id": 4,
|
35
|
+
"public_address": "1ABC...",
|
36
|
+
},
|
37
|
+
settlement_currency_id: 2,
|
38
|
+
settlement_amount: 100,
|
39
|
+
keep: 1.5,
|
40
|
+
merchant_reference: "Invoice#1234",
|
41
|
+
customer_reference: "Frappuchino",
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
let(:callback_params) do
|
46
|
+
{ "api_key" => 'valid_api_key', "payment" => as_json}
|
47
|
+
end
|
48
|
+
|
49
|
+
{
|
50
|
+
id: 1,
|
51
|
+
user_id: 1,
|
52
|
+
amount: 100.00,
|
53
|
+
currency_id: 1,
|
54
|
+
expected_quantity: 0.02,
|
55
|
+
previous_expected_quantity: 0.018,
|
56
|
+
confirmed_quantity: 0.0,
|
57
|
+
unconfirmed_quantity: 0.0,
|
58
|
+
valid_until: Time.at(1430226201),
|
59
|
+
quote_valid_until: Time.at(1430226201),
|
60
|
+
last_quoted_on: Time.at(1430220201),
|
61
|
+
status: "pending",
|
62
|
+
address: {
|
63
|
+
"id": 4,
|
64
|
+
"public_address": "1ABC...",
|
65
|
+
},
|
66
|
+
settlement_currency_id: 2,
|
67
|
+
settlement_amount: 100,
|
68
|
+
keep: 1.5,
|
69
|
+
merchant_reference: "Invoice#1234",
|
70
|
+
customer_reference: "Frappuchino",
|
71
|
+
}.each do |field, value|
|
72
|
+
it "sets #{field}" do
|
73
|
+
subject.class.from_json(as_json).send(field).should == value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'creates a new payment' do
|
78
|
+
stub_private(:post, "/private/payments", 'payment',
|
79
|
+
params_for_create)
|
80
|
+
Bitex::Payment.create!(params_for_create)
|
81
|
+
.should be_a Bitex::Payment
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'finds a single payment' do
|
85
|
+
stub_private(:get, '/private/payments/1', 'payment')
|
86
|
+
Bitex::Payment.find(1).should be_a Bitex::Payment
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'lists all payments' do
|
90
|
+
stub_private(:get, '/private/payments', 'payments')
|
91
|
+
payments = Bitex::Payment.all
|
92
|
+
payments.should be_an Array
|
93
|
+
payments.first.should be_a Bitex::Payment
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'accepts a callback' do
|
97
|
+
Bitex::Payment
|
98
|
+
.from_callback(callback_params)
|
99
|
+
.should be_a Bitex::Payment
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'raises exception if invalid api key' do
|
103
|
+
Bitex::Payment
|
104
|
+
.from_callback(callback_params.merge("api_key" => 'bogus'))
|
105
|
+
.should be_nil
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'configures store' do
|
109
|
+
pos_params = {
|
110
|
+
"merchant_name" => "Tierra Buena",
|
111
|
+
"merchant_slug" => "tierrabuena",
|
112
|
+
"merchant_logo" => "https://t.co/logo.png",
|
113
|
+
"merchant_keep" => 0,
|
114
|
+
}
|
115
|
+
stub_private(:post, "/private/payments/pos_setup", 'pos_setup', pos_params.dup)
|
116
|
+
Bitex::Payment.pos_setup!(pos_params)
|
117
|
+
.should == pos_params
|
118
|
+
end
|
119
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nubis
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/bitex/market.rb
|
163
163
|
- lib/bitex/match.rb
|
164
164
|
- lib/bitex/order.rb
|
165
|
+
- lib/bitex/payment.rb
|
165
166
|
- lib/bitex/profile.rb
|
166
167
|
- lib/bitex/rates.rb
|
167
168
|
- lib/bitex/sell.rb
|
@@ -192,7 +193,11 @@ files:
|
|
192
193
|
- spec/fixtures/market_ticker.json
|
193
194
|
- spec/fixtures/order_book.json
|
194
195
|
- spec/fixtures/orders.json
|
196
|
+
- spec/fixtures/payment.json
|
197
|
+
- spec/fixtures/payments.json
|
198
|
+
- spec/fixtures/pos_setup.json
|
195
199
|
- spec/fixtures/profile.json
|
200
|
+
- spec/fixtures/rates_tree.json
|
196
201
|
- spec/fixtures/specie_deposit.json
|
197
202
|
- spec/fixtures/specie_deposits.json
|
198
203
|
- spec/fixtures/specie_withdrawal.json
|
@@ -207,6 +212,7 @@ files:
|
|
207
212
|
- spec/kyc_profile_spec.rb
|
208
213
|
- spec/market_spec.rb
|
209
214
|
- spec/order_spec.rb
|
215
|
+
- spec/payment_spec.rb
|
210
216
|
- spec/profile_spec.rb
|
211
217
|
- spec/rates_spec.rb
|
212
218
|
- spec/sell_spec.rb
|
@@ -265,7 +271,11 @@ test_files:
|
|
265
271
|
- spec/fixtures/market_ticker.json
|
266
272
|
- spec/fixtures/order_book.json
|
267
273
|
- spec/fixtures/orders.json
|
274
|
+
- spec/fixtures/payment.json
|
275
|
+
- spec/fixtures/payments.json
|
276
|
+
- spec/fixtures/pos_setup.json
|
268
277
|
- spec/fixtures/profile.json
|
278
|
+
- spec/fixtures/rates_tree.json
|
269
279
|
- spec/fixtures/specie_deposit.json
|
270
280
|
- spec/fixtures/specie_deposits.json
|
271
281
|
- spec/fixtures/specie_withdrawal.json
|
@@ -280,6 +290,7 @@ test_files:
|
|
280
290
|
- spec/kyc_profile_spec.rb
|
281
291
|
- spec/market_spec.rb
|
282
292
|
- spec/order_spec.rb
|
293
|
+
- spec/payment_spec.rb
|
283
294
|
- spec/profile_spec.rb
|
284
295
|
- spec/rates_spec.rb
|
285
296
|
- spec/sell_spec.rb
|