bleumi_pay_sdk_ruby 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/README.md +61 -43
- data/bleumi_pay_sdk_ruby.gemspec +2 -3
- data/docs/BadRequest.md +1 -0
- data/docs/Chain.md +11 -0
- data/docs/CheckoutToken.md +23 -0
- data/docs/CreateCheckoutUrlRequest.md +30 -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/EthAddress.md +6 -1
- data/docs/HostedCheckoutsApi.md +190 -0
- data/docs/NetworkBalance.md +29 -0
- data/docs/PaginatedPaymentOperations.md +29 -0
- data/docs/PaginatedPayments.md +68 -0
- data/docs/PaginatedPayoutItems.md +59 -0
- data/docs/Payment.md +44 -0
- data/docs/PaymentAddresses.md +22 -0
- data/docs/PaymentBalances.md +24 -0
- data/docs/PaymentOperation.md +46 -0
- data/docs/PaymentOperationInputs.md +32 -0
- data/docs/PaymentOperationResponse.md +15 -0
- data/docs/PaymentRefundRequest.md +16 -0
- data/docs/PaymentSettleRequest.md +17 -0
- data/docs/PaymentsApi.md +426 -0
- data/docs/Payout.md +17 -0
- data/docs/PayoutItem.md +39 -0
- data/docs/PayoutItemInputs.md +28 -0
- data/docs/PayoutsApi.md +137 -0
- data/docs/Token.md +15 -0
- data/docs/ValidateCheckoutRequest.md +21 -0
- data/docs/ValidateCheckoutResponse.md +15 -0
- data/docs/WalletAddress.md +14 -0
- data/docs/WalletBalance.md +14 -4
- data/lib/bleumi_pay_sdk_ruby.rb +32 -15
- data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +200 -0
- data/lib/bleumi_pay_sdk_ruby/api/{erc20_payments_api.rb → payments_api.rb} +130 -124
- data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
- data/lib/bleumi_pay_sdk_ruby/api_client.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/api_error.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/configuration.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +13 -3
- data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +7 -5
- data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +272 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +299 -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} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +18 -22
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +243 -0
- data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +2 -2
- data/lib/bleumi_pay_sdk_ruby/models/network_balance.rb +274 -0
- 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} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +18 -8
- data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +30 -53
- data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +209 -0
- data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +207 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +42 -17
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +37 -11
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +17 -7
- data/lib/bleumi_pay_sdk_ruby/models/payout.rb +227 -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/token.rb +214 -0
- data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → validate_checkout_request.rb} +57 -62
- data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_address.rb +212 -0
- data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +17 -7
- data/lib/bleumi_pay_sdk_ruby/version.rb +3 -3
- data/spec/api/hosted_checkouts_api_spec.rb +67 -0
- data/spec/api/payments_api_spec.rb +122 -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/bad_request_spec.rb +47 -0
- data/spec/models/chain_spec.rb +35 -0
- data/spec/models/checkout_token_spec.rb +65 -0
- data/spec/models/create_checkout_url_request_spec.rb +83 -0
- data/spec/models/create_checkout_url_response_spec.rb +47 -0
- data/spec/models/create_payment_request_spec.rb +53 -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/eth_address_spec.rb +41 -0
- data/spec/models/network_balance_spec.rb +77 -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 +41 -0
- data/spec/models/payment_balances_spec.rb +41 -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 +47 -0
- data/spec/models/token_spec.rb +41 -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_address_spec.rb +41 -0
- data/spec/models/wallet_balance_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +149 -45
- data/docs/Erc20PaymentsApi.md +0 -334
- 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
@@ -0,0 +1,207 @@
|
|
1
|
+
=begin
|
2
|
+
#Bleumi Pay API
|
3
|
+
|
4
|
+
#A simple and powerful REST API to integrate ERC-20, Ethereum, xDai 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
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'ethereum' => :'ethereum'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'ethereum' => :'NetworkBalance'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# List of attributes with nullable: true
|
35
|
+
def self.openapi_nullable
|
36
|
+
Set.new([
|
37
|
+
])
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
if (!attributes.is_a?(Hash))
|
44
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaymentBalances` initialize method"
|
45
|
+
end
|
46
|
+
|
47
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
48
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
49
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
50
|
+
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
|
51
|
+
end
|
52
|
+
h[k.to_sym] = v
|
53
|
+
}
|
54
|
+
|
55
|
+
if attributes.key?(:'ethereum')
|
56
|
+
self.ethereum = attributes[:'ethereum']
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
61
|
+
# @return Array for valid properties with the reasons
|
62
|
+
def list_invalid_properties
|
63
|
+
invalid_properties = Array.new
|
64
|
+
invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
true
|
71
|
+
end
|
72
|
+
|
73
|
+
# Checks equality by comparing each attribute.
|
74
|
+
# @param [Object] Object to be compared
|
75
|
+
def ==(o)
|
76
|
+
return true if self.equal?(o)
|
77
|
+
self.class == o.class &&
|
78
|
+
ethereum == o.ethereum
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def eql?(o)
|
84
|
+
self == o
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Integer] Hash code
|
89
|
+
def hash
|
90
|
+
[ethereum].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def self.build_from_hash(attributes)
|
97
|
+
new.build_from_hash(attributes)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def build_from_hash(attributes)
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
105
|
+
self.class.openapi_types.each_pair do |key, type|
|
106
|
+
if type =~ /\AArray<(.*)>/i
|
107
|
+
# check to ensure the input is an array given that the attribute
|
108
|
+
# is documented as an array but the input is not
|
109
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
110
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
111
|
+
end
|
112
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
113
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
114
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
|
120
|
+
# Deserializes the data based on type
|
121
|
+
# @param string type Data type
|
122
|
+
# @param string value Value to be deserialized
|
123
|
+
# @return [Object] Deserialized data
|
124
|
+
def _deserialize(type, value)
|
125
|
+
case type.to_sym
|
126
|
+
when :DateTime
|
127
|
+
DateTime.parse(value)
|
128
|
+
when :Date
|
129
|
+
Date.parse(value)
|
130
|
+
when :String
|
131
|
+
value.to_s
|
132
|
+
when :Integer
|
133
|
+
value.to_i
|
134
|
+
when :Float
|
135
|
+
value.to_f
|
136
|
+
when :Boolean
|
137
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
138
|
+
true
|
139
|
+
else
|
140
|
+
false
|
141
|
+
end
|
142
|
+
when :Object
|
143
|
+
# generic object (usually a Hash), return directly
|
144
|
+
value
|
145
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
146
|
+
inner_type = Regexp.last_match[:inner_type]
|
147
|
+
value.map { |v| _deserialize(inner_type, v) }
|
148
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
149
|
+
k_type = Regexp.last_match[:k_type]
|
150
|
+
v_type = Regexp.last_match[:v_type]
|
151
|
+
{}.tap do |hash|
|
152
|
+
value.each do |k, v|
|
153
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
else # model
|
157
|
+
BleumiPay.const_get(type).build_from_hash(value)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Returns the string representation of the object
|
162
|
+
# @return [String] String presentation of the object
|
163
|
+
def to_s
|
164
|
+
to_hash.to_s
|
165
|
+
end
|
166
|
+
|
167
|
+
# to_body is an alias to to_hash (backward compatibility)
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_body
|
170
|
+
to_hash
|
171
|
+
end
|
172
|
+
|
173
|
+
# Returns the object in the form of hash
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_hash
|
176
|
+
hash = {}
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
178
|
+
value = self.send(attr)
|
179
|
+
if value.nil?
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
|
+
end
|
183
|
+
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
@@ -1,26 +1,29 @@
|
|
1
1
|
=begin
|
2
2
|
#Bleumi Pay 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 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
|
-
#
|
18
|
-
attr_accessor :
|
16
|
+
class PaymentOperation
|
17
|
+
# Transaction ID of the operation
|
18
|
+
attr_accessor :txid
|
19
19
|
|
20
|
-
#
|
20
|
+
# Network in which the operation was carried out
|
21
|
+
attr_accessor :chain
|
22
|
+
|
23
|
+
# The name of the function invoked on the [payment processor](https://pay.bleumi.com/docs/#payment-processor)
|
21
24
|
attr_accessor :func_name
|
22
25
|
|
23
|
-
#
|
26
|
+
# null - Operation in progress ; true - Operation completed successfuly ; false - Operation failed to process
|
24
27
|
attr_accessor :status
|
25
28
|
|
26
29
|
attr_accessor :inputs
|
@@ -31,7 +34,8 @@ module BleumiPay
|
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
35
|
def self.attribute_map
|
33
36
|
{
|
34
|
-
:'
|
37
|
+
:'txid' => :'txid',
|
38
|
+
:'chain' => :'chain',
|
35
39
|
:'func_name' => :'funcName',
|
36
40
|
:'status' => :'status',
|
37
41
|
:'inputs' => :'inputs',
|
@@ -42,31 +46,42 @@ module BleumiPay
|
|
42
46
|
# Attribute type mapping.
|
43
47
|
def self.openapi_types
|
44
48
|
{
|
45
|
-
:'
|
49
|
+
:'txid' => :'String',
|
50
|
+
:'chain' => :'String',
|
46
51
|
:'func_name' => :'String',
|
47
52
|
:'status' => :'Boolean',
|
48
|
-
:'inputs' => :'
|
53
|
+
:'inputs' => :'PaymentOperationInputs',
|
49
54
|
:'hash' => :'String'
|
50
55
|
}
|
51
56
|
end
|
52
57
|
|
58
|
+
# List of attributes with nullable: true
|
59
|
+
def self.openapi_nullable
|
60
|
+
Set.new([
|
61
|
+
])
|
62
|
+
end
|
63
|
+
|
53
64
|
# Initializes the object
|
54
65
|
# @param [Hash] attributes Model attributes in the form of hash
|
55
66
|
def initialize(attributes = {})
|
56
67
|
if (!attributes.is_a?(Hash))
|
57
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BleumiPay::PaymentOperation` initialize method"
|
58
69
|
end
|
59
70
|
|
60
71
|
# check to see if the attribute exists and convert string to symbol for hash key
|
61
72
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
73
|
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BleumiPay::
|
74
|
+
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
75
|
end
|
65
76
|
h[k.to_sym] = v
|
66
77
|
}
|
67
78
|
|
68
|
-
if attributes.key?(:'
|
69
|
-
self.
|
79
|
+
if attributes.key?(:'txid')
|
80
|
+
self.txid = attributes[:'txid']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'chain')
|
84
|
+
self.chain = attributes[:'chain']
|
70
85
|
end
|
71
86
|
|
72
87
|
if attributes.key?(:'func_name')
|
@@ -90,6 +105,10 @@ module BleumiPay
|
|
90
105
|
# @return Array for valid properties with the reasons
|
91
106
|
def list_invalid_properties
|
92
107
|
invalid_properties = Array.new
|
108
|
+
if @chain.nil?
|
109
|
+
invalid_properties.push('invalid value for "chain", chain cannot be nil.')
|
110
|
+
end
|
111
|
+
|
93
112
|
if @func_name.nil?
|
94
113
|
invalid_properties.push('invalid value for "func_name", func_name cannot be nil.')
|
95
114
|
end
|
@@ -112,6 +131,7 @@ module BleumiPay
|
|
112
131
|
# Check to see if the all the properties in the model are valid
|
113
132
|
# @return true if the model is valid
|
114
133
|
def valid?
|
134
|
+
return false if @chain.nil?
|
115
135
|
return false if @func_name.nil?
|
116
136
|
return false if @status.nil?
|
117
137
|
return false if @inputs.nil?
|
@@ -124,7 +144,8 @@ module BleumiPay
|
|
124
144
|
def ==(o)
|
125
145
|
return true if self.equal?(o)
|
126
146
|
self.class == o.class &&
|
127
|
-
|
147
|
+
txid == o.txid &&
|
148
|
+
chain == o.chain &&
|
128
149
|
func_name == o.func_name &&
|
129
150
|
status == o.status &&
|
130
151
|
inputs == o.inputs &&
|
@@ -140,7 +161,7 @@ module BleumiPay
|
|
140
161
|
# Calculates hash code according to all attributes.
|
141
162
|
# @return [Integer] Hash code
|
142
163
|
def hash
|
143
|
-
[
|
164
|
+
[txid, chain, func_name, status, inputs, hash].hash
|
144
165
|
end
|
145
166
|
|
146
167
|
# Builds the object from hash
|
@@ -229,7 +250,11 @@ module BleumiPay
|
|
229
250
|
hash = {}
|
230
251
|
self.class.attribute_map.each_pair do |attr, param|
|
231
252
|
value = self.send(attr)
|
232
|
-
|
253
|
+
if value.nil?
|
254
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
255
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
256
|
+
end
|
257
|
+
|
233
258
|
hash[param] = _to_hash(value)
|
234
259
|
end
|
235
260
|
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
2
|
#Bleumi Pay 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 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 ; <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
|