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,221 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay REST API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate Algorand, Ethereum, ERC-20 and xDai payments and/or payouts into your business
|
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.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module BleumiPay
|
16
|
+
class EthereumWalletAddress
|
17
|
+
# Wallet address for the payment in the network
|
18
|
+
attr_accessor :addr
|
19
|
+
|
20
|
+
attr_accessor :inputs
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'addr' => :'addr',
|
26
|
+
:'inputs' => :'inputs'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'addr' => :'String',
|
34
|
+
:'inputs' => :'EthereumWalletInputs'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new([
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::EthereumWalletAddress` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::EthereumWalletAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'addr')
|
60
|
+
self.addr = attributes[:'addr']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.key?(:'inputs')
|
64
|
+
self.inputs = attributes[:'inputs']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
if @addr.nil?
|
73
|
+
invalid_properties.push('invalid value for "addr", addr cannot be nil.')
|
74
|
+
end
|
75
|
+
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
return false if @addr.nil?
|
83
|
+
true
|
84
|
+
end
|
85
|
+
|
86
|
+
# Checks equality by comparing each attribute.
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def ==(o)
|
89
|
+
return true if self.equal?(o)
|
90
|
+
self.class == o.class &&
|
91
|
+
addr == o.addr &&
|
92
|
+
inputs == o.inputs
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(o)
|
98
|
+
self == o
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[addr, inputs].hash
|
105
|
+
end
|
106
|
+
|
107
|
+
# Builds the object from hash
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
+
# @return [Object] Returns the model itself
|
110
|
+
def self.build_from_hash(attributes)
|
111
|
+
new.build_from_hash(attributes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Builds the object from hash
|
115
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
116
|
+
# @return [Object] Returns the model itself
|
117
|
+
def build_from_hash(attributes)
|
118
|
+
return nil unless attributes.is_a?(Hash)
|
119
|
+
self.class.openapi_types.each_pair do |key, type|
|
120
|
+
if type =~ /\AArray<(.*)>/i
|
121
|
+
# check to ensure the input is an array given that the attribute
|
122
|
+
# is documented as an array but the input is not
|
123
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
124
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
128
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
129
|
+
end
|
130
|
+
|
131
|
+
self
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def _deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :DateTime
|
141
|
+
DateTime.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
@@ -1,42 +1,42 @@
|
|
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 Algorand, Ethereum, ERC-20 and xDai payments and/or payouts into your business
|
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.3
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module BleumiPay
|
16
|
-
class
|
17
|
-
# Address
|
16
|
+
class EthereumWalletInputs
|
17
|
+
# Buyer Address
|
18
18
|
attr_accessor :buyer
|
19
19
|
|
20
|
-
# Address
|
20
|
+
# Merchant Address
|
21
21
|
attr_accessor :merchant
|
22
22
|
|
23
|
-
#
|
23
|
+
# Salt
|
24
|
+
attr_accessor :salt
|
25
|
+
|
26
|
+
# Wallet Library
|
24
27
|
attr_accessor :wallet_library
|
25
28
|
|
26
|
-
# Wallet Proxy
|
29
|
+
# Wallet Proxy
|
27
30
|
attr_accessor :wallet_proxy
|
28
31
|
|
29
|
-
# Salt used to create the wallet
|
30
|
-
attr_accessor :salt
|
31
|
-
|
32
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
33
33
|
def self.attribute_map
|
34
34
|
{
|
35
35
|
:'buyer' => :'buyer',
|
36
36
|
:'merchant' => :'merchant',
|
37
|
+
:'salt' => :'salt',
|
37
38
|
:'wallet_library' => :'walletLibrary',
|
38
|
-
:'wallet_proxy' => :'walletProxy'
|
39
|
-
:'salt' => :'salt'
|
39
|
+
:'wallet_proxy' => :'walletProxy'
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
@@ -45,23 +45,29 @@ module BleumiPay
|
|
45
45
|
{
|
46
46
|
:'buyer' => :'String',
|
47
47
|
:'merchant' => :'String',
|
48
|
+
:'salt' => :'String',
|
48
49
|
:'wallet_library' => :'String',
|
49
|
-
:'wallet_proxy' => :'String'
|
50
|
-
:'salt' => :'String'
|
50
|
+
:'wallet_proxy' => :'String'
|
51
51
|
}
|
52
52
|
end
|
53
53
|
|
54
|
+
# List of attributes with nullable: true
|
55
|
+
def self.openapi_nullable
|
56
|
+
Set.new([
|
57
|
+
])
|
58
|
+
end
|
59
|
+
|
54
60
|
# Initializes the object
|
55
61
|
# @param [Hash] attributes Model attributes in the form of hash
|
56
62
|
def initialize(attributes = {})
|
57
63
|
if (!attributes.is_a?(Hash))
|
58
|
-
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::EthereumWalletInputs` initialize method"
|
59
65
|
end
|
60
66
|
|
61
67
|
# check to see if the attribute exists and convert string to symbol for hash key
|
62
68
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
69
|
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::EthereumWalletInputs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
71
|
end
|
66
72
|
h[k.to_sym] = v
|
67
73
|
}
|
@@ -74,6 +80,10 @@ module BleumiPay
|
|
74
80
|
self.merchant = attributes[:'merchant']
|
75
81
|
end
|
76
82
|
|
83
|
+
if attributes.key?(:'salt')
|
84
|
+
self.salt = attributes[:'salt']
|
85
|
+
end
|
86
|
+
|
77
87
|
if attributes.key?(:'wallet_library')
|
78
88
|
self.wallet_library = attributes[:'wallet_library']
|
79
89
|
end
|
@@ -81,47 +91,18 @@ module BleumiPay
|
|
81
91
|
if attributes.key?(:'wallet_proxy')
|
82
92
|
self.wallet_proxy = attributes[:'wallet_proxy']
|
83
93
|
end
|
84
|
-
|
85
|
-
if attributes.key?(:'salt')
|
86
|
-
self.salt = attributes[:'salt']
|
87
|
-
end
|
88
94
|
end
|
89
95
|
|
90
96
|
# Show invalid properties with the reasons. Usually used together with valid?
|
91
97
|
# @return Array for valid properties with the reasons
|
92
98
|
def list_invalid_properties
|
93
99
|
invalid_properties = Array.new
|
94
|
-
if @buyer.nil?
|
95
|
-
invalid_properties.push('invalid value for "buyer", buyer cannot be nil.')
|
96
|
-
end
|
97
|
-
|
98
|
-
if @merchant.nil?
|
99
|
-
invalid_properties.push('invalid value for "merchant", merchant cannot be nil.')
|
100
|
-
end
|
101
|
-
|
102
|
-
if @wallet_library.nil?
|
103
|
-
invalid_properties.push('invalid value for "wallet_library", wallet_library cannot be nil.')
|
104
|
-
end
|
105
|
-
|
106
|
-
if @wallet_proxy.nil?
|
107
|
-
invalid_properties.push('invalid value for "wallet_proxy", wallet_proxy cannot be nil.')
|
108
|
-
end
|
109
|
-
|
110
|
-
if @salt.nil?
|
111
|
-
invalid_properties.push('invalid value for "salt", salt cannot be nil.')
|
112
|
-
end
|
113
|
-
|
114
100
|
invalid_properties
|
115
101
|
end
|
116
102
|
|
117
103
|
# Check to see if the all the properties in the model are valid
|
118
104
|
# @return true if the model is valid
|
119
105
|
def valid?
|
120
|
-
return false if @buyer.nil?
|
121
|
-
return false if @merchant.nil?
|
122
|
-
return false if @wallet_library.nil?
|
123
|
-
return false if @wallet_proxy.nil?
|
124
|
-
return false if @salt.nil?
|
125
106
|
true
|
126
107
|
end
|
127
108
|
|
@@ -132,9 +113,9 @@ module BleumiPay
|
|
132
113
|
self.class == o.class &&
|
133
114
|
buyer == o.buyer &&
|
134
115
|
merchant == o.merchant &&
|
116
|
+
salt == o.salt &&
|
135
117
|
wallet_library == o.wallet_library &&
|
136
|
-
wallet_proxy == o.wallet_proxy
|
137
|
-
salt == o.salt
|
118
|
+
wallet_proxy == o.wallet_proxy
|
138
119
|
end
|
139
120
|
|
140
121
|
# @see the `==` method
|
@@ -146,7 +127,7 @@ module BleumiPay
|
|
146
127
|
# Calculates hash code according to all attributes.
|
147
128
|
# @return [Integer] Hash code
|
148
129
|
def hash
|
149
|
-
[buyer, merchant, wallet_library, wallet_proxy
|
130
|
+
[buyer, merchant, salt, wallet_library, wallet_proxy].hash
|
150
131
|
end
|
151
132
|
|
152
133
|
# Builds the object from hash
|
@@ -235,7 +216,11 @@ module BleumiPay
|
|
235
216
|
hash = {}
|
236
217
|
self.class.attribute_map.each_pair do |attr, param|
|
237
218
|
value = self.send(attr)
|
238
|
-
|
219
|
+
if value.nil?
|
220
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
|
+
end
|
223
|
+
|
239
224
|
hash[param] = _to_hash(value)
|
240
225
|
end
|
241
226
|
hash
|
@@ -0,0 +1,224 @@
|
|
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
|
+
class PaginatedPaymentOperations
|
17
|
+
# List of operations of the payment in the current page
|
18
|
+
attr_accessor :results
|
19
|
+
|
20
|
+
# Cursor to fetch next page of results, empty if no more results
|
21
|
+
attr_accessor :next_token
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'results' => :'results',
|
27
|
+
:'next_token' => :'nextToken'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.openapi_types
|
33
|
+
{
|
34
|
+
:'results' => :'Array<PaymentOperation>',
|
35
|
+
:'next_token' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaginatedPaymentOperations` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::PaginatedPaymentOperations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'results')
|
61
|
+
if (value = attributes[:'results']).is_a?(Array)
|
62
|
+
self.results = value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'next_token')
|
67
|
+
self.next_token = attributes[:'next_token']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
+
# @return Array for valid properties with the reasons
|
73
|
+
def list_invalid_properties
|
74
|
+
invalid_properties = Array.new
|
75
|
+
if @results.nil?
|
76
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
77
|
+
end
|
78
|
+
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
return false if @results.nil?
|
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
|
+
results == o.results &&
|
95
|
+
next_token == o.next_token
|
96
|
+
end
|
97
|
+
|
98
|
+
# @see the `==` method
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
102
|
+
end
|
103
|
+
|
104
|
+
# Calculates hash code according to all attributes.
|
105
|
+
# @return [Integer] Hash code
|
106
|
+
def hash
|
107
|
+
[results, next_token].hash
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def self.build_from_hash(attributes)
|
114
|
+
new.build_from_hash(attributes)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :Boolean
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the string representation of the object
|
179
|
+
# @return [String] String presentation of the object
|
180
|
+
def to_s
|
181
|
+
to_hash.to_s
|
182
|
+
end
|
183
|
+
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
186
|
+
def to_body
|
187
|
+
to_hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the object in the form of hash
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_hash
|
193
|
+
hash = {}
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
195
|
+
value = self.send(attr)
|
196
|
+
if value.nil?
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
199
|
+
end
|
200
|
+
|
201
|
+
hash[param] = _to_hash(value)
|
202
|
+
end
|
203
|
+
hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Outputs non-array value in the form of hash
|
207
|
+
# For object, use to_hash. Otherwise, just return the value
|
208
|
+
# @param [Object] value Any valid value
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
210
|
+
def _to_hash(value)
|
211
|
+
if value.is_a?(Array)
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
213
|
+
elsif value.is_a?(Hash)
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
216
|
+
end
|
217
|
+
elsif value.respond_to? :to_hash
|
218
|
+
value.to_hash
|
219
|
+
else
|
220
|
+
value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|