cryptopay-ruby 2.0.0 → 2.2.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +6 -1
  3. data/.rubocop.yml +6 -0
  4. data/README.md +51 -10
  5. data/lib/cryptopay/api/coin_withdrawals.rb +1 -0
  6. data/lib/cryptopay/api/invoices.rb +2 -0
  7. data/lib/cryptopay/api/subscriptions.rb +99 -0
  8. data/lib/cryptopay/client.rb +3 -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/beneficiary.rb +97 -0
  12. data/lib/cryptopay/models/beneficiary_address.rb +113 -0
  13. data/lib/cryptopay/models/beneficiary_type.rb +18 -0
  14. data/lib/cryptopay/models/callback.rb +3 -1
  15. data/lib/cryptopay/models/channel.rb +8 -8
  16. data/lib/cryptopay/models/channel_list_result.rb +8 -8
  17. data/lib/cryptopay/models/channel_params.rb +8 -8
  18. data/lib/cryptopay/models/channel_payment.rb +8 -8
  19. data/lib/cryptopay/models/channel_payment_callback.rb +8 -8
  20. data/lib/cryptopay/models/channel_payment_list_result.rb +8 -8
  21. data/lib/cryptopay/models/channel_payment_result.rb +8 -8
  22. data/lib/cryptopay/models/channel_result.rb +8 -8
  23. data/lib/cryptopay/models/channel_update_params.rb +8 -8
  24. data/lib/cryptopay/models/channels_config.rb +8 -8
  25. data/lib/cryptopay/models/coin.rb +8 -8
  26. data/lib/cryptopay/models/coin_destination_tag.rb +8 -8
  27. data/lib/cryptopay/models/coin_list_result.rb +8 -8
  28. data/lib/cryptopay/models/coin_network.rb +8 -8
  29. data/lib/cryptopay/models/coin_withdrawal.rb +8 -8
  30. data/lib/cryptopay/models/coin_withdrawal_callback.rb +8 -8
  31. data/lib/cryptopay/models/coin_withdrawal_list_result.rb +8 -8
  32. data/lib/cryptopay/models/coin_withdrawal_params.rb +30 -13
  33. data/lib/cryptopay/models/coin_withdrawal_result.rb +8 -8
  34. data/lib/cryptopay/models/coin_withdrawals_config.rb +8 -8
  35. data/lib/cryptopay/models/customer.rb +8 -8
  36. data/lib/cryptopay/models/customer_address.rb +8 -8
  37. data/lib/cryptopay/models/customer_list_result.rb +8 -8
  38. data/lib/cryptopay/models/customer_params.rb +8 -8
  39. data/lib/cryptopay/models/customer_result.rb +8 -8
  40. data/lib/cryptopay/models/customer_update_params.rb +8 -8
  41. data/lib/cryptopay/models/exchange.rb +8 -8
  42. data/lib/cryptopay/models/exchange_transfer.rb +8 -8
  43. data/lib/cryptopay/models/exchange_transfer_params.rb +8 -8
  44. data/lib/cryptopay/models/exchange_transfer_result.rb +8 -8
  45. data/lib/cryptopay/models/invoice.rb +15 -8
  46. data/lib/cryptopay/models/invoice_callback.rb +8 -8
  47. data/lib/cryptopay/models/invoice_list_result.rb +8 -8
  48. data/lib/cryptopay/models/invoice_params.rb +17 -10
  49. data/lib/cryptopay/models/invoice_recalculation.rb +8 -8
  50. data/lib/cryptopay/models/invoice_recalculation_params.rb +8 -8
  51. data/lib/cryptopay/models/invoice_recalculation_result.rb +8 -8
  52. data/lib/cryptopay/models/invoice_refund.rb +8 -8
  53. data/lib/cryptopay/models/invoice_refund_list_result.rb +8 -8
  54. data/lib/cryptopay/models/invoice_refund_params.rb +8 -8
  55. data/lib/cryptopay/models/invoice_refund_result.rb +8 -8
  56. data/lib/cryptopay/models/invoice_result.rb +8 -8
  57. data/lib/cryptopay/models/invoice_transaction.rb +8 -8
  58. data/lib/cryptopay/models/invoices_config.rb +8 -8
  59. data/lib/cryptopay/models/network_fee.rb +8 -8
  60. data/lib/cryptopay/models/network_fee_list_result.rb +8 -8
  61. data/lib/cryptopay/models/pagination.rb +8 -8
  62. data/lib/cryptopay/models/rate.rb +8 -8
  63. data/lib/cryptopay/models/rate_result.rb +8 -8
  64. data/lib/cryptopay/models/rates_result.rb +8 -8
  65. data/lib/cryptopay/models/risk.rb +8 -8
  66. data/lib/cryptopay/models/risk_params.rb +8 -8
  67. data/lib/cryptopay/models/risk_result.rb +8 -8
  68. data/lib/cryptopay/models/subscription.rb +222 -0
  69. data/lib/cryptopay/models/subscription_callback.rb +88 -0
  70. data/lib/cryptopay/models/subscription_callback_event.rb +18 -0
  71. data/lib/cryptopay/models/subscription_list_result.rb +82 -0
  72. data/lib/cryptopay/models/subscription_params.rb +159 -0
  73. data/lib/cryptopay/models/subscription_period.rb +20 -0
  74. data/lib/cryptopay/models/subscription_result.rb +68 -0
  75. data/lib/cryptopay/models/subscription_status.rb +18 -0
  76. data/lib/cryptopay/models/transaction.rb +8 -8
  77. data/lib/cryptopay/models/transaction_list_result.rb +8 -8
  78. data/lib/cryptopay/require.rb +12 -4
  79. data/lib/cryptopay/version.rb +1 -1
  80. metadata +18 -6
