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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +67 -47
- data/bleumi_pay_sdk_ruby.gemspec +4 -5
- data/docs/AlgorandBalance.md +28 -0
- data/docs/AlgorandWalletAddress.md +24 -0
- data/docs/AlgorandWalletInputs.md +23 -0
- data/docs/BadRequest.md +2 -1
- data/docs/Chain.md +14 -0
- data/docs/CheckoutToken.md +28 -0
- data/docs/CreateCheckoutUrlRequest.md +28 -0
- data/docs/CreateCheckoutUrlResponse.md +17 -0
- data/docs/CreatePaymentRequest.md +19 -0
- data/docs/CreatePaymentResponse.md +15 -0
- data/docs/CreatePayoutRequest.md +28 -0
- data/docs/CreatePayoutResponse.md +15 -0
- data/docs/EthereumBalance.md +30 -0
- data/docs/EthereumWalletAddress.md +23 -0
- data/docs/EthereumWalletInputs.md +23 -0
- data/docs/HostedCheckoutsApi.md +197 -0
- data/docs/PaginatedPaymentOperations.md +28 -0
- data/docs/PaginatedPayments.md +95 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +67 -0
- data/docs/PaymentAddresses.md +21 -0
- data/docs/PaymentBalances.md +21 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +31 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +14 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +368 -0
- data/docs/Payout.md +18 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/RskBalance.md +28 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletBalance.md +18 -4
- data/hc_create.rb +40 -0
- data/hc_list.rb +17 -0
- data/hc_validate.rb +22 -0
- data/lib/bleumi_pay_sdk_ruby.rb +38 -17
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +517 -0
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +288 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +11 -9
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +3 -3
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +4 -4
- data/lib/bleumi_pay_sdk_ruby/models/algorand_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_inputs.rb +247 -0
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +15 -5
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +12 -9
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +302 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +312 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +33 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +19 -23
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_balance.rb +241 -0
- data/lib/bleumi_pay_sdk_ruby/models/ethereum_wallet_address.rb +221 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → ethereum_wallet_inputs.rb} +35 -50
- data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +19 -9
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +31 -54
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +231 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +225 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +44 -18
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +38 -12
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +237 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
- data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
- data/lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb +219 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +257 -0
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +37 -12
- data/lib/bleumi_pay_sdk_ruby/version.rb +4 -4
- data/po_create.rb +39 -0
- data/po_list.rb +23 -0
- data/py_create.rb +48 -0
- data/py_get.rb +18 -0
- data/py_getop.rb +19 -0
- data/py_list.rb +24 -0
- data/py_listops.rb +21 -0
- data/py_refund.rb +43 -0
- data/py_settle.rb +43 -0
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +123 -0
- data/spec/api/payouts_api_spec.rb +61 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/algorand_balance_spec.rb +47 -0
- data/spec/models/algorand_wallet_address_spec.rb +47 -0
- data/spec/models/algorand_wallet_inputs_spec.rb +65 -0
- data/spec/models/bad_request_spec.rb +47 -0
- data/spec/models/chain_spec.rb +35 -0
- data/spec/models/checkout_token_spec.rb +77 -0
- data/spec/models/create_checkout_url_request_spec.rb +89 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +59 -0
- data/spec/models/create_payment_response_spec.rb +41 -0
- data/spec/models/create_payout_request_spec.rb +53 -0
- data/spec/models/create_payout_response_spec.rb +41 -0
- data/spec/models/ethereum_balance_spec.rb +59 -0
- data/spec/models/ethereum_wallet_address_spec.rb +47 -0
- data/spec/models/ethereum_wallet_inputs_spec.rb +65 -0
- data/spec/models/paginated_payment_operations_spec.rb +47 -0
- data/spec/models/paginated_payments_spec.rb +47 -0
- data/spec/models/paginated_payout_items_spec.rb +47 -0
- data/spec/models/payment_addresses_spec.rb +53 -0
- data/spec/models/payment_balances_spec.rb +53 -0
- data/spec/models/payment_operation_inputs_spec.rb +65 -0
- data/spec/models/payment_operation_response_spec.rb +41 -0
- data/spec/models/payment_operation_spec.rb +71 -0
- data/spec/models/payment_refund_request_spec.rb +41 -0
- data/spec/models/payment_settle_request_spec.rb +47 -0
- data/spec/models/payment_spec.rb +65 -0
- data/spec/models/payout_item_inputs_spec.rb +53 -0
- data/spec/models/payout_item_spec.rb +71 -0
- data/spec/models/payout_spec.rb +53 -0
- data/spec/models/rsk_balance_spec.rb +47 -0
- data/spec/models/validate_checkout_request_spec.rb +59 -0
- data/spec/models/validate_checkout_response_spec.rb +41 -0
- data/spec/models/wallet_balance_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +180 -49
- data/docs/Erc20PaymentsApi.md +0 -334
- data/docs/EthAddress.md +0 -8
- data/docs/EthNetwork.md +0 -9
- data/docs/PaginatedWalletOperations.md +0 -8
- data/docs/PaginatedWallets.md +0 -8
- data/docs/Wallet.md +0 -13
- data/docs/WalletCreateInput.md +0 -9
- data/docs/WalletCreateOutput.md +0 -10
- data/docs/WalletInputs.md +0 -11
- data/docs/WalletOperation.md +0 -11
- data/docs/WalletOperationInputs.md +0 -10
- data/docs/WalletOperationOutput.md +0 -8
- data/docs/WalletRefundOperationInput.md +0 -7
- data/docs/WalletSettleOperationInput.md +0 -8
- data/lib/bleumi_pay_sdk_ruby/api/erc20_payments_api.rb +0 -482
- 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
|
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.
|
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
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# Payment Operation details
|
17
|
+
class PaymentOperation
|
18
|
+
# Transaction ID of the operation
|
19
|
+
attr_accessor :txid
|
19
20
|
|
20
|
-
#
|
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
|
-
#
|
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
|
-
:'
|
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
|
-
:'
|
50
|
+
:'txid' => :'String',
|
51
|
+
:'chain' => :'String',
|
46
52
|
:'func_name' => :'String',
|
47
53
|
:'status' => :'Boolean',
|
48
|
-
:'inputs' => :'
|
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::
|
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::
|
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?(:'
|
69
|
-
self.
|
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
|
-
|
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
|
-
[
|
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
|
-
|
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
|
data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb}
RENAMED
@@ -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
|
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.
|
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
|
17
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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' => :'
|
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::
|
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::
|
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
|
-
|
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
|