cryptopay-ruby 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -1
- data/.rubocop.yml +3 -0
- data/README.md +69 -5
- data/bin/console +2 -1
- data/lib/cryptopay/api/invoices.rb +2 -0
- data/lib/cryptopay/api/subscriptions.rb +99 -0
- data/lib/cryptopay/client.rb +4 -2
- data/lib/cryptopay/models/account.rb +8 -8
- data/lib/cryptopay/models/account_list_result.rb +8 -8
- data/lib/cryptopay/models/callback.rb +3 -1
- data/lib/cryptopay/models/channel.rb +8 -8
- data/lib/cryptopay/models/channel_list_result.rb +8 -8
- data/lib/cryptopay/models/channel_params.rb +8 -8
- data/lib/cryptopay/models/channel_payment.rb +8 -8
- data/lib/cryptopay/models/channel_payment_callback.rb +8 -8
- data/lib/cryptopay/models/channel_payment_list_result.rb +8 -8
- data/lib/cryptopay/models/channel_payment_result.rb +8 -8
- data/lib/cryptopay/models/channel_result.rb +8 -8
- data/lib/cryptopay/models/channel_update_params.rb +8 -8
- data/lib/cryptopay/models/channels_config.rb +8 -8
- data/lib/cryptopay/models/coin.rb +8 -8
- data/lib/cryptopay/models/coin_destination_tag.rb +8 -8
- data/lib/cryptopay/models/coin_list_result.rb +8 -8
- data/lib/cryptopay/models/coin_network.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawal.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawal_callback.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawal_list_result.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawal_params.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawal_result.rb +8 -8
- data/lib/cryptopay/models/coin_withdrawals_config.rb +8 -8
- data/lib/cryptopay/models/customer.rb +19 -13
- data/lib/cryptopay/models/customer_address.rb +83 -0
- data/lib/cryptopay/models/customer_list_result.rb +8 -8
- data/lib/cryptopay/models/customer_params.rb +19 -13
- data/lib/cryptopay/models/customer_result.rb +8 -8
- data/lib/cryptopay/models/customer_update_params.rb +22 -14
- data/lib/cryptopay/models/exchange.rb +8 -8
- data/lib/cryptopay/models/exchange_transfer.rb +8 -8
- data/lib/cryptopay/models/exchange_transfer_params.rb +8 -8
- data/lib/cryptopay/models/exchange_transfer_result.rb +8 -8
- data/lib/cryptopay/models/invoice.rb +15 -8
- data/lib/cryptopay/models/invoice_callback.rb +8 -8
- data/lib/cryptopay/models/invoice_list_result.rb +8 -8
- data/lib/cryptopay/models/invoice_params.rb +17 -10
- data/lib/cryptopay/models/invoice_recalculation.rb +8 -8
- data/lib/cryptopay/models/invoice_recalculation_params.rb +8 -8
- data/lib/cryptopay/models/invoice_recalculation_result.rb +8 -8
- data/lib/cryptopay/models/invoice_refund.rb +8 -8
- data/lib/cryptopay/models/invoice_refund_list_result.rb +8 -8
- data/lib/cryptopay/models/invoice_refund_params.rb +8 -8
- data/lib/cryptopay/models/invoice_refund_result.rb +8 -8
- data/lib/cryptopay/models/invoice_result.rb +8 -8
- data/lib/cryptopay/models/invoice_transaction.rb +8 -8
- data/lib/cryptopay/models/invoices_config.rb +8 -8
- data/lib/cryptopay/models/network_fee.rb +8 -8
- data/lib/cryptopay/models/network_fee_list_result.rb +8 -8
- data/lib/cryptopay/models/pagination.rb +8 -8
- data/lib/cryptopay/models/rate.rb +8 -8
- data/lib/cryptopay/models/rate_result.rb +8 -8
- data/lib/cryptopay/models/rates_result.rb +8 -8
- data/lib/cryptopay/models/risk.rb +8 -8
- data/lib/cryptopay/models/risk_params.rb +8 -8
- data/lib/cryptopay/models/risk_result.rb +8 -8
- data/lib/cryptopay/models/subscription.rb +222 -0
- data/lib/cryptopay/models/subscription_callback.rb +88 -0
- data/lib/cryptopay/models/subscription_callback_event.rb +18 -0
- data/lib/cryptopay/models/subscription_list_result.rb +82 -0
- data/lib/cryptopay/models/subscription_params.rb +159 -0
- data/lib/cryptopay/models/subscription_period.rb +20 -0
- data/lib/cryptopay/models/subscription_result.rb +68 -0
- data/lib/cryptopay/models/subscription_status.rb +18 -0
- data/lib/cryptopay/models/transaction.rb +8 -8
- data/lib/cryptopay/models/transaction_list_result.rb +8 -8
- data/lib/cryptopay/require.rb +10 -0
- data/lib/cryptopay/version.rb +1 -1
- data/lib/cryptopay.rb +8 -9
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18a89097b66be19ae3889c0c2279574f5b2aa917d6d66a5ace4547cd2877538b
|
4
|
+
data.tar.gz: b259cd7c0ef3ebe5e8457118533e3abeb5bd2c033f14b549657c7fcc844015dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f4a1fa54fd517d1288a386e115ac2634293c95d0fb1af44e1e4f6af51671d215a42dd51bb4fc5fce201533f3992703a5104e24ef378830e67dfc4bafe704c67
|
7
|
+
data.tar.gz: 411446bfe02bbf5ccac2c906524451bce90c0348ade8da2751038cf8abb707ca916426ed041bc1a8509a835a5473c20e594c3d4e5b0cd1b73c05b2bb344ee8c4
|
data/.github/workflows/ci.yml
CHANGED
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,7 @@ For more information, please visit [Cryptopay API docs](https://developers.crypt
|
|
20
20
|
* [Invoices](#invoices)
|
21
21
|
* [Rates](#rates)
|
22
22
|
* [Risks](#risks)
|
23
|
+
* [Subscriptions](#subscriptions)
|
23
24
|
* [Transactions](#transactions)
|
24
25
|
* [Callbacks](#callbacks)
|
25
26
|
* [Development](#development)
|
@@ -265,7 +266,7 @@ Customer objects allow you to reject High-Risk transactions automatically, and t
|
|
265
266
|
|
266
267
|
```ruby
|
267
268
|
params = Cryptopay::CustomerParams.new(
|
268
|
-
id: '
|
269
|
+
id: '500b71259c48d4e212693a21e0d10c60',
|
269
270
|
currency: 'EUR'
|
270
271
|
)
|
271
272
|
|
@@ -295,11 +296,15 @@ p result # => <CustomerResult data=...>
|
|
295
296
|
|
296
297
|
|
297
298
|
```ruby
|
298
|
-
customer_id =
|
299
|
+
customer_id = 'CUSTOMER-123'
|
299
300
|
params = Cryptopay::CustomerUpdateParams.new(
|
300
|
-
|
301
|
-
|
302
|
-
|
301
|
+
addresses: [
|
302
|
+
Cryptopay::CustomerAddress.new(
|
303
|
+
address: '2N9wPGx67zdSeAbXi15qHgoZ9Hb9Uxhd2uQ',
|
304
|
+
currency: 'BTC',
|
305
|
+
network: 'bitcoin'
|
306
|
+
)
|
307
|
+
]
|
303
308
|
)
|
304
309
|
|
305
310
|
result = client.customers.update(customer_id, params)
|
@@ -482,6 +487,65 @@ result = client.risks.score(params)
|
|
482
487
|
p result # => <RiskResult data=...>
|
483
488
|
```
|
484
489
|
|
490
|
+
### Subscriptions
|
491
|
+
|
492
|
+
|
493
|
+
#### Cancel a subscription
|
494
|
+
|
495
|
+
|
496
|
+
```ruby
|
497
|
+
subscription_id = 'de37fb63-986b-4f83-bf9f-612734316fdc'
|
498
|
+
|
499
|
+
result = client.subscriptions.cancel(subscription_id)
|
500
|
+
p result # => <SubscriptionResult data=...>
|
501
|
+
```
|
502
|
+
|
503
|
+
#### Create a subscription
|
504
|
+
|
505
|
+
|
506
|
+
```ruby
|
507
|
+
params = Cryptopay::SubscriptionParams.new(
|
508
|
+
name: 'Subscription name',
|
509
|
+
amount: '100.0',
|
510
|
+
currency: 'EUR',
|
511
|
+
period: 'month',
|
512
|
+
period_quantity: 3,
|
513
|
+
payer_email: 'user@example.com',
|
514
|
+
starts_at: Time.now.utc + 7 * 24 * 3600
|
515
|
+
)
|
516
|
+
|
517
|
+
result = client.subscriptions.create(params)
|
518
|
+
p result # => <SubscriptionResult data=...>
|
519
|
+
```
|
520
|
+
|
521
|
+
#### List subscriptions
|
522
|
+
|
523
|
+
|
524
|
+
```ruby
|
525
|
+
result = client.subscriptions.list
|
526
|
+
p result # => <SubscriptionListResult data=...>
|
527
|
+
```
|
528
|
+
|
529
|
+
#### Retrieve a subscription
|
530
|
+
|
531
|
+
|
532
|
+
```ruby
|
533
|
+
subscription_id = '64249ede-8969-4d5c-a042-806f9c3e7db3'
|
534
|
+
|
535
|
+
result = client.subscriptions.retrieve(subscription_id)
|
536
|
+
p result # => <SubscriptionResult data=...>
|
537
|
+
```
|
538
|
+
|
539
|
+
#### Retrieve a subscription by custom_id
|
540
|
+
|
541
|
+
|
542
|
+
```ruby
|
543
|
+
custom_id = 'PAYMENT-123'
|
544
|
+
|
545
|
+
result = client.subscriptions.retrieve_by_custom_id(custom_id)
|
546
|
+
p result # => <SubscriptionResult data=...>
|
547
|
+
```
|
548
|
+
|
485
549
|
### Transactions
|
486
550
|
|
487
551
|
[Transactions API docs](https://developers.cryptopay.me/guides/transactions)
|
data/bin/console
CHANGED
@@ -88,6 +88,7 @@ module Cryptopay
|
|
88
88
|
# @param [Hash] opts the optional parameters
|
89
89
|
# @option opts [String] :customer_id The internal ID of your customer that the transaction relates to
|
90
90
|
# @option opts [String] :starting_after Pagination parameter. ID to start after
|
91
|
+
# @option opts [String] :subscription_id
|
91
92
|
# @return [InvoiceListResult]
|
92
93
|
def list(opts = {})
|
93
94
|
path = '/api/invoices'
|
@@ -95,6 +96,7 @@ module Cryptopay
|
|
95
96
|
query_params = {}
|
96
97
|
query_params[:customer_id] = opts[:customer_id] unless opts[:customer_id].nil?
|
97
98
|
query_params[:starting_after] = opts[:starting_after] unless opts[:starting_after].nil?
|
99
|
+
query_params[:subscription_id] = opts[:subscription_id] unless opts[:subscription_id].nil?
|
98
100
|
|
99
101
|
req = Request.new(
|
100
102
|
method: :get,
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Auto-generated file
|
4
|
+
# DO NOT EDIT
|
5
|
+
|
6
|
+
module Cryptopay
|
7
|
+
class Subscriptions
|
8
|
+
def initialize(connection)
|
9
|
+
@connection = connection
|
10
|
+
end
|
11
|
+
|
12
|
+
# Cancel a subscription
|
13
|
+
# @param subscription_id [String] Subscription ID
|
14
|
+
# @param [Hash] opts the optional parameters
|
15
|
+
# @return [SubscriptionResult]
|
16
|
+
def cancel(subscription_id, _opts = {})
|
17
|
+
path = '/api/subscriptions/{subscription_id}/cancel'
|
18
|
+
path = path.sub('{subscription_id}', CGI.escape(subscription_id.to_s))
|
19
|
+
|
20
|
+
req = Request.new(
|
21
|
+
method: :post,
|
22
|
+
path: path
|
23
|
+
)
|
24
|
+
|
25
|
+
connection.call(req, return_type: SubscriptionResult)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Create a subscription
|
29
|
+
# @param subscription_params [SubscriptionParams]
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @return [SubscriptionResult]
|
32
|
+
def create(subscription_params, _opts = {})
|
33
|
+
path = '/api/subscriptions'
|
34
|
+
|
35
|
+
req = Request.new(
|
36
|
+
method: :post,
|
37
|
+
path: path,
|
38
|
+
body_params: subscription_params
|
39
|
+
)
|
40
|
+
|
41
|
+
connection.call(req, return_type: SubscriptionResult)
|
42
|
+
end
|
43
|
+
|
44
|
+
# List subscriptions
|
45
|
+
# @param [Hash] opts the optional parameters
|
46
|
+
# @option opts [String] :starting_after Pagination parameter. ID to start after
|
47
|
+
# @return [SubscriptionListResult]
|
48
|
+
def list(opts = {})
|
49
|
+
path = '/api/subscriptions'
|
50
|
+
|
51
|
+
query_params = {}
|
52
|
+
query_params[:starting_after] = opts[:starting_after] unless opts[:starting_after].nil?
|
53
|
+
|
54
|
+
req = Request.new(
|
55
|
+
method: :get,
|
56
|
+
path: path,
|
57
|
+
query_params: query_params
|
58
|
+
)
|
59
|
+
|
60
|
+
connection.call(req, return_type: SubscriptionListResult)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Retrieve a subscription
|
64
|
+
# @param subscription_id [String] Subscription ID
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [SubscriptionResult]
|
67
|
+
def retrieve(subscription_id, _opts = {})
|
68
|
+
path = '/api/subscriptions/{subscription_id}'
|
69
|
+
path = path.sub('{subscription_id}', CGI.escape(subscription_id.to_s))
|
70
|
+
|
71
|
+
req = Request.new(
|
72
|
+
method: :get,
|
73
|
+
path: path
|
74
|
+
)
|
75
|
+
|
76
|
+
connection.call(req, return_type: SubscriptionResult)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Retrieve a subscription by custom_id
|
80
|
+
# @param custom_id [String]
|
81
|
+
# @param [Hash] opts the optional parameters
|
82
|
+
# @return [SubscriptionResult]
|
83
|
+
def retrieve_by_custom_id(custom_id, _opts = {})
|
84
|
+
path = '/api/subscriptions/custom_id/{custom_id}'
|
85
|
+
path = path.sub('{custom_id}', CGI.escape(custom_id.to_s))
|
86
|
+
|
87
|
+
req = Request.new(
|
88
|
+
method: :get,
|
89
|
+
path: path
|
90
|
+
)
|
91
|
+
|
92
|
+
connection.call(req, return_type: SubscriptionResult)
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
attr_reader :connection
|
98
|
+
end
|
99
|
+
end
|
data/lib/cryptopay/client.rb
CHANGED
@@ -12,7 +12,8 @@ module Cryptopay
|
|
12
12
|
:customers,
|
13
13
|
:risks,
|
14
14
|
:callbacks,
|
15
|
-
:coins
|
15
|
+
:coins,
|
16
|
+
:subscriptions
|
16
17
|
|
17
18
|
def initialize(&block)
|
18
19
|
config = Config.new(&block)
|
@@ -25,7 +26,7 @@ module Cryptopay
|
|
25
26
|
|
26
27
|
private
|
27
28
|
|
28
|
-
def setup_apis(connection)
|
29
|
+
def setup_apis(connection) # rubocop:disable Metrics/MethodLength
|
29
30
|
@invoices = Invoices.new(connection)
|
30
31
|
@rates = Rates.new(connection)
|
31
32
|
@coin_withdrawals = CoinWithdrawals.new(connection)
|
@@ -36,6 +37,7 @@ module Cryptopay
|
|
36
37
|
@customers = Customers.new(connection)
|
37
38
|
@risks = Risks.new(connection)
|
38
39
|
@coins = Coins.new(connection)
|
40
|
+
@subscriptions = Subscriptions.new(connection)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -23,6 +23,14 @@ module Cryptopay
|
|
23
23
|
)
|
24
24
|
private_constant :ENCODER
|
25
25
|
|
26
|
+
# Builds the object from hash
|
27
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
28
|
+
# @return [Cryptopay::Account] Returns the model itself
|
29
|
+
def self.build_from_hash(data)
|
30
|
+
attributes = ENCODER.build_from_hash(data)
|
31
|
+
new(attributes)
|
32
|
+
end
|
33
|
+
|
26
34
|
# Initializes the object
|
27
35
|
# @param [Hash] attributes Model attributes in the form of hash
|
28
36
|
def initialize(attributes = {})
|
@@ -71,14 +79,6 @@ module Cryptopay
|
|
71
79
|
invalid_properties.empty?
|
72
80
|
end
|
73
81
|
|
74
|
-
# Builds the object from hash
|
75
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
-
# @return [Cryptopay::Account] Returns the model itself
|
77
|
-
def self.build_from_hash(data)
|
78
|
-
attributes = ENCODER.build_from_hash(data)
|
79
|
-
new(attributes)
|
80
|
-
end
|
81
|
-
|
82
82
|
# Returns the object in the form of hash
|
83
83
|
# @return [Hash] Returns the object in the form of hash
|
84
84
|
def to_hash
|
@@ -19,6 +19,14 @@ module Cryptopay
|
|
19
19
|
)
|
20
20
|
private_constant :ENCODER
|
21
21
|
|
22
|
+
# Builds the object from hash
|
23
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
24
|
+
# @return [Cryptopay::AccountListResult] Returns the model itself
|
25
|
+
def self.build_from_hash(data)
|
26
|
+
attributes = ENCODER.build_from_hash(data)
|
27
|
+
new(attributes)
|
28
|
+
end
|
29
|
+
|
22
30
|
# Initializes the object
|
23
31
|
# @param [Hash] attributes Model attributes in the form of hash
|
24
32
|
def initialize(attributes = {})
|
@@ -61,14 +69,6 @@ module Cryptopay
|
|
61
69
|
invalid_properties.empty?
|
62
70
|
end
|
63
71
|
|
64
|
-
# Builds the object from hash
|
65
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
-
# @return [Cryptopay::AccountListResult] Returns the model itself
|
67
|
-
def self.build_from_hash(data)
|
68
|
-
attributes = ENCODER.build_from_hash(data)
|
69
|
-
new(attributes)
|
70
|
-
end
|
71
|
-
|
72
72
|
# Returns the object in the form of hash
|
73
73
|
# @return [Hash] Returns the object in the form of hash
|
74
74
|
def to_hash
|
@@ -10,7 +10,7 @@ module Cryptopay
|
|
10
10
|
|
11
11
|
# Builds the object
|
12
12
|
# @param [Mixed] Data to be matched against the list of oneOf items
|
13
|
-
# @return [Cryptopay::ChannelPaymentCallback, Cryptopay::CoinWithdrawalCallback, Cryptopay::InvoiceCallback, nil] Returns the model or nil
|
13
|
+
# @return [Cryptopay::ChannelPaymentCallback, Cryptopay::CoinWithdrawalCallback, Cryptopay::InvoiceCallback, Cryptopay::SubscriptionCallback, nil] Returns the model or nil
|
14
14
|
def self.build_from_hash(data)
|
15
15
|
case data[DISCRIMINATOR_NAME]
|
16
16
|
when 'ChannelPayment'
|
@@ -19,6 +19,8 @@ module Cryptopay
|
|
19
19
|
CoinWithdrawalCallback.build_from_hash(data)
|
20
20
|
when 'Invoice'
|
21
21
|
InvoiceCallback.build_from_hash(data)
|
22
|
+
when 'Subscription'
|
23
|
+
SubscriptionCallback.build_from_hash(data)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -45,6 +45,14 @@ module Cryptopay
|
|
45
45
|
)
|
46
46
|
private_constant :ENCODER
|
47
47
|
|
48
|
+
# Builds the object from hash
|
49
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
50
|
+
# @return [Cryptopay::Channel] Returns the model itself
|
51
|
+
def self.build_from_hash(data)
|
52
|
+
attributes = ENCODER.build_from_hash(data)
|
53
|
+
new(attributes)
|
54
|
+
end
|
55
|
+
|
48
56
|
# Initializes the object
|
49
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
50
58
|
def initialize(attributes = {})
|
@@ -155,14 +163,6 @@ module Cryptopay
|
|
155
163
|
invalid_properties.empty?
|
156
164
|
end
|
157
165
|
|
158
|
-
# Builds the object from hash
|
159
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
-
# @return [Cryptopay::Channel] Returns the model itself
|
161
|
-
def self.build_from_hash(data)
|
162
|
-
attributes = ENCODER.build_from_hash(data)
|
163
|
-
new(attributes)
|
164
|
-
end
|
165
|
-
|
166
166
|
# Returns the object in the form of hash
|
167
167
|
# @return [Hash] Returns the object in the form of hash
|
168
168
|
def to_hash
|
@@ -19,6 +19,14 @@ module Cryptopay
|
|
19
19
|
)
|
20
20
|
private_constant :ENCODER
|
21
21
|
|
22
|
+
# Builds the object from hash
|
23
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
24
|
+
# @return [Cryptopay::ChannelListResult] Returns the model itself
|
25
|
+
def self.build_from_hash(data)
|
26
|
+
attributes = ENCODER.build_from_hash(data)
|
27
|
+
new(attributes)
|
28
|
+
end
|
29
|
+
|
22
30
|
# Initializes the object
|
23
31
|
# @param [Hash] attributes Model attributes in the form of hash
|
24
32
|
def initialize(attributes = {})
|
@@ -61,14 +69,6 @@ module Cryptopay
|
|
61
69
|
invalid_properties.empty?
|
62
70
|
end
|
63
71
|
|
64
|
-
# Builds the object from hash
|
65
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
-
# @return [Cryptopay::ChannelListResult] Returns the model itself
|
67
|
-
def self.build_from_hash(data)
|
68
|
-
attributes = ENCODER.build_from_hash(data)
|
69
|
-
new(attributes)
|
70
|
-
end
|
71
|
-
|
72
72
|
# Returns the object in the form of hash
|
73
73
|
# @return [Hash] Returns the object in the form of hash
|
74
74
|
def to_hash
|
@@ -29,6 +29,14 @@ module Cryptopay
|
|
29
29
|
)
|
30
30
|
private_constant :ENCODER
|
31
31
|
|
32
|
+
# Builds the object from hash
|
33
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
34
|
+
# @return [Cryptopay::ChannelParams] Returns the model itself
|
35
|
+
def self.build_from_hash(data)
|
36
|
+
attributes = ENCODER.build_from_hash(data)
|
37
|
+
new(attributes)
|
38
|
+
end
|
39
|
+
|
32
40
|
# Initializes the object
|
33
41
|
# @param [Hash] attributes Model attributes in the form of hash
|
34
42
|
def initialize(attributes = {})
|
@@ -92,14 +100,6 @@ module Cryptopay
|
|
92
100
|
invalid_properties.empty?
|
93
101
|
end
|
94
102
|
|
95
|
-
# Builds the object from hash
|
96
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
-
# @return [Cryptopay::ChannelParams] Returns the model itself
|
98
|
-
def self.build_from_hash(data)
|
99
|
-
attributes = ENCODER.build_from_hash(data)
|
100
|
-
new(attributes)
|
101
|
-
end
|
102
|
-
|
103
103
|
# Returns the object in the form of hash
|
104
104
|
# @return [Hash] Returns the object in the form of hash
|
105
105
|
def to_hash
|
@@ -61,6 +61,14 @@ module Cryptopay
|
|
61
61
|
)
|
62
62
|
private_constant :ENCODER
|
63
63
|
|
64
|
+
# Builds the object from hash
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
+
# @return [Cryptopay::ChannelPayment] Returns the model itself
|
67
|
+
def self.build_from_hash(data)
|
68
|
+
attributes = ENCODER.build_from_hash(data)
|
69
|
+
new(attributes)
|
70
|
+
end
|
71
|
+
|
64
72
|
# Initializes the object
|
65
73
|
# @param [Hash] attributes Model attributes in the form of hash
|
66
74
|
def initialize(attributes = {})
|
@@ -215,14 +223,6 @@ module Cryptopay
|
|
215
223
|
invalid_properties.empty?
|
216
224
|
end
|
217
225
|
|
218
|
-
# Builds the object from hash
|
219
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
220
|
-
# @return [Cryptopay::ChannelPayment] Returns the model itself
|
221
|
-
def self.build_from_hash(data)
|
222
|
-
attributes = ENCODER.build_from_hash(data)
|
223
|
-
new(attributes)
|
224
|
-
end
|
225
|
-
|
226
226
|
# Returns the object in the form of hash
|
227
227
|
# @return [Hash] Returns the object in the form of hash
|
228
228
|
def to_hash
|
@@ -21,6 +21,14 @@ module Cryptopay
|
|
21
21
|
)
|
22
22
|
private_constant :ENCODER
|
23
23
|
|
24
|
+
# Builds the object from hash
|
25
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
26
|
+
# @return [Cryptopay::ChannelPaymentCallback] Returns the model itself
|
27
|
+
def self.build_from_hash(data)
|
28
|
+
attributes = ENCODER.build_from_hash(data)
|
29
|
+
new(attributes)
|
30
|
+
end
|
31
|
+
|
24
32
|
# Initializes the object
|
25
33
|
# @param [Hash] attributes Model attributes in the form of hash
|
26
34
|
def initialize(attributes = {})
|
@@ -67,14 +75,6 @@ module Cryptopay
|
|
67
75
|
invalid_properties.empty?
|
68
76
|
end
|
69
77
|
|
70
|
-
# Builds the object from hash
|
71
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
-
# @return [Cryptopay::ChannelPaymentCallback] Returns the model itself
|
73
|
-
def self.build_from_hash(data)
|
74
|
-
attributes = ENCODER.build_from_hash(data)
|
75
|
-
new(attributes)
|
76
|
-
end
|
77
|
-
|
78
78
|
# Returns the object in the form of hash
|
79
79
|
# @return [Hash] Returns the object in the form of hash
|
80
80
|
def to_hash
|
@@ -19,6 +19,14 @@ module Cryptopay
|
|
19
19
|
)
|
20
20
|
private_constant :ENCODER
|
21
21
|
|
22
|
+
# Builds the object from hash
|
23
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
24
|
+
# @return [Cryptopay::ChannelPaymentListResult] Returns the model itself
|
25
|
+
def self.build_from_hash(data)
|
26
|
+
attributes = ENCODER.build_from_hash(data)
|
27
|
+
new(attributes)
|
28
|
+
end
|
29
|
+
|
22
30
|
# Initializes the object
|
23
31
|
# @param [Hash] attributes Model attributes in the form of hash
|
24
32
|
def initialize(attributes = {})
|
@@ -61,14 +69,6 @@ module Cryptopay
|
|
61
69
|
invalid_properties.empty?
|
62
70
|
end
|
63
71
|
|
64
|
-
# Builds the object from hash
|
65
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
-
# @return [Cryptopay::ChannelPaymentListResult] Returns the model itself
|
67
|
-
def self.build_from_hash(data)
|
68
|
-
attributes = ENCODER.build_from_hash(data)
|
69
|
-
new(attributes)
|
70
|
-
end
|
71
|
-
|
72
72
|
# Returns the object in the form of hash
|
73
73
|
# @return [Hash] Returns the object in the form of hash
|
74
74
|
def to_hash
|
@@ -17,6 +17,14 @@ module Cryptopay
|
|
17
17
|
)
|
18
18
|
private_constant :ENCODER
|
19
19
|
|
20
|
+
# Builds the object from hash
|
21
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
+
# @return [Cryptopay::ChannelPaymentResult] Returns the model itself
|
23
|
+
def self.build_from_hash(data)
|
24
|
+
attributes = ENCODER.build_from_hash(data)
|
25
|
+
new(attributes)
|
26
|
+
end
|
27
|
+
|
20
28
|
# Initializes the object
|
21
29
|
# @param [Hash] attributes Model attributes in the form of hash
|
22
30
|
def initialize(attributes = {})
|
@@ -47,14 +55,6 @@ module Cryptopay
|
|
47
55
|
invalid_properties.empty?
|
48
56
|
end
|
49
57
|
|
50
|
-
# Builds the object from hash
|
51
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
-
# @return [Cryptopay::ChannelPaymentResult] Returns the model itself
|
53
|
-
def self.build_from_hash(data)
|
54
|
-
attributes = ENCODER.build_from_hash(data)
|
55
|
-
new(attributes)
|
56
|
-
end
|
57
|
-
|
58
58
|
# Returns the object in the form of hash
|
59
59
|
# @return [Hash] Returns the object in the form of hash
|
60
60
|
def to_hash
|
@@ -17,6 +17,14 @@ module Cryptopay
|
|
17
17
|
)
|
18
18
|
private_constant :ENCODER
|
19
19
|
|
20
|
+
# Builds the object from hash
|
21
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
+
# @return [Cryptopay::ChannelResult] Returns the model itself
|
23
|
+
def self.build_from_hash(data)
|
24
|
+
attributes = ENCODER.build_from_hash(data)
|
25
|
+
new(attributes)
|
26
|
+
end
|
27
|
+
|
20
28
|
# Initializes the object
|
21
29
|
# @param [Hash] attributes Model attributes in the form of hash
|
22
30
|
def initialize(attributes = {})
|
@@ -47,14 +55,6 @@ module Cryptopay
|
|
47
55
|
invalid_properties.empty?
|
48
56
|
end
|
49
57
|
|
50
|
-
# Builds the object from hash
|
51
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
-
# @return [Cryptopay::ChannelResult] Returns the model itself
|
53
|
-
def self.build_from_hash(data)
|
54
|
-
attributes = ENCODER.build_from_hash(data)
|
55
|
-
new(attributes)
|
56
|
-
end
|
57
|
-
|
58
58
|
# Returns the object in the form of hash
|
59
59
|
# @return [Hash] Returns the object in the form of hash
|
60
60
|
def to_hash
|
@@ -23,6 +23,14 @@ module Cryptopay
|
|
23
23
|
)
|
24
24
|
private_constant :ENCODER
|
25
25
|
|
26
|
+
# Builds the object from hash
|
27
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
28
|
+
# @return [Cryptopay::ChannelUpdateParams] Returns the model itself
|
29
|
+
def self.build_from_hash(data)
|
30
|
+
attributes = ENCODER.build_from_hash(data)
|
31
|
+
new(attributes)
|
32
|
+
end
|
33
|
+
|
26
34
|
# Initializes the object
|
27
35
|
# @param [Hash] attributes Model attributes in the form of hash
|
28
36
|
def initialize(attributes = {})
|
@@ -66,14 +74,6 @@ module Cryptopay
|
|
66
74
|
invalid_properties.empty?
|
67
75
|
end
|
68
76
|
|
69
|
-
# Builds the object from hash
|
70
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
-
# @return [Cryptopay::ChannelUpdateParams] Returns the model itself
|
72
|
-
def self.build_from_hash(data)
|
73
|
-
attributes = ENCODER.build_from_hash(data)
|
74
|
-
new(attributes)
|
75
|
-
end
|
76
|
-
|
77
77
|
# Returns the object in the form of hash
|
78
78
|
# @return [Hash] Returns the object in the form of hash
|
79
79
|
def to_hash
|
@@ -17,6 +17,14 @@ module Cryptopay
|
|
17
17
|
)
|
18
18
|
private_constant :ENCODER
|
19
19
|
|
20
|
+
# Builds the object from hash
|
21
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
+
# @return [Cryptopay::ChannelsConfig] Returns the model itself
|
23
|
+
def self.build_from_hash(data)
|
24
|
+
attributes = ENCODER.build_from_hash(data)
|
25
|
+
new(attributes)
|
26
|
+
end
|
27
|
+
|
20
28
|
# Initializes the object
|
21
29
|
# @param [Hash] attributes Model attributes in the form of hash
|
22
30
|
def initialize(attributes = {})
|
@@ -43,14 +51,6 @@ module Cryptopay
|
|
43
51
|
invalid_properties.empty?
|
44
52
|
end
|
45
53
|
|
46
|
-
# Builds the object from hash
|
47
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
-
# @return [Cryptopay::ChannelsConfig] 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
54
|
# Returns the object in the form of hash
|
55
55
|
# @return [Hash] Returns the object in the form of hash
|
56
56
|
def to_hash
|