@@ -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
@@ -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::Coin] 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 = {})
@@ -73,14 +81,6 @@ module Cryptopay
73
81
  invalid_properties.empty?
74
82
  end
75
83
 
76
- # Builds the object from hash
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- # @return [Cryptopay::Coin] Returns the model itself
79
- def self.build_from_hash(data)
80
- attributes = ENCODER.build_from_hash(data)
81
- new(attributes)
82
- end
83
-
84
84
  # Returns the object in the form of hash
85
85
  # @return [Hash] Returns the object in the form of hash
86
86
  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::CoinDestinationTag] 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 = {})
@@ -51,14 +59,6 @@ module Cryptopay
51
59
  invalid_properties.empty?
52
60
  end
53
61
 
54
- # Builds the object from hash
55
- # @param [Hash] attributes Model attributes in the form of hash
56
- # @return [Cryptopay::CoinDestinationTag] Returns the model itself
57
- def self.build_from_hash(data)
58
- attributes = ENCODER.build_from_hash(data)
59
- new(attributes)
60
- end
61
-
62
62
  # Returns the object in the form of hash
63
63
  # @return [Hash] Returns the object in the form of hash
64
64
  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::CoinListResult] 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 = {})
@@ -49,14 +57,6 @@ module Cryptopay
49
57
  invalid_properties.empty?
50
58
  end
51
59
 
52
- # Builds the object from hash
53
- # @param [Hash] attributes Model attributes in the form of hash
54
- # @return [Cryptopay::CoinListResult] Returns the model itself
55
- def self.build_from_hash(data)
56
- attributes = ENCODER.build_from_hash(data)
57
- new(attributes)
58
- end
59
-
60
60
  # Returns the object in the form of hash
61
61
  # @return [Hash] Returns the object in the form of hash
62
62
  def to_hash
@@ -31,6 +31,14 @@ module Cryptopay
31
31
  )
32
32
  private_constant :ENCODER
33
33
 
34
+ # Builds the object from hash
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ # @return [Cryptopay::CoinNetwork] Returns the model itself
37
+ def self.build_from_hash(data)
38
+ attributes = ENCODER.build_from_hash(data)
39
+ new(attributes)
40
+ end
41
+
34
42
  # Initializes the object
35
43
  # @param [Hash] attributes Model attributes in the form of hash
36
44
  def initialize(attributes = {})
@@ -107,14 +115,6 @@ module Cryptopay
107
115
  invalid_properties.empty?
108
116
  end
109
117
 
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Cryptopay::CoinNetwork] Returns the model itself
113
- def self.build_from_hash(data)
114
- attributes = ENCODER.build_from_hash(data)
115
- new(attributes)
116
- end
117
-
118
118
  # Returns the object in the form of hash
119
119
  # @return [Hash] Returns the object in the form of hash
120
120
  def to_hash
@@ -56,6 +56,14 @@ module Cryptopay
56
56
  )
57
57
  private_constant :ENCODER
58
58
 
59
+ # Builds the object from hash
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ # @return [Cryptopay::CoinWithdrawal] Returns the model itself
62
+ def self.build_from_hash(data)
63
+ attributes = ENCODER.build_from_hash(data)
64
+ new(attributes)
65
+ end
66
+
59
67
  # Initializes the object
60
68
  # @param [Hash] attributes Model attributes in the form of hash
61
69
  def initialize(attributes = {})
@@ -204,14 +212,6 @@ module Cryptopay
204
212
  invalid_properties.empty?
205
213
  end
206
214
 
207
- # Builds the object from hash
208
- # @param [Hash] attributes Model attributes in the form of hash
209
- # @return [Cryptopay::CoinWithdrawal] Returns the model itself
210
- def self.build_from_hash(data)
211
- attributes = ENCODER.build_from_hash(data)
212
- new(attributes)
213
- end
214
-
215
215
  # Returns the object in the form of hash
216
216
  # @return [Hash] Returns the object in the form of hash
217
217
  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::CoinWithdrawalCallback] 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::CoinWithdrawalCallback] 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::CoinWithdrawalListResult] 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::CoinWithdrawalListResult] 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
@@ -18,7 +18,9 @@ module Cryptopay
18
18
  'custom_id': :custom_id,
19
19
  'customer_id': :customer_id,
20
20
  'network_fee_level': :network_fee_level,
