bleumi_pay_sdk_ruby 1.0.2 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +67 -47
  4. data/bleumi_pay_sdk_ruby.gemspec +4 -5
  5. data/docs/AlgorandBalance.md +28 -0
  6. data/docs/AlgorandWalletAddress.md +24 -0
  7. data/docs/AlgorandWalletInputs.md +23 -0
  8. data/docs/BadRequest.md +2 -1
  9. data/docs/Chain.md +14 -0
  10. data/docs/CheckoutToken.md +28 -0
  11. data/docs/CreateCheckoutUrlRequest.md +28 -0
  12. data/docs/CreateCheckoutUrlResponse.md +17 -0
  13. data/docs/CreatePaymentRequest.md +19 -0
  14. data/docs/CreatePaymentResponse.md +15 -0
  15. data/docs/CreatePayoutRequest.md +28 -0
  16. data/docs/CreatePayoutResponse.md +15 -0
  17. data/docs/EthereumBalance.md +30 -0
  18. data/docs/EthereumWalletAddress.md +23 -0
  19. data/docs/EthereumWalletInputs.md +23 -0
  20. data/docs/HostedCheckoutsApi.md +197 -0
  21. data/docs/PaginatedPaymentOperations.md +28 -0
  22. data/docs/PaginatedPayments.md +95 -0
  23. data/docs/PaginatedPayoutItems.md +59 -0
  24. data/docs/Payment.md +67 -0
  25. data/docs/PaymentAddresses.md +21 -0
  26. data/docs/PaymentBalances.md +21 -0
  27. data/docs/PaymentOperation.md +46 -0
  28. data/docs/PaymentOperationInputs.md +31 -0
  29. data/docs/PaymentOperationResponse.md +15 -0
  30. data/docs/PaymentRefundRequest.md +14 -0
  31. data/docs/PaymentSettleRequest.md +17 -0
  32. data/docs/PaymentsApi.md +368 -0
  33. data/docs/Payout.md +18 -0
  34. data/docs/PayoutItem.md +39 -0
  35. data/docs/PayoutItemInputs.md +28 -0
  36. data/docs/PayoutsApi.md +137 -0
  37. data/docs/RskBalance.md +28 -0
  38. data/docs/ValidateCheckoutRequest.md +21 -0
  39. data/docs/ValidateCheckoutResponse.md +15 -0
  40. data/docs/WalletBalance.md +18 -4
  41. data/hc_create.rb +40 -0
  42. data/hc_list.rb +17 -0
  43. data/hc_validate.rb +22 -0
  44. data/lib/bleumi_pay_sdk_ruby.rb +38 -17
  45. data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +212 -0
  46. data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +517 -0
  47. data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
  48. data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +288 -0
  49. data/lib/bleumi_pay_sdk_ruby/api_client.rb +11 -9
  50. data/lib/bleumi_pay_sdk_ruby/api_error.rb +3 -3
  51. data/lib/bleumi_pay_sdk_ruby/configuration.rb +4 -4
  52. data/lib/bleumi_pay_sdk_ruby/models/algorand_balance.rb +219 -0
  53. data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_address.rb +221 -0
  54. data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_inputs.rb +247 -0
  55. data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +15 -5
  56. data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +12 -9
  57. data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +302 -0
  58. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +312 -0
  59. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
  60. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +33 -11
  61. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +19 -23
  62. data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +244 -0
  63. data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
  64. data/lib/bleumi_pay_sdk_ruby/models/ethereum_balance.rb +241 -0
  65. data/lib/bleumi_pay_sdk_ruby/models/ethereum_wallet_address.rb +221 -0
  66. data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → ethereum_wallet_inputs.rb} +35 -50
  67. data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
  68. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +19 -9
  69. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +19 -9
  70. data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +31 -54
  71. data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +231 -0
  72. data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +225 -0
  73. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +44 -18
  74. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +38 -12
  75. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +18 -8
  76. data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +18 -8
  77. data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +18 -8
  78. data/lib/bleumi_pay_sdk_ruby/models/payout.rb +237 -0
  79. data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
  80. data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
  81. data/lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb +219 -0
  82. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +257 -0
  83. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
  84. data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +37 -12
  85. data/lib/bleumi_pay_sdk_ruby/version.rb +4 -4
  86. data/po_create.rb +39 -0
  87. data/po_list.rb +23 -0
  88. data/py_create.rb +48 -0
  89. data/py_get.rb +18 -0
  90. data/py_getop.rb +19 -0
  91. data/py_list.rb +24 -0
  92. data/py_listops.rb +21 -0
  93. data/py_refund.rb +43 -0
  94. data/py_settle.rb +43 -0
  95. data/spec/api/hosted_checkouts_api_spec.rb +67 -0
  96. data/spec/api/payments_api_spec.rb +123 -0
  97. data/spec/api/payouts_api_spec.rb +61 -0
  98. data/spec/api_client_spec.rb +226 -0
  99. data/spec/configuration_spec.rb +42 -0
  100. data/spec/models/algorand_balance_spec.rb +47 -0
  101. data/spec/models/algorand_wallet_address_spec.rb +47 -0
  102. data/spec/models/algorand_wallet_inputs_spec.rb +65 -0
  103. data/spec/models/bad_request_spec.rb +47 -0
  104. data/spec/models/chain_spec.rb +35 -0
  105. data/spec/models/checkout_token_spec.rb +77 -0
  106. data/spec/models/create_checkout_url_request_spec.rb +89 -0
  107. data/spec/models/create_checkout_url_response_spec.rb +47 -0
  108. data/spec/models/create_payment_request_spec.rb +59 -0
  109. data/spec/models/create_payment_response_spec.rb +41 -0
  110. data/spec/models/create_payout_request_spec.rb +53 -0
  111. data/spec/models/create_payout_response_spec.rb +41 -0
  112. data/spec/models/ethereum_balance_spec.rb +59 -0
  113. data/spec/models/ethereum_wallet_address_spec.rb +47 -0
  114. data/spec/models/ethereum_wallet_inputs_spec.rb +65 -0
  115. data/spec/models/paginated_payment_operations_spec.rb +47 -0
  116. data/spec/models/paginated_payments_spec.rb +47 -0
  117. data/spec/models/paginated_payout_items_spec.rb +47 -0
  118. data/spec/models/payment_addresses_spec.rb +53 -0
  119. data/spec/models/payment_balances_spec.rb +53 -0
  120. data/spec/models/payment_operation_inputs_spec.rb +65 -0
  121. data/spec/models/payment_operation_response_spec.rb +41 -0
  122. data/spec/models/payment_operation_spec.rb +71 -0
  123. data/spec/models/payment_refund_request_spec.rb +41 -0
  124. data/spec/models/payment_settle_request_spec.rb +47 -0
  125. data/spec/models/payment_spec.rb +65 -0
  126. data/spec/models/payout_item_inputs_spec.rb +53 -0
  127. data/spec/models/payout_item_spec.rb +71 -0
  128. data/spec/models/payout_spec.rb +53 -0
  129. data/spec/models/rsk_balance_spec.rb +47 -0
  130. data/spec/models/validate_checkout_request_spec.rb +59 -0
  131. data/spec/models/validate_checkout_response_spec.rb +41 -0
  132. data/spec/models/wallet_balance_spec.rb +65 -0
  133. data/spec/spec_helper.rb +111 -0
  134. metadata +180 -49
  135. data/docs/Erc20PaymentsApi.md +0 -334
  136. data/docs/EthAddress.md +0 -8
  137. data/docs/EthNetwork.md +0 -9
  138. data/docs/PaginatedWalletOperations.md +0 -8
  139. data/docs/PaginatedWallets.md +0 -8
  140. data/docs/Wallet.md +0 -13
  141. data/docs/WalletCreateInput.md +0 -9
  142. data/docs/WalletCreateOutput.md +0 -10
  143. data/docs/WalletInputs.md +0 -11
  144. data/docs/WalletOperation.md +0 -11
  145. data/docs/WalletOperationInputs.md +0 -10
  146. data/docs/WalletOperationOutput.md +0 -8
  147. data/docs/WalletRefundOperationInput.md +0 -7
  148. data/docs/WalletSettleOperationInput.md +0 -8
  149. data/lib/bleumi_pay_sdk_ruby/api/erc20_payments_api.rb +0 -482
  150. data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +0 -208
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #Bleumi Pay REST API
3
+
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: info@bleumi.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module BleumiPay
16
+ # Payment Balances
17
+ class PaymentBalances
18
+ attr_accessor :ethereum
19
+
20
+ attr_accessor :algorand
21
+
22
+ attr_accessor :rsk
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'ethereum' => :'ethereum',
28
+ :'algorand' => :'algorand',
29
+ :'rsk' => :'rsk'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'ethereum' => :'EthereumBalance',
37
+ :'algorand' => :'AlgorandBalance',
38
+ :'rsk' => :'RskBalance'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaymentBalances` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::PaymentBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'ethereum')
64
+ self.ethereum = attributes[:'ethereum']
65
+ end
66
+
67
+ if attributes.key?(:'algorand')
68
+ self.algorand = attributes[:'algorand']
69
+ end
70
+
71
+ if attributes.key?(:'rsk')
72
+ self.rsk = attributes[:'rsk']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ ethereum == o.ethereum &&
95
+ algorand == o.algorand &&
96
+ rsk == o.rsk
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [ethereum, algorand, rsk].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ BleumiPay.const_get(type).build_from_hash(value)
176
+ end
177
+ end
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # to_body is an alias to to_hash (backward compatibility)
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_body
188
+ to_hash
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ # Outputs non-array value in the form of hash
208
+ # For object, use to_hash. Otherwise, just return the value
209
+ # @param [Object] value Any valid value
210
+ # @return [Hash] Returns the value in the form of hash
211
+ def _to_hash(value)
212
+ if value.is_a?(Array)
213
+ value.compact.map { |v| _to_hash(v) }
214
+ elsif value.is_a?(Hash)
215
+ {}.tap do |hash|
216
+ value.each { |k, v| hash[k] = _to_hash(v) }
217
+ end
218
+ elsif value.respond_to? :to_hash
219
+ value.to_hash
220
+ else
221
+ value
222
+ end
223
+ end
224
+ end
225
+ end
@@ -1,26 +1,30 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC20 payments into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: info@bleumi.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module BleumiPay
16
- class WalletOperation
17
- # Unique ID of the wallet; specified when it was created by your system
18
- attr_accessor :id
16
+ # Payment Operation details
17
+ class PaymentOperation
18
+ # Transaction ID of the operation
19
+ attr_accessor :txid
19
20
 
20
- # The name of the function invoked on the payment processor
21
+ # Network in which the operation was carried out
22
+ attr_accessor :chain
23
+
24
+ # The name of the function invoked on the payment processor
21
25
  attr_accessor :func_name
22
26
 
23
- # <b>null</b> - operation in progress <br/> <b>true</b> - operation completed successfuly <br/> <b>false</b> - operation failed to process
27
+ # null - Operation in progress ; true - Operation completed successfuly ; false - Operation failed to process
24
28
  attr_accessor :status
25
29
 
26
30
  attr_accessor :inputs
@@ -31,7 +35,8 @@ module BleumiPay
31
35
  # Attribute mapping from ruby-style variable name to JSON key.
32
36
  def self.attribute_map
33
37
  {
34
- :'id' => :'id',
38
+ :'txid' => :'txid',
39
+ :'chain' => :'chain',
35
40
  :'func_name' => :'funcName',
36
41
  :'status' => :'status',
37
42
  :'inputs' => :'inputs',
@@ -42,31 +47,42 @@ module BleumiPay
42
47
  # Attribute type mapping.
43
48
  def self.openapi_types
44
49
  {
45
- :'id' => :'String',
50
+ :'txid' => :'String',
51
+ :'chain' => :'String',
46
52
  :'func_name' => :'String',
47
53
  :'status' => :'Boolean',
48
- :'inputs' => :'WalletOperationInputs',
54
+ :'inputs' => :'PaymentOperationInputs',
49
55
  :'hash' => :'String'
50
56
  }
51
57
  end
52
58
 
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
53
65
  # Initializes the object
54
66
  # @param [Hash] attributes Model attributes in the form of hash
55
67
  def initialize(attributes = {})
56
68
  if (!attributes.is_a?(Hash))
57
- fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::WalletOperation` initialize method"
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaymentOperation` initialize method"
58
70
  end
59
71
 
60
72
  # check to see if the attribute exists and convert string to symbol for hash key
61
73
  attributes = attributes.each_with_object({}) { |(k, v), h|
62
74
  if (!self.class.attribute_map.key?(k.to_sym))
63
- fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::WalletOperation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::PaymentOperation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
76
  end
65
77
  h[k.to_sym] = v
66
78
  }
67
79
 
68
- if attributes.key?(:'id')
69
- self.id = attributes[:'id']
80
+ if attributes.key?(:'txid')
81
+ self.txid = attributes[:'txid']
82
+ end
83
+
84
+ if attributes.key?(:'chain')
85
+ self.chain = attributes[:'chain']
70
86
  end
71
87
 
72
88
  if attributes.key?(:'func_name')
@@ -90,6 +106,10 @@ module BleumiPay
90
106
  # @return Array for valid properties with the reasons
91
107
  def list_invalid_properties
92
108
  invalid_properties = Array.new
109
+ if @chain.nil?
110
+ invalid_properties.push('invalid value for "chain", chain cannot be nil.')
111
+ end
112
+
93
113
  if @func_name.nil?
94
114
  invalid_properties.push('invalid value for "func_name", func_name cannot be nil.')
95
115
  end
@@ -112,6 +132,7 @@ module BleumiPay
112
132
  # Check to see if the all the properties in the model are valid
113
133
  # @return true if the model is valid
114
134
  def valid?
135
+ return false if @chain.nil?
115
136
  return false if @func_name.nil?
116
137
  return false if @status.nil?
117
138
  return false if @inputs.nil?
@@ -124,7 +145,8 @@ module BleumiPay
124
145
  def ==(o)
125
146
  return true if self.equal?(o)
126
147
  self.class == o.class &&
127
- id == o.id &&
148
+ txid == o.txid &&
149
+ chain == o.chain &&
128
150
  func_name == o.func_name &&
129
151
  status == o.status &&
130
152
  inputs == o.inputs &&
@@ -140,7 +162,7 @@ module BleumiPay
140
162
  # Calculates hash code according to all attributes.
141
163
  # @return [Integer] Hash code
142
164
  def hash
143
- [id, func_name, status, inputs, hash].hash
165
+ [txid, chain, func_name, status, inputs, hash].hash
144
166
  end
145
167
 
146
168
  # Builds the object from hash
@@ -229,7 +251,11 @@ module BleumiPay
229
251
  hash = {}
230
252
  self.class.attribute_map.each_pair do |attr, param|
231
253
  value = self.send(attr)
232
- next if value.nil?
254
+ if value.nil?
255
+ is_nullable = self.class.openapi_nullable.include?(attr)
256
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
+ end
258
+
233
259
  hash[param] = _to_hash(value)
234
260
  end
235
261
  hash
@@ -1,33 +1,38 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC20 payments into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: info@bleumi.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module BleumiPay
16
- class WalletOperationInputs
17
- # Amount to be settled
16
+ class PaymentOperationInputs
17
+ # Address of the wallet
18
+ attr_accessor :addr
19
+
20
+ # Amount (Only for settle operation)
18
21
  attr_accessor :amount
19
22
 
20
- # Address of the ERC-20 token
23
+ # ETH - for Ethereum ; XDAI - for xDai ; XDAIT - for xDai Testnet ; ALGO - Algo; <asset id> - for Algorand Standard Asset; <contract address of ERC-20 token> - for ERC-20 Tokens;
21
24
  attr_accessor :token
22
25
 
23
- # Amount in full precision
26
+ # Token amount to be settled in network format (Only for settle operation)
24
27
  attr_accessor :token_amount
25
28
 
29
+ # Token decimal places (Only for settle operation)
26
30
  attr_accessor :token_decimals
27
31
 
28
32
  # Attribute mapping from ruby-style variable name to JSON key.
29
33
  def self.attribute_map
30
34
  {
35
+ :'addr' => :'addr',
31
36
  :'amount' => :'amount',
32
37
  :'token' => :'token',
33
38
  :'token_amount' => :'token_amount',
@@ -38,28 +43,39 @@ module BleumiPay
38
43
  # Attribute type mapping.
39
44
  def self.openapi_types
40
45
  {
46
+ :'addr' => :'String',
41
47
  :'amount' => :'String',
42
48
  :'token' => :'String',
43
49
  :'token_amount' => :'String',
44
- :'token_decimals' => :'String'
50
+ :'token_decimals' => :'Integer'
45
51
  }
46
52
  end
47
53
 
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
48
60
  # Initializes the object
49
61
  # @param [Hash] attributes Model attributes in the form of hash
50
62
  def initialize(attributes = {})
51
63
  if (!attributes.is_a?(Hash))
52
- fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::WalletOperationInputs` initialize method"
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaymentOperationInputs` initialize method"
53
65
  end
54
66
 
55
67
  # check to see if the attribute exists and convert string to symbol for hash key
56
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
57
69
  if (!self.class.attribute_map.key?(k.to_sym))
58
- fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::WalletOperationInputs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::PaymentOperationInputs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
71
  end
60
72
  h[k.to_sym] = v
61
73
  }
62
74
 
75
+ if attributes.key?(:'addr')
76
+ self.addr = attributes[:'addr']
77
+ end
78
+
63
79
  if attributes.key?(:'amount')
64
80
  self.amount = attributes[:'amount']
65
81
  end
@@ -81,6 +97,10 @@ module BleumiPay
81
97
  # @return Array for valid properties with the reasons
82
98
  def list_invalid_properties
83
99
  invalid_properties = Array.new
100
+ if @addr.nil?
101
+ invalid_properties.push('invalid value for "addr", addr cannot be nil.')
102
+ end
103
+
84
104
  if @amount.nil?
85
105
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
86
106
  end
@@ -103,6 +123,7 @@ module BleumiPay
103
123
  # Check to see if the all the properties in the model are valid
104
124
  # @return true if the model is valid
105
125
  def valid?
126
+ return false if @addr.nil?
106
127
  return false if @amount.nil?
107
128
  return false if @token.nil?
108
129
  return false if @token_amount.nil?
@@ -115,6 +136,7 @@ module BleumiPay
115
136
  def ==(o)
116
137
  return true if self.equal?(o)
117
138
  self.class == o.class &&
139
+ addr == o.addr &&
118
140
  amount == o.amount &&
119
141
  token == o.token &&
120
142
  token_amount == o.token_amount &&
@@ -130,7 +152,7 @@ module BleumiPay
130
152
  # Calculates hash code according to all attributes.
131
153
  # @return [Integer] Hash code
132
154
  def hash
133
- [amount, token, token_amount, token_decimals].hash
155
+ [addr, amount, token, token_amount, token_decimals].hash
134
156
  end
135
157
 
136
158
  # Builds the object from hash
@@ -219,7 +241,11 @@ module BleumiPay
219
241
  hash = {}
220
242
  self.class.attribute_map.each_pair do |attr, param|
221
243
  value = self.send(attr)
222
- next if value.nil?
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
223
249
  hash[param] = _to_hash(value)
224
250
  end
225
251
  hash