cryptopay-ruby 1.0.0 → 2.1.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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +6 -1
  3. data/.rubocop.yml +3 -0
  4. data/README.md +69 -5
  5. data/bin/console +2 -1
  6. data/lib/cryptopay/api/invoices.rb +2 -0
  7. data/lib/cryptopay/api/subscriptions.rb +99 -0
  8. data/lib/cryptopay/client.rb +4 -2
  9. data/lib/cryptopay/models/account.rb +8 -8
  10. data/lib/cryptopay/models/account_list_result.rb +8 -8
  11. data/lib/cryptopay/models/callback.rb +3 -1
  12. data/lib/cryptopay/models/channel.rb +8 -8
  13. data/lib/cryptopay/models/channel_list_result.rb +8 -8
  14. data/lib/cryptopay/models/channel_params.rb +8 -8
  15. data/lib/cryptopay/models/channel_payment.rb +8 -8
  16. data/lib/cryptopay/models/channel_payment_callback.rb +8 -8
  17. data/lib/cryptopay/models/channel_payment_list_result.rb +8 -8
  18. data/lib/cryptopay/models/channel_payment_result.rb +8 -8
  19. data/lib/cryptopay/models/channel_result.rb +8 -8
  20. data/lib/cryptopay/models/channel_update_params.rb +8 -8
  21. data/lib/cryptopay/models/channels_config.rb +8 -8
  22. data/lib/cryptopay/models/coin.rb +8 -8
  23. data/lib/cryptopay/models/coin_destination_tag.rb +8 -8
  24. data/lib/cryptopay/models/coin_list_result.rb +8 -8
  25. data/lib/cryptopay/models/coin_network.rb +8 -8
  26. data/lib/cryptopay/models/coin_withdrawal.rb +8 -8
  27. data/lib/cryptopay/models/coin_withdrawal_callback.rb +8 -8
  28. data/lib/cryptopay/models/coin_withdrawal_list_result.rb +8 -8
  29. data/lib/cryptopay/models/coin_withdrawal_params.rb +8 -8
  30. data/lib/cryptopay/models/coin_withdrawal_result.rb +8 -8
  31. data/lib/cryptopay/models/coin_withdrawals_config.rb +8 -8
  32. data/lib/cryptopay/models/customer.rb +19 -13
  33. data/lib/cryptopay/models/customer_address.rb +83 -0
  34. data/lib/cryptopay/models/customer_list_result.rb +8 -8
  35. data/lib/cryptopay/models/customer_params.rb +19 -13
  36. data/lib/cryptopay/models/customer_result.rb +8 -8
  37. data/lib/cryptopay/models/customer_update_params.rb +22 -14
  38. data/lib/cryptopay/models/exchange.rb +8 -8
  39. data/lib/cryptopay/models/exchange_transfer.rb +8 -8
  40. data/lib/cryptopay/models/exchange_transfer_params.rb +8 -8
  41. data/lib/cryptopay/models/exchange_transfer_result.rb +8 -8
  42. data/lib/cryptopay/models/invoice.rb +15 -8
  43. data/lib/cryptopay/models/invoice_callback.rb +8 -8
  44. data/lib/cryptopay/models/invoice_list_result.rb +8 -8
  45. data/lib/cryptopay/models/invoice_params.rb +17 -10
  46. data/lib/cryptopay/models/invoice_recalculation.rb +8 -8
  47. data/lib/cryptopay/models/invoice_recalculation_params.rb +8 -8
  48. data/lib/cryptopay/models/invoice_recalculation_result.rb +8 -8
  49. data/lib/cryptopay/models/invoice_refund.rb +8 -8
  50. data/lib/cryptopay/models/invoice_refund_list_result.rb +8 -8
  51. data/lib/cryptopay/models/invoice_refund_params.rb +8 -8
  52. data/lib/cryptopay/models/invoice_refund_result.rb +8 -8
  53. data/lib/cryptopay/models/invoice_result.rb +8 -8
  54. data/lib/cryptopay/models/invoice_transaction.rb +8 -8
  55. data/lib/cryptopay/models/invoices_config.rb +8 -8
  56. data/lib/cryptopay/models/network_fee.rb +8 -8
  57. data/lib/cryptopay/models/network_fee_list_result.rb +8 -8
  58. data/lib/cryptopay/models/pagination.rb +8 -8
  59. data/lib/cryptopay/models/rate.rb +8 -8
  60. data/lib/cryptopay/models/rate_result.rb +8 -8
  61. data/lib/cryptopay/models/rates_result.rb +8 -8
  62. data/lib/cryptopay/models/risk.rb +8 -8
  63. data/lib/cryptopay/models/risk_params.rb +8 -8
  64. data/lib/cryptopay/models/risk_result.rb +8 -8
  65. data/lib/cryptopay/models/subscription.rb +222 -0
  66. data/lib/cryptopay/models/subscription_callback.rb +88 -0
  67. data/lib/cryptopay/models/subscription_callback_event.rb +18 -0
  68. data/lib/cryptopay/models/subscription_list_result.rb +82 -0
  69. data/lib/cryptopay/models/subscription_params.rb +159 -0
  70. data/lib/cryptopay/models/subscription_period.rb +20 -0
  71. data/lib/cryptopay/models/subscription_result.rb +68 -0
  72. data/lib/cryptopay/models/subscription_status.rb +18 -0
  73. data/lib/cryptopay/models/transaction.rb +8 -8
  74. data/lib/cryptopay/models/transaction_list_result.rb +8 -8
  75. data/lib/cryptopay/require.rb +10 -0
  76. data/lib/cryptopay/version.rb +1 -1
  77. data/lib/cryptopay.rb +8 -9
  78. metadata +16 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 565560b9bd60b4439f410a759ef4c51fce1104e29b887a5a70f579f583a96a7a