21
- 'force_commit': :force_commit
21
+ 'force_commit': :force_commit,
22
+ 'travel_rule_compliant': :travel_rule_compliant,
23
+ 'beneficiary': :beneficiary
22
24
  },
23
25
  types: {
24
26
  'address': :String,
@@ -31,7 +33,9 @@ module Cryptopay
31
33
  'custom_id': :String,
32
34
  'customer_id': :String,
33
35
  'network_fee_level': :NetworkFeeLevel,
34
- 'force_commit': :Boolean
36
+ 'force_commit': :Boolean,
37
+ 'travel_rule_compliant': :Boolean,
38
+ 'beneficiary': :Beneficiary
35
39
  },
36
40
  nullables: %i[
37
41
  charged_amount
@@ -41,6 +45,14 @@ module Cryptopay
41
45
  )
42
46
  private_constant :ENCODER
43
47
 
48
+ # Builds the object from hash
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ # @return [Cryptopay::CoinWithdrawalParams] Returns the model itself
51
+ def self.build_from_hash(data)
52
+ attributes = ENCODER.build_from_hash(data)
53
+ new(attributes)
54
+ end
55
+
44
56
  # Initializes the object
45
57
  # @param [Hash] attributes Model attributes in the form of hash
46
58
  def initialize(attributes = {})
@@ -67,17 +79,17 @@ module Cryptopay
67
79
  @attributes[:network]
68
80
  end
69
81
 
70
- # All applicable fees will be deducted from this amount before processing a transaction instead of adding them on top it
82
+ # The exact amount to debit from your account in `charged_currency`. All applicable fees will be deducted from this amount before processing a transaction instead of adding them on top it.
71
83
  def charged_amount
72
84
  @attributes[:charged_amount]
73
85
  end
74
86
 
75
- # An exact transaction amount to send. All applicable fees will be added on top of this amount and debited from your account
87
+ # The exact transaction amount to send in `charged_currency`. All applicable fees will be added on top of this amount and debited from your account.
76
88
  def charged_amount_to_send
77
89
  @attributes[:charged_amount_to_send]
78
90
  end
79
91
 
80
- # An exact transaction amount to send. All applicable fees will be added on top of this amount and debited from your account. Use this parameter if you want to send a transaction from cryptocurrency accounts only
92
+ # The exact transaction amount to send in `received_currency`. All applicable fees will be added on top of this amount and debited from your account.
81
93
  def received_amount
82
94
  @attributes[:received_amount]
83
95
  end
@@ -101,6 +113,15 @@ module Cryptopay
101
113
  @attributes[:force_commit]
102
114
  end
103
115
 
116
+ # Is `false` if omitted. Set `true` to turn on beneficiary data validations
117
+ def travel_rule_compliant
118
+ @attributes[:travel_rule_compliant]
119
+ end
120
+
121
+ def beneficiary
122
+ @attributes[:beneficiary]
123
+ end
124
+
104
125
  # Show invalid properties with the reasons. Usually used together with valid?
105
126
  # @return Array for valid properties with the reasons
106
127
  def invalid_properties
@@ -118,6 +139,10 @@ module Cryptopay
118
139
  properties.push('invalid value for network_fee_level, must be one of "fast", "average", "slow"')
119
140
  end
120
141
 
142
+ beneficiary&.invalid_properties&.each do |prop|
143
+ properties.push("invalid value for \"beneficiary\": #{prop}")
144
+ end
145
+
121
146
  properties
122
147
  end
123
148
 
@@ -127,14 +152,6 @@ module Cryptopay
127
152
  invalid_properties.empty?
128
153
  end
129
154
 
130
- # Builds the object from hash
131
- # @param [Hash] attributes Model attributes in the form of hash
132
- # @return [Cryptopay::CoinWithdrawalParams] Returns the model itself
133
- def self.build_from_hash(data)
134
- attributes = ENCODER.build_from_hash(data)
135
- new(attributes)
136
- end
137
-
138
155
  # Returns the object in the form of hash
139
156
  # @return [Hash] Returns the object in the form of hash
140
157
  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::CoinWithdrawalResult] 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::CoinWithdrawalResult] 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::CoinWithdrawalsConfig] 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::CoinWithdrawalsConfig] 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
@@ -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::Customer] 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 = {})
@@ -68,14 +76,6 @@ module Cryptopay
68
76
  invalid_properties.empty?
69
77
  end
70
78
 
71
- # Builds the object from hash
72
- # @param [Hash] attributes Model attributes in the form of hash
73
- # @return [Cryptopay::Customer] Returns the model itself
74
- def self.build_from_hash(data)
75
- attributes = ENCODER.build_from_hash(data)
76
- new(attributes)
77
- end
78
-
79
79
  # Returns the object in the form of hash
80
80
  # @return [Hash] Returns the object in the form of hash
81
81
  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::CustomerAddress] 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 = {})
@@ -62,14 +70,6 @@ module Cryptopay
62
70
  invalid_properties.empty?
63
71
  end
64
72
 
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
73
  # Returns the object in the form of hash
74
74
  # @return [Hash] Returns the object in the form of hash
75
75
  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::CustomerListResult] 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::CustomerListResult] 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