cryptopay-ruby 0.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +27 -15
- data/bin/console +2 -1
- data/cryptopay.gemspec +7 -7
- data/lib/cryptopay/api/coin_withdrawals.rb +7 -2
- data/lib/cryptopay/api/coins.rb +30 -0
- data/lib/cryptopay/client.rb +3 -1
- data/lib/cryptopay/models/account.rb +4 -0
- data/lib/cryptopay/models/account_list_result.rb +14 -2
- data/lib/cryptopay/models/channel.rb +20 -0
- data/lib/cryptopay/models/channel_params.rb +11 -0
- data/lib/cryptopay/models/channel_payment.rb +20 -0
- data/lib/cryptopay/models/channel_payment_callback.rb +0 -4
- data/lib/cryptopay/models/channel_update_params.rb +2 -0
- data/lib/cryptopay/models/channels_config.rb +64 -0
- data/lib/cryptopay/models/coin.rb +94 -0
- data/lib/cryptopay/models/coin_destination_tag.rb +72 -0
- data/lib/cryptopay/models/coin_list_result.rb +70 -0
- data/lib/cryptopay/models/coin_network.rb +128 -0
- data/lib/cryptopay/models/coin_withdrawal.rb +20 -0
- data/lib/cryptopay/models/coin_withdrawal_callback.rb +0 -4
- data/lib/cryptopay/models/coin_withdrawal_params.rb +14 -1
- data/lib/cryptopay/models/coin_withdrawals_config.rb +64 -0
- data/lib/cryptopay/models/customer.rb +12 -4
- data/lib/cryptopay/models/customer_address.rb +83 -0
- data/lib/cryptopay/models/customer_params.rb +11 -5
- data/lib/cryptopay/models/customer_update_params.rb +14 -6
- data/lib/cryptopay/models/exchange_transfer.rb +6 -0
- data/lib/cryptopay/models/exchange_transfer_params.rb +6 -0
- data/lib/cryptopay/models/invoice.rb +10 -1
- data/lib/cryptopay/models/invoice_callback.rb +0 -2
- data/lib/cryptopay/models/invoice_params.rb +8 -1
- data/lib/cryptopay/models/invoice_recalculation_params.rb +1 -1
- data/lib/cryptopay/models/invoice_refund.rb +9 -0
- data/lib/cryptopay/models/invoices_config.rb +64 -0
- data/lib/cryptopay/models/network_fee.rb +10 -2
- data/lib/cryptopay/models/risk_params.rb +1 -1
- data/lib/cryptopay/models/risk_type.rb +18 -0
- data/lib/cryptopay/models/transaction.rb +13 -0
- data/lib/cryptopay/require.rb +10 -0
- data/lib/cryptopay/version.rb +1 -1
- data/lib/cryptopay.rb +8 -9
- metadata +41 -31
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Auto-generated file
|
4
|
+
# DO NOT EDIT
|
5
|
+
|
6
|
+
module Cryptopay
|
7
|
+
class CustomerAddress
|
8
|
+
ENCODER = Encoder.new(
|
9
|
+
name: 'Cryptopay::CustomerAddress',
|
10
|
+
attribute_map: {
|
11
|
+
'address': :address,
|
12
|
+
'currency': :currency,
|
13
|
+
'network': :network
|
14
|
+
},
|
15
|
+
types: {
|
16
|
+
'address': :String,
|
17
|
+
'currency': :String,
|
18
|
+
'network': :String
|
19
|
+
},
|
20
|
+
nullables: []
|
21
|
+
)
|
22
|
+
private_constant :ENCODER
|
23
|
+
|
24
|
+
# Initializes the object
|
25
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
26
|
+
def initialize(attributes = {})
|
27
|
+
@attributes = ENCODER.sanitize(attributes)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Cryptocurrency address
|
31
|
+
def address
|
32
|
+
@attributes[:address]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Cryptocurrency name
|
36
|
+
def currency
|
37
|
+
@attributes[:currency]
|
38
|
+
end
|
39
|
+
|
40
|
+
# Cryptocurrency network
|
41
|
+
def network
|
42
|
+
@attributes[:network]
|
43
|
+
end
|
44
|
+
|
45
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
46
|
+
# @return Array for valid properties with the reasons
|
47
|
+
def invalid_properties
|
48
|
+
properties = []
|
49
|
+
|
50
|
+
properties.push('invalid value for "address", address cannot be nil.') if address.nil?
|
51
|
+
|
52
|
+
properties.push('invalid value for "currency", currency cannot be nil.') if currency.nil?
|
53
|
+
|
54
|
+
properties.push('invalid value for "network", network cannot be nil.') if network.nil?
|
55
|
+
|
56
|
+
properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Check to see if the all the properties in the model are valid
|
60
|
+
# @return true if the model is valid
|
61
|
+
def valid?
|
62
|
+
invalid_properties.empty?
|
63
|
+
end
|
64
|
+
|
65
|
+
# Builds the object from hash
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
67
|
+
# @return [Cryptopay::CustomerAddress] Returns the model itself
|
68
|
+
def self.build_from_hash(data)
|
69
|
+
attributes = ENCODER.build_from_hash(data)
|
70
|
+
new(attributes)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Returns the object in the form of hash
|
74
|
+
# @return [Hash] Returns the object in the form of hash
|
75
|
+
def to_hash
|
76
|
+
ENCODER.to_hash(@attributes)
|
77
|
+
end
|
78
|
+
|
79
|
+
def inspect
|
80
|
+
"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -10,12 +10,12 @@ module Cryptopay
|
|
10
10
|
attribute_map: {
|
11
11
|
'id': :id,
|
12
12
|
'currency': :currency,
|
13
|
-
'
|
13
|
+
'addresses': :addresses
|
14
14
|
},
|
15
15
|
types: {
|
16
16
|
'id': :String,
|
17
17
|
'currency': :String,
|
18
|
-
'
|
18
|
+
'addresses': :'Array<CustomerAddress>'
|
19
19
|
},
|
20
20
|
nullables: []
|
21
21
|
)
|
@@ -37,9 +37,9 @@ module Cryptopay
|
|
37
37
|
@attributes[:currency]
|
38
38
|
end
|
39
39
|
|
40
|
-
# This
|
41
|
-
def
|
42
|
-
@attributes[:
|
40
|
+
# This array allows you to specify 1 cryptocurrency address for each type of supported cryptocurrencies i.e. BTC, ETH, XRP, LTC and BCH. In case Cryptopay detects a High-Risk transaction, such transaction will not be processed. Instead, it will be sent to the address specified for respective cryptocurrency. If you do not specify any addresses here, High-Risk payments will be put on hold
|
41
|
+
def addresses
|
42
|
+
@attributes[:addresses]
|
43
43
|
end
|
44
44
|
|
45
45
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -51,6 +51,12 @@ module Cryptopay
|
|
51
51
|
|
52
52
|
properties.push('invalid value for "currency", currency cannot be nil.') if currency.nil?
|
53
53
|
|
54
|
+
addresses&.each_with_index do |item, index|
|
55
|
+
item.invalid_properties.each do |prop|
|
56
|
+
properties.push("invalid value for \"addresses.#{index}\": #{prop}")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
54
60
|
properties
|
55
61
|
end
|
56
62
|
|
@@ -9,11 +9,11 @@ module Cryptopay
|
|
9
9
|
name: 'Cryptopay::CustomerUpdateParams',
|
10
10
|
attribute_map: {
|
11
11
|
'currency': :currency,
|
12
|
-
'
|
12
|
+
'addresses': :addresses
|
13
13
|
},
|
14
14
|
types: {
|
15
15
|
'currency': :String,
|
16
|
-
'
|
16
|
+
'addresses': :'Array<CustomerAddress>'
|
17
17
|
},
|
18
18
|
nullables: []
|
19
19
|
)
|
@@ -30,15 +30,23 @@ module Cryptopay
|
|
30
30
|
@attributes[:currency]
|
31
31
|
end
|
32
32
|
|
33
|
-
# This
|
34
|
-
def
|
35
|
-
@attributes[:
|
33
|
+
# This array allows you to specify 1 cryptocurrency address for each type of supported cryptocurrencies i.e. BTC, ETH, XRP, LTC and BCH. In case Cryptopay detects a High-Risk transaction, such transaction will not be processed. Instead, it will be sent to the address specified for respective cryptocurrency. If you do not specify any addresses here, High-Risk payments will be put on hold
|
34
|
+
def addresses
|
35
|
+
@attributes[:addresses]
|
36
36
|
end
|
37
37
|
|
38
38
|
# Show invalid properties with the reasons. Usually used together with valid?
|
39
39
|
# @return Array for valid properties with the reasons
|
40
40
|
def invalid_properties
|
41
|
-
[]
|
41
|
+
properties = []
|
42
|
+
|
43
|
+
addresses&.each_with_index do |item, index|
|
44
|
+
item.invalid_properties.each do |prop|
|
45
|
+
properties.push("invalid value for \"addresses.#{index}\": #{prop}")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
properties
|
42
50
|
end
|
43
51
|
|
44
52
|
# Check to see if the all the properties in the model are valid
|
@@ -37,26 +37,32 @@ module Cryptopay
|
|
37
37
|
@attributes = ENCODER.sanitize(attributes)
|
38
38
|
end
|
39
39
|
|
40
|
+
# Exchange transaction ID
|
40
41
|
def id
|
41
42
|
@attributes[:id]
|
42
43
|
end
|
43
44
|
|
45
|
+
# Amount converted
|
44
46
|
def charged_amount
|
45
47
|
@attributes[:charged_amount]
|
46
48
|
end
|
47
49
|
|
50
|
+
# Account currency the funds converted from
|
48
51
|
def charged_currency
|
49
52
|
@attributes[:charged_currency]
|
50
53
|
end
|
51
54
|
|
55
|
+
# Amount to be received upon exchange execution
|
52
56
|
def received_amount
|
53
57
|
@attributes[:received_amount]
|
54
58
|
end
|
55
59
|
|
60
|
+
# Account currency the funds converted to
|
56
61
|
def received_currency
|
57
62
|
@attributes[:received_currency]
|
58
63
|
end
|
59
64
|
|
65
|
+
# Exchange transaction reference ID in your system
|
60
66
|
def custom_id
|
61
67
|
@attributes[:custom_id]
|
62
68
|
end
|
@@ -36,26 +36,32 @@ module Cryptopay
|
|
36
36
|
@attributes = ENCODER.sanitize(attributes)
|
37
37
|
end
|
38
38
|
|
39
|
+
# Account currency the funds to be converted from
|
39
40
|
def charged_currency
|
40
41
|
@attributes[:charged_currency]
|
41
42
|
end
|
42
43
|
|
44
|
+
# Amount to be converted
|
43
45
|
def charged_amount
|
44
46
|
@attributes[:charged_amount]
|
45
47
|
end
|
46
48
|
|
49
|
+
# Account currency the funds to be converted to
|
47
50
|
def received_currency
|
48
51
|
@attributes[:received_currency]
|
49
52
|
end
|
50
53
|
|
54
|
+
# Amount to be received upon exchange execution
|
51
55
|
def received_amount
|
52
56
|
@attributes[:received_amount]
|
53
57
|
end
|
54
58
|
|
59
|
+
# Exchange transaction reference ID in your system
|
55
60
|
def custom_id
|
56
61
|
@attributes[:custom_id]
|
57
62
|
end
|
58
63
|
|
64
|
+
# Is `false` if omitted. Set `true` to turn off two-step exchange. Set `false` for two-step exchange and commit it within 30 seconds
|
59
65
|
def force_commit
|
60
66
|
@attributes[:force_commit]
|
61
67
|
end
|
@@ -14,6 +14,7 @@ module Cryptopay
|
|
14
14
|
'status': :status,
|
15
15
|
'status_context': :status_context,
|
16
16
|
'address': :address,
|
17
|
+
'network': :network,
|
17
18
|
'uri': :uri,
|
18
19
|
'price_amount': :price_amount,
|
19
20
|
'price_currency': :price_currency,
|
@@ -40,6 +41,7 @@ module Cryptopay
|
|
40
41
|
'status': :InvoiceStatus,
|
41
42
|
'status_context': :InvoiceStatusContext,
|
42
43
|
'address': :String,
|
44
|
+
'network': :String,
|
43
45
|
'uri': :String,
|
44
46
|
'price_amount': :Decimal,
|
45
47
|
'price_currency': :String,
|
@@ -52,7 +54,7 @@ module Cryptopay
|
|
52
54
|
'transactions': :'Array<InvoiceTransaction>',
|
53
55
|
'name': :String,
|
54
56
|
'description': :String,
|
55
|
-
'metadata': :
|
57
|
+
'metadata': :'Hash<String, String>',
|
56
58
|
'success_redirect_url': :String,
|
57
59
|
'unsuccess_redirect_url': :String,
|
58
60
|
'hosted_page_url': :String,
|
@@ -106,6 +108,11 @@ module Cryptopay
|
|
106
108
|
@attributes[:address]
|
107
109
|
end
|
108
110
|
|
111
|
+
# Cryptocurrency network
|
112
|
+
def network
|
113
|
+
@attributes[:network]
|
114
|
+
end
|
115
|
+
|
109
116
|
# Invoice URI. May be used for generating a QR code
|
110
117
|
def uri
|
111
118
|
@attributes[:uri]
|
@@ -212,6 +219,8 @@ module Cryptopay
|
|
212
219
|
|
213
220
|
properties.push('invalid value for "address", address cannot be nil.') if address.nil?
|
214
221
|
|
222
|
+
properties.push('invalid value for "network", network cannot be nil.') if network.nil?
|
223
|
+
|
215
224
|
properties.push('invalid value for "uri", uri cannot be nil.') if uri.nil?
|
216
225
|
|
217
226
|
properties.push('invalid value for "price_amount", price_amount cannot be nil.') if price_amount.nil?
|
@@ -46,8 +46,6 @@ module Cryptopay
|
|
46
46
|
|
47
47
|
properties.push('invalid value for "type", type cannot be nil.') if type.nil?
|
48
48
|
|
49
|
-
properties.push('invalid value for type, must be one of "Invoice"') if !type.nil? && !['Invoice'].include?(type)
|
50
|
-
|
51
49
|
properties.push('invalid value for "event", event cannot be nil.') if event.nil?
|
52
50
|
|
53
51
|
if !event.nil? && !%w[created refunded recalculated status_changed transaction_created transaction_confirmed].include?(event)
|
@@ -11,6 +11,7 @@ module Cryptopay
|
|
11
11
|
'price_amount': :price_amount,
|
12
12
|
'price_currency': :price_currency,
|
13
13
|
'pay_currency': :pay_currency,
|
14
|
+
'network': :network,
|
14
15
|
'custom_id': :custom_id,
|
15
16
|
'customer_id': :customer_id,
|
16
17
|
'name': :name,
|
@@ -23,11 +24,12 @@ module Cryptopay
|
|
23
24
|
'price_amount': :Decimal,
|
24
25
|
'price_currency': :String,
|
25
26
|
'pay_currency': :String,
|
27
|
+
'network': :String,
|
26
28
|
'custom_id': :String,
|
27
29
|
'customer_id': :String,
|
28
30
|
'name': :String,
|
29
31
|
'description': :String,
|
30
|
-
'metadata': :
|
32
|
+
'metadata': :'Hash<String, String>',
|
31
33
|
'success_redirect_url': :String,
|
32
34
|
'unsuccess_redirect_url': :String
|
33
35
|
},
|
@@ -56,6 +58,11 @@ module Cryptopay
|
|
56
58
|
@attributes[:pay_currency]
|
57
59
|
end
|
58
60
|
|
61
|
+
# Cryptocurrency network
|
62
|
+
def network
|
63
|
+
@attributes[:network]
|
64
|
+
end
|
65
|
+
|
59
66
|
# The payment reference ID in your system
|
60
67
|
def custom_id
|
61
68
|
@attributes[:custom_id]
|
@@ -23,7 +23,7 @@ module Cryptopay
|
|
23
23
|
@attributes = ENCODER.sanitize(attributes)
|
24
24
|
end
|
25
25
|
|
26
|
-
# Set `true`
|
26
|
+
# Is `false` if omitted. Set `true` to turn off two-step recalculation. Set `false` for two-step recalculation and commit it within 30 seconds
|
27
27
|
def force_commit
|
28
28
|
@attributes[:force_commit]
|
29
29
|
end
|
@@ -16,6 +16,7 @@ module Cryptopay
|
|
16
16
|
'fee': :fee,
|
17
17
|
'fee_currency': :fee_currency,
|
18
18
|
'address': :address,
|
19
|
+
'network': :network,
|
19
20
|
'txid': :txid,
|
20
21
|
'risk': :risk,
|
21
22
|
'created_at': :created_at
|
@@ -29,6 +30,7 @@ module Cryptopay
|
|
29
30
|
'fee': :Decimal,
|
30
31
|
'fee_currency': :String,
|
31
32
|
'address': :String,
|
33
|
+
'network': :String,
|
32
34
|
'txid': :String,
|
33
35
|
'risk': :Risk,
|
34
36
|
'created_at': :Time
|
@@ -87,6 +89,11 @@ module Cryptopay
|
|
87
89
|
@attributes[:address]
|
88
90
|
end
|
89
91
|
|
92
|
+
# Cryptocurrency network
|
93
|
+
def network
|
94
|
+
@attributes[:network]
|
95
|
+
end
|
96
|
+
|
90
97
|
# Cryptocurrency transaction ID on the blockchain
|
91
98
|
def txid
|
92
99
|
@attributes[:txid]
|
@@ -118,6 +125,8 @@ module Cryptopay
|
|
118
125
|
|
119
126
|
properties.push('invalid value for "fee_currency", fee_currency cannot be nil.') if fee_currency.nil?
|
120
127
|
|
128
|
+
properties.push('invalid value for "network", network cannot be nil.') if network.nil?
|
129
|
+
|
121
130
|
risk&.invalid_properties&.each do |prop|
|
122
131
|
properties.push("invalid value for \"risk\": #{prop}")
|
123
132
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Auto-generated file
|
4
|
+
# DO NOT EDIT
|
5
|
+
|
6
|
+
module Cryptopay
|
7
|
+
class InvoicesConfig
|
8
|
+
ENCODER = Encoder.new(
|
9
|
+
name: 'Cryptopay::InvoicesConfig',
|
10
|
+
attribute_map: {
|
11
|
+
'enabled': :enabled
|
12
|
+
},
|
13
|
+
types: {
|
14
|
+
'enabled': :Boolean
|
15
|
+
},
|
16
|
+
nullables: []
|
17
|
+
)
|
18
|
+
private_constant :ENCODER
|
19
|
+
|
20
|
+
# Initializes the object
|
21
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
+
def initialize(attributes = {})
|
23
|
+
@attributes = ENCODER.sanitize(attributes)
|
24
|
+
end
|
25
|
+
|
26
|
+
def enabled
|
27
|
+
@attributes[:enabled]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
31
|
+
# @return Array for valid properties with the reasons
|
32
|
+
def invalid_properties
|
33
|
+
properties = []
|
34
|
+
|
35
|
+
properties.push('invalid value for "enabled", enabled cannot be nil.') if enabled.nil?
|
36
|
+
|
37
|
+
properties
|
38
|
+
end
|
39
|
+
|
40
|
+
# Check to see if the all the properties in the model are valid
|
41
|
+
# @return true if the model is valid
|
42
|
+
def valid?
|
43
|
+
invalid_properties.empty?
|
44
|
+
end
|
45
|
+
|
46
|
+
# Builds the object from hash
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
# @return [Cryptopay::InvoicesConfig] Returns the model itself
|
49
|
+
def self.build_from_hash(data)
|
50
|
+
attributes = ENCODER.build_from_hash(data)
|
51
|
+
new(attributes)
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns the object in the form of hash
|
55
|
+
# @return [Hash] Returns the object in the form of hash
|
56
|
+
def to_hash
|
57
|
+
ENCODER.to_hash(@attributes)
|
58
|
+
end
|
59
|
+
|
60
|
+
def inspect
|
61
|
+
"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -10,12 +10,14 @@ module Cryptopay
|
|
10
10
|
attribute_map: {
|
11
11
|
'level': :level,
|
12
12
|
'fee': :fee,
|
13
|
-
'currency': :currency
|
13
|
+
'currency': :currency,
|
14
|
+
'network': :network
|
14
15
|
},
|
15
16
|
types: {
|
16
17
|
'level': :NetworkFeeLevel,
|
17
18
|
'fee': :Decimal,
|
18
|
-
'currency': :String
|
19
|
+
'currency': :String,
|
20
|
+
'network': :String
|
19
21
|
},
|
20
22
|
nullables: []
|
21
23
|
)
|
@@ -39,6 +41,10 @@ module Cryptopay
|
|
39
41
|
@attributes[:currency]
|
40
42
|
end
|
41
43
|
|
44
|
+
def network
|
45
|
+
@attributes[:network]
|
46
|
+
end
|
47
|
+
|
42
48
|
# Show invalid properties with the reasons. Usually used together with valid?
|
43
49
|
# @return Array for valid properties with the reasons
|
44
50
|
def invalid_properties
|
@@ -54,6 +60,8 @@ module Cryptopay
|
|
54
60
|
|
55
61
|
properties.push('invalid value for "currency", currency cannot be nil.') if currency.nil?
|
56
62
|
|
63
|
+
properties.push('invalid value for "network", network cannot be nil.') if network.nil?
|
64
|
+
|
57
65
|
properties
|
58
66
|
end
|
59
67
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Auto-generated file
|
4
|
+
# DO NOT EDIT
|
5
|
+
|
6
|
+
module Cryptopay
|
7
|
+
module RiskType
|
8
|
+
SOURCE_OF_FUNDS = 'source_of_funds'
|
9
|
+
DESTINATION_OF_FUNDS = 'destination_of_funds'
|
10
|
+
|
11
|
+
# Builds the enum from string
|
12
|
+
# @param [String] The enum value in the form of the string
|
13
|
+
# @return [String] The enum value
|
14
|
+
def self.build_from_hash(value)
|
15
|
+
value
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -57,38 +57,47 @@ module Cryptopay
|
|
57
57
|
@attributes = ENCODER.sanitize(attributes)
|
58
58
|
end
|
59
59
|
|
60
|
+
# Account transaction ID
|
60
61
|
def id
|
61
62
|
@attributes[:id]
|
62
63
|
end
|
63
64
|
|
65
|
+
# Transaction description
|
64
66
|
def custom_id
|
65
67
|
@attributes[:custom_id]
|
66
68
|
end
|
67
69
|
|
70
|
+
# The reference ID of your customer
|
68
71
|
def customer_id
|
69
72
|
@attributes[:customer_id]
|
70
73
|
end
|
71
74
|
|
75
|
+
# Transaction amount
|
72
76
|
def amount
|
73
77
|
@attributes[:amount]
|
74
78
|
end
|
75
79
|
|
80
|
+
# Transaction currency
|
76
81
|
def currency
|
77
82
|
@attributes[:currency]
|
78
83
|
end
|
79
84
|
|
85
|
+
# Account subtotal
|
80
86
|
def balance
|
81
87
|
@attributes[:balance]
|
82
88
|
end
|
83
89
|
|
90
|
+
# Transaction fee details
|
84
91
|
def fee
|
85
92
|
@attributes[:fee]
|
86
93
|
end
|
87
94
|
|
95
|
+
# Transaction fee currency
|
88
96
|
def fee_currency
|
89
97
|
@attributes[:fee_currency]
|
90
98
|
end
|
91
99
|
|
100
|
+
# Transaction reference ID in Cryptopay
|
92
101
|
def reference_id
|
93
102
|
@attributes[:reference_id]
|
94
103
|
end
|
@@ -97,14 +106,17 @@ module Cryptopay
|
|
97
106
|
@attributes[:reference_type]
|
98
107
|
end
|
99
108
|
|
109
|
+
# Transaction description
|
100
110
|
def description
|
101
111
|
@attributes[:description]
|
102
112
|
end
|
103
113
|
|
114
|
+
# Transaction status
|
104
115
|
def status
|
105
116
|
@attributes[:status]
|
106
117
|
end
|
107
118
|
|
119
|
+
# Transaction status context
|
108
120
|
def status_context
|
109
121
|
@attributes[:status_context]
|
110
122
|
end
|
@@ -113,6 +125,7 @@ module Cryptopay
|
|
113
125
|
@attributes[:risk]
|
114
126
|
end
|
115
127
|
|
128
|
+
# Transaction creation date and time
|
116
129
|
def created_at
|
117
130
|
@attributes[:created_at]
|
118
131
|
end
|
data/lib/cryptopay/require.rb
CHANGED
@@ -20,6 +20,11 @@ require 'cryptopay/models/channel_payment_status_context'
|
|
20
20
|
require 'cryptopay/models/channel_result'
|
21
21
|
require 'cryptopay/models/channel_status'
|
22
22
|
require 'cryptopay/models/channel_update_params'
|
23
|
+
require 'cryptopay/models/channels_config'
|
24
|
+
require 'cryptopay/models/coin'
|
25
|
+
require 'cryptopay/models/coin_destination_tag'
|
26
|
+
require 'cryptopay/models/coin_list_result'
|
27
|
+
require 'cryptopay/models/coin_network'
|
23
28
|
require 'cryptopay/models/coin_withdrawal'
|
24
29
|
require 'cryptopay/models/coin_withdrawal_callback'
|
25
30
|
require 'cryptopay/models/coin_withdrawal_callback_event'
|
@@ -27,7 +32,9 @@ require 'cryptopay/models/coin_withdrawal_list_result'
|
|
27
32
|
require 'cryptopay/models/coin_withdrawal_params'
|
28
33
|
require 'cryptopay/models/coin_withdrawal_result'
|
29
34
|
require 'cryptopay/models/coin_withdrawal_status'
|
35
|
+
require 'cryptopay/models/coin_withdrawals_config'
|
30
36
|
require 'cryptopay/models/customer'
|
37
|
+
require 'cryptopay/models/customer_address'
|
31
38
|
require 'cryptopay/models/customer_list_result'
|
32
39
|
require 'cryptopay/models/customer_params'
|
33
40
|
require 'cryptopay/models/customer_result'
|
@@ -52,6 +59,7 @@ require 'cryptopay/models/invoice_result'
|
|
52
59
|
require 'cryptopay/models/invoice_status'
|
53
60
|
require 'cryptopay/models/invoice_status_context'
|
54
61
|
require 'cryptopay/models/invoice_transaction'
|
62
|
+
require 'cryptopay/models/invoices_config'
|
55
63
|
require 'cryptopay/models/network_fee'
|
56
64
|
require 'cryptopay/models/network_fee_level'
|
57
65
|
require 'cryptopay/models/network_fee_list_result'
|
@@ -63,6 +71,7 @@ require 'cryptopay/models/risk'
|
|
63
71
|
require 'cryptopay/models/risk_level'
|
64
72
|
require 'cryptopay/models/risk_params'
|
65
73
|
require 'cryptopay/models/risk_result'
|
74
|
+
require 'cryptopay/models/risk_type'
|
66
75
|
require 'cryptopay/models/transaction'
|
67
76
|
require 'cryptopay/models/transaction_list_result'
|
68
77
|
require 'cryptopay/models/transaction_reference_type'
|
@@ -71,6 +80,7 @@ require 'cryptopay/models/transaction_reference_type'
|
|
71
80
|
require 'cryptopay/api/accounts'
|
72
81
|
require 'cryptopay/api/channels'
|
73
82
|
require 'cryptopay/api/coin_withdrawals'
|
83
|
+
require 'cryptopay/api/coins'
|
74
84
|
require 'cryptopay/api/customers'
|
75
85
|
require 'cryptopay/api/exchange_transfers'
|
76
86
|
require 'cryptopay/api/invoices'
|
data/lib/cryptopay/version.rb
CHANGED
data/lib/cryptopay.rb
CHANGED
@@ -2,23 +2,22 @@
|
|
2
2
|
|
3
3
|
require 'base64'
|
4
4
|
require 'cgi'
|
5
|
+
require 'date'
|
5
6
|
require 'faraday'
|
6
7
|
require 'json'
|
7
|
-
require 'date'
|
8
8
|
require 'time'
|
9
9
|
|
10
|
-
# Common files
|
11
|
-
require 'cryptopay/version'
|
12
|
-
require 'cryptopay/encoder'
|
13
|
-
require 'cryptopay/require'
|
14
|
-
require 'cryptopay/config'
|
15
10
|
require 'cryptopay/authentication'
|
16
|
-
require 'cryptopay/connection'
|
17
|
-
require 'cryptopay/types'
|
18
|
-
require 'cryptopay/request'
|
19
11
|
require 'cryptopay/callbacks'
|
20
12
|
require 'cryptopay/client'
|
13
|
+
require 'cryptopay/config'
|
14
|
+
require 'cryptopay/connection'
|
15
|
+
require 'cryptopay/encoder'
|
21
16
|
require 'cryptopay/errors'
|
17
|
+
require 'cryptopay/request'
|
18
|
+
require 'cryptopay/require'
|
19
|
+
require 'cryptopay/types'
|
20
|
+
require 'cryptopay/version'
|
22
21
|
|
23
22
|
module Cryptopay
|
24
23
|
PRODUCTION = 'https://business.cryptopay.me'
|