4
- data.tar.gz: a48fe75139c6244dc20fa430633329d7015debd3760bcb38d48e6fa350bf3593
3
+ metadata.gz: 18a89097b66be19ae3889c0c2279574f5b2aa917d6d66a5ace4547cd2877538b
4
+ data.tar.gz: b259cd7c0ef3ebe5e8457118533e3abeb5bd2c033f14b549657c7fcc844015dd
5
5
  SHA512:
6
- metadata.gz: 3c2bac187a5dfc48dcef7691025ac33dd4bf79dd6235f8429f5c827a90e5b4b18ed7a80d6cdb1cdebce6d1974b707aed284a79ca796a8251056113ca1b0e305a
7
- data.tar.gz: 4d836911974b0d7a971d5898c678a245e69f0b1b5f4b70aa8977738fbcd68712902161c8da06323b4a280bcf663dd1fbb536efc9031874aedd03b7ce49d915e6
6
+ metadata.gz: 7f4a1fa54fd517d1288a386e115ac2634293c95d0fb1af44e1e4f6af51671d215a42dd51bb4fc5fce201533f3992703a5104e24ef378830e67dfc4bafe704c67
7
+ data.tar.gz: 411446bfe02bbf5ccac2c906524451bce90c0348ade8da2751038cf8abb707ca916426ed041bc1a8509a835a5473c20e594c3d4e5b0cd1b73c05b2bb344ee8c4
@@ -22,7 +22,12 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  strategy:
24
24
  matrix:
25
- ruby-version: [2.6, 2.7, 3.0]
25
+ ruby-version:
26
+ - '2.6'
27
+ - '2.7'
28
+ - '3.0'
29
+ - '3.1'
30
+ - '3.2'
26
31
  steps:
27
32
  - uses: actions/checkout@v2
28
33
  - name: Set up Ruby
data/.rubocop.yml CHANGED
@@ -18,6 +18,9 @@ Style/GuardClause:
18
18
  Style/Copyright:
19
19
  Enabled: false
20
20
 
21
+ Style/DisableCopsWithinSourceCodeDirective:
22
+ Enabled: false
23
+
21
24
  Style/Documentation:
22
25
  Enabled: false
23
26
 
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: 'e2abd0899bada2814e6f6aa08aae61f8',
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 = "CUSTOMER-123"
299
+ customer_id = 'CUSTOMER-123'
299
300
  params = Cryptopay::CustomerUpdateParams.new(
300
- refund_addresses: {
301
- 'BTC' => '2N9wPGx67zdSeAbXi15qHgoZ9Hb9Uxhd2uQ'
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
@@ -3,9 +3,10 @@
3
3
 
4
4
  require 'bundler/setup'
5
5
  require 'dotenv/load'
6
- require 'cryptopay'
7
6
  require 'pry-byebug'
8
7
 
8
+ require 'cryptopay'
9
+
9
10
  client = Cryptopay::Client.new do |config|
10
11
  config.api_url = Cryptopay::SANDBOX
11
12
  config.api_key = ENV.fetch('API_KEY')
@@ -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
@@ -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