masspay_ruby_sdk 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/CODE_OF_CONDUCT.md +43 -0
- data/CONTRIBUTING.md +48 -9
- data/LICENSE.md +21 -0
- data/README.md +141 -176
- data/assets/logo.webp +0 -0
- data/lib/masspay_ruby_sdk/api/account_service.rb +35 -0
- data/lib/masspay_ruby_sdk/api/attribute_service.rb +41 -0
- data/lib/masspay_ruby_sdk/api/card_service.rb +35 -0
- data/lib/masspay_ruby_sdk/api/catalog_service.rb +74 -0
- data/lib/masspay_ruby_sdk/api/kyc_service.rb +56 -0
- data/lib/masspay_ruby_sdk/api/load_service.rb +62 -0
- data/lib/masspay_ruby_sdk/api/payout_service.rb +61 -0
- data/lib/masspay_ruby_sdk/api/spend_back_service.rb +35 -0
- data/lib/masspay_ruby_sdk/api/subaccount_service.rb +47 -0
- data/lib/masspay_ruby_sdk/api/tax_service.rb +38 -0
- data/lib/masspay_ruby_sdk/api/user_service.rb +71 -0
- data/lib/masspay_ruby_sdk/api/wallet_service.rb +50 -0
- data/lib/masspay_ruby_sdk/client.rb +93 -0
- data/lib/masspay_ruby_sdk/constants.rb +20 -0
- data/lib/masspay_ruby_sdk/version.rb +6 -8
- data/lib/masspay_ruby_sdk.rb +23 -75
- data/masspay_ruby_sdk.gemspec +9 -13
- metadata +24 -120
- data/Rakefile +0 -10
- data/docs/AccountApi.md +0 -150
- data/docs/ApiResponse.md +0 -22
- data/docs/AttrTxn.md +0 -20
- data/docs/AttrValue.md +0 -20
- data/docs/AttrVelocityRequestInner.md +0 -20
- data/docs/AttributeApi.md +0 -168
- data/docs/AttrsRequirement.md +0 -36
- data/docs/AutopayResp.md +0 -22
- data/docs/AutopayRule.md +0 -20
- data/docs/AvailableBalanceTxnResp.md +0 -22
- data/docs/CardApi.md +0 -160
- data/docs/CatalogApi.md +0 -469
- data/docs/CompaniesResp.md +0 -18
- data/docs/Company.md +0 -26
- data/docs/Country.md +0 -22
- data/docs/Exception.md +0 -20
- data/docs/FoundUser.md +0 -24
- data/docs/GetAccountStatement200Response.md +0 -18
- data/docs/GetTransactionConfirmationDetails200Response.md +0 -18
- data/docs/GetUserAgreement200Response.md +0 -26
- data/docs/GetUserAgreementsNames200ResponseInner.md +0 -24
- data/docs/GetUserUserTokenKycAu10tix200Response.md +0 -18
- data/docs/GetUserUserTokenKycVeriff200Response.md +0 -18
- data/docs/GetWalletCardInfo200Response.md +0 -30
- data/docs/IDUpload.md +0 -20
- data/docs/KYCApi.md +0 -305
- data/docs/LoadApi.md +0 -621
- data/docs/LoadTxn.md +0 -32
- data/docs/LoadTxnResp.md +0 -20
- data/docs/Loads.md +0 -36
- data/docs/PayoutApi.md +0 -403
- data/docs/PayoutTxn.md +0 -36
- data/docs/PayoutTxnCommitResp.md +0 -24
- data/docs/PayoutTxnResp.md +0 -60
- data/docs/ResendBalanceNotification200Response.md +0 -18
- data/docs/Service.md +0 -22
- data/docs/ServicePayersInner.md +0 -38
- data/docs/ServicePayersInnerExchangeRateInner.md +0 -20
- data/docs/SpendBackApi.md +0 -161
- data/docs/SpendBackTxn.md +0 -28
- data/docs/SpendBackTxnResp.md +0 -22
- data/docs/SpendBacks.md +0 -34
- data/docs/StoredUser.md +0 -56
- data/docs/TaxApi.md +0 -81
- data/docs/TaxYearUserResp.md +0 -48
- data/docs/TxnHistoryResp.md +0 -52
- data/docs/UpdateUser.md +0 -52
- data/docs/User.md +0 -50
- data/docs/UserApi.md +0 -403
- data/docs/WalletApi.md +0 -463
- data/docs/WalletTxnResp.md +0 -34
- data/docs/logo.webp +0 -0
- data/lib/masspay_ruby_sdk/api/account_api.rb +0 -149
- data/lib/masspay_ruby_sdk/api/attribute_api.rb +0 -214
- data/lib/masspay_ruby_sdk/api/card_api.rb +0 -174
- data/lib/masspay_ruby_sdk/api/catalog_api.rb +0 -443
- data/lib/masspay_ruby_sdk/api/kyc_api.rb +0 -290
- data/lib/masspay_ruby_sdk/api/load_api.rb +0 -598
- data/lib/masspay_ruby_sdk/api/payout_api.rb +0 -397
- data/lib/masspay_ruby_sdk/api/spend_back_api.rb +0 -160
- data/lib/masspay_ruby_sdk/api/tax_api.rb +0 -82
- data/lib/masspay_ruby_sdk/api/user_api.rb +0 -418
- data/lib/masspay_ruby_sdk/api/wallet_api.rb +0 -461
- data/lib/masspay_ruby_sdk/api_client.rb +0 -391
- data/lib/masspay_ruby_sdk/api_error.rb +0 -57
- data/lib/masspay_ruby_sdk/configuration.rb +0 -315
- data/lib/masspay_ruby_sdk/models/api_response.rb +0 -236
- data/lib/masspay_ruby_sdk/models/attr_txn.rb +0 -235
- data/lib/masspay_ruby_sdk/models/attr_value.rb +0 -239
- data/lib/masspay_ruby_sdk/models/attr_velocity_request_inner.rb +0 -273
- data/lib/masspay_ruby_sdk/models/attrs_requirement.rb +0 -372
- data/lib/masspay_ruby_sdk/models/autopay_resp.rb +0 -256
- data/lib/masspay_ruby_sdk/models/autopay_rule.rb +0 -241
- data/lib/masspay_ruby_sdk/models/available_balance_txn_resp.rb +0 -254
- data/lib/masspay_ruby_sdk/models/companies_resp.rb +0 -225
- data/lib/masspay_ruby_sdk/models/company.rb +0 -285
- data/lib/masspay_ruby_sdk/models/country.rb +0 -296
- data/lib/masspay_ruby_sdk/models/exception.rb +0 -241
- data/lib/masspay_ruby_sdk/models/found_user.rb +0 -270
- data/lib/masspay_ruby_sdk/models/get_account_statement200_response.rb +0 -225
- data/lib/masspay_ruby_sdk/models/get_transaction_confirmation_details200_response.rb +0 -218
- data/lib/masspay_ruby_sdk/models/get_user_agreement200_response.rb +0 -280
- data/lib/masspay_ruby_sdk/models/get_user_agreements_names200_response_inner.rb +0 -270
- data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_au10tix200_response.rb +0 -224
- data/lib/masspay_ruby_sdk/models/get_user_user_token_kyc_veriff200_response.rb +0 -224
- data/lib/masspay_ruby_sdk/models/get_wallet_card_info200_response.rb +0 -460
- data/lib/masspay_ruby_sdk/models/id_upload.rb +0 -273
- data/lib/masspay_ruby_sdk/models/load_txn.rb +0 -321
- data/lib/masspay_ruby_sdk/models/load_txn_resp.rb +0 -273
- data/lib/masspay_ruby_sdk/models/loads.rb +0 -388
- data/lib/masspay_ruby_sdk/models/payout_txn.rb +0 -328
- data/lib/masspay_ruby_sdk/models/payout_txn_commit_resp.rb +0 -293
- data/lib/masspay_ruby_sdk/models/payout_txn_resp.rb +0 -613
- data/lib/masspay_ruby_sdk/models/resend_balance_notification200_response.rb +0 -225
- data/lib/masspay_ruby_sdk/models/service.rb +0 -318
- data/lib/masspay_ruby_sdk/models/service_payers_inner.rb +0 -373
- data/lib/masspay_ruby_sdk/models/service_payers_inner_exchange_rate_inner.rb +0 -239
- data/lib/masspay_ruby_sdk/models/spend_back_txn.rb +0 -325
- data/lib/masspay_ruby_sdk/models/spend_back_txn_resp.rb +0 -307
- data/lib/masspay_ruby_sdk/models/spend_backs.rb +0 -340
- data/lib/masspay_ruby_sdk/models/stored_user.rb +0 -500
- data/lib/masspay_ruby_sdk/models/tax_year_user_resp.rb +0 -388
- data/lib/masspay_ruby_sdk/models/txn_history_resp.rb +0 -571
- data/lib/masspay_ruby_sdk/models/update_user.rb +0 -490
- data/lib/masspay_ruby_sdk/models/user.rb +0 -423
- data/lib/masspay_ruby_sdk/models/wallet_txn_resp.rb +0 -375
- data/spec/api_client_spec.rb +0 -227
- data/spec/configuration_spec.rb +0 -41
- data/spec/spec_helper.rb +0 -110
@@ -1,613 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#MassPay API
|
3
|
-
|
4
|
-
#MassPay API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 0.1.4
|
7
|
-
Contact: support@masspay.io
|
8
|
-
Generated by: MassPay Inc.
|
9
|
-
OpenAPI Generator version: 6.5.0
|
10
|
-
=end
|
11
|
-
|
12
|
-
require 'date'
|
13
|
-
require 'time'
|
14
|
-
|
15
|
-
module MassPayRubySdk
|
16
|
-
#
|
17
|
-
class PayoutTxnResp
|
18
|
-
# Token that represents the transaction that was just created. Need to be used to commit the transaction in `/payout/{user_token}/{payout_token}`. Value would be NSF if there are not enough funds in the `source_token`. Value would be `DUPLICATE` if there is a duplicate `client_transfer_id`.
|
19
|
-
attr_accessor :payout_token
|
20
|
-
|
21
|
-
# A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters.
|
22
|
-
attr_accessor :client_transfer_id
|
23
|
-
|
24
|
-
# The currency originating balance is stored in. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. In most cases this value will be USD, and therefore the defaut value if none is provided
|
25
|
-
attr_accessor :source_currency_code
|
26
|
-
|
27
|
-
# The currency the funds will be deposited into. Using [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format
|
28
|
-
attr_accessor :destination_currency_code
|
29
|
-
|
30
|
-
# Token that represents the funding source i.e. your bank account, user's wallet. 36 characters long
|
31
|
-
attr_accessor :source_token
|
32
|
-
|
33
|
-
# Token that represents the payout destination i.e. Omnex->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback. If not provided, the last destination that was used for this user will be used. 36 characters long
|
34
|
-
attr_accessor :destination_token
|
35
|
-
|
36
|
-
# The amount to be sent for payout in source currency. i.e USD. Must be provided if source_amount is empty
|
37
|
-
attr_accessor :destination_amount
|
38
|
-
|
39
|
-
# The amount to be received by the payout in source currency. i.e USD. Must be provided if destination_amount is empty
|
40
|
-
attr_accessor :source_amount
|
41
|
-
|
42
|
-
# Token that represents set of attributes that associated with destination_token. For example, bank account, mobile account, wallet id, etc. If not provided, uses the last one used. 36 characters long
|
43
|
-
attr_accessor :attr_set_token
|
44
|
-
|
45
|
-
# The exchange rate to convert source_amount to destination_amount
|
46
|
-
attr_accessor :exchange_rate
|
47
|
-
|
48
|
-
# Fee to be charged for the transaction
|
49
|
-
attr_accessor :fee
|
50
|
-
|
51
|
-
# The time and date at which the transaction will expire. The transaction has to be finalized before this time. Transactions are valid for 2 minutes from creation time. If expired, a new transaction has to be created.
|
52
|
-
attr_accessor :expiration
|
53
|
-
|
54
|
-
# Code/pin that is required when collecting the money. Should be provided to the recipient to present to payout location.
|
55
|
-
attr_accessor :pickup_code
|
56
|
-
|
57
|
-
# The status of the transaction
|
58
|
-
attr_accessor :status
|
59
|
-
|
60
|
-
# base64 representation of the payer logo
|
61
|
-
attr_accessor :payer_logo
|
62
|
-
|
63
|
-
# Name of payer
|
64
|
-
attr_accessor :payer_name
|
65
|
-
|
66
|
-
# The type of delivery
|
67
|
-
attr_accessor :delivery_type
|
68
|
-
|
69
|
-
# Country code [ISO_3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3)
|
70
|
-
attr_accessor :country_code
|
71
|
-
|
72
|
-
# Optional JSON object with attributes that can later be searched to locate this payout. Do not include PII as this object is not encrypted.
|
73
|
-
attr_accessor :metadata
|
74
|
-
|
75
|
-
# Estimated availability of funds. When funds would be available to pickup/deposited
|
76
|
-
attr_accessor :estimated_availability
|
77
|
-
|
78
|
-
# Optional. Contains the reason for the status change. Most commonly used for CANCELLED status with the reason for cancellation
|
79
|
-
attr_accessor :status_reason
|
80
|
-
|
81
|
-
# The relevant attributes that were used to fulfill this payout
|
82
|
-
attr_accessor :attrs
|
83
|
-
|
84
|
-
class EnumAttributeValidator
|
85
|
-
attr_reader :datatype
|
86
|
-
attr_reader :allowable_values
|
87
|
-
|
88
|
-
def initialize(datatype, allowable_values)
|
89
|
-
@allowable_values = allowable_values.map do |value|
|
90
|
-
case datatype.to_s
|
91
|
-
when /Integer/i
|
92
|
-
value.to_i
|
93
|
-
when /Float/i
|
94
|
-
value.to_f
|
95
|
-
else
|
96
|
-
value
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def valid?(value)
|
102
|
-
!value || allowable_values.include?(value)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
107
|
-
def self.attribute_map
|
108
|
-
{
|
109
|
-
:'payout_token' => :'payout_token',
|
110
|
-
:'client_transfer_id' => :'client_transfer_id',
|
111
|
-
:'source_currency_code' => :'source_currency_code',
|
112
|
-
:'destination_currency_code' => :'destination_currency_code',
|
113
|
-
:'source_token' => :'source_token',
|
114
|
-
:'destination_token' => :'destination_token',
|
115
|
-
:'destination_amount' => :'destination_amount',
|
116
|
-
:'source_amount' => :'source_amount',
|
117
|
-
:'attr_set_token' => :'attr_set_token',
|
118
|
-
:'exchange_rate' => :'exchange_rate',
|
119
|
-
:'fee' => :'fee',
|
120
|
-
:'expiration' => :'expiration',
|
121
|
-
:'pickup_code' => :'pickup_code',
|
122
|
-
:'status' => :'status',
|
123
|
-
:'payer_logo' => :'payer_logo',
|
124
|
-
:'payer_name' => :'payer_name',
|
125
|
-
:'delivery_type' => :'delivery_type',
|
126
|
-
:'country_code' => :'country_code',
|
127
|
-
:'metadata' => :'metadata',
|
128
|
-
:'estimated_availability' => :'estimated_availability',
|
129
|
-
:'status_reason' => :'status_reason',
|
130
|
-
:'attrs' => :'attrs'
|
131
|
-
}
|
132
|
-
end
|
133
|
-
|
134
|
-
# Returns all the JSON keys this model knows about
|
135
|
-
def self.acceptable_attributes
|
136
|
-
attribute_map.values
|
137
|
-
end
|
138
|
-
|
139
|
-
# Attribute type mapping.
|
140
|
-
def self.openapi_types
|
141
|
-
{
|
142
|
-
:'payout_token' => :'String',
|
143
|
-
:'client_transfer_id' => :'String',
|
144
|
-
:'source_currency_code' => :'String',
|
145
|
-
:'destination_currency_code' => :'String',
|
146
|
-
:'source_token' => :'String',
|
147
|
-
:'destination_token' => :'String',
|
148
|
-
:'destination_amount' => :'Float',
|
149
|
-
:'source_amount' => :'Float',
|
150
|
-
:'attr_set_token' => :'String',
|
151
|
-
:'exchange_rate' => :'Float',
|
152
|
-
:'fee' => :'Float',
|
153
|
-
:'expiration' => :'String',
|
154
|
-
:'pickup_code' => :'String',
|
155
|
-
:'status' => :'String',
|
156
|
-
:'payer_logo' => :'String',
|
157
|
-
:'payer_name' => :'String',
|
158
|
-
:'delivery_type' => :'String',
|
159
|
-
:'country_code' => :'String',
|
160
|
-
:'metadata' => :'Object',
|
161
|
-
:'estimated_availability' => :'Time',
|
162
|
-
:'status_reason' => :'String',
|
163
|
-
:'attrs' => :'Object'
|
164
|
-
}
|
165
|
-
end
|
166
|
-
|
167
|
-
# List of attributes with nullable: true
|
168
|
-
def self.openapi_nullable
|
169
|
-
Set.new([
|
170
|
-
])
|
171
|
-
end
|
172
|
-
|
173
|
-
# Initializes the object
|
174
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
175
|
-
def initialize(attributes = {})
|
176
|
-
if (!attributes.is_a?(Hash))
|
177
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `MassPayRubySdk::PayoutTxnResp` initialize method"
|
178
|
-
end
|
179
|
-
|
180
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
181
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
182
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
183
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `MassPayRubySdk::PayoutTxnResp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
184
|
-
end
|
185
|
-
h[k.to_sym] = v
|
186
|
-
}
|
187
|
-
|
188
|
-
if attributes.key?(:'payout_token')
|
189
|
-
self.payout_token = attributes[:'payout_token']
|
190
|
-
end
|
191
|
-
|
192
|
-
if attributes.key?(:'client_transfer_id')
|
193
|
-
self.client_transfer_id = attributes[:'client_transfer_id']
|
194
|
-
end
|
195
|
-
|
196
|
-
if attributes.key?(:'source_currency_code')
|
197
|
-
self.source_currency_code = attributes[:'source_currency_code']
|
198
|
-
end
|
199
|
-
|
200
|
-
if attributes.key?(:'destination_currency_code')
|
201
|
-
self.destination_currency_code = attributes[:'destination_currency_code']
|
202
|
-
end
|
203
|
-
|
204
|
-
if attributes.key?(:'source_token')
|
205
|
-
self.source_token = attributes[:'source_token']
|
206
|
-
end
|
207
|
-
|
208
|
-
if attributes.key?(:'destination_token')
|
209
|
-
self.destination_token = attributes[:'destination_token']
|
210
|
-
end
|
211
|
-
|
212
|
-
if attributes.key?(:'destination_amount')
|
213
|
-
self.destination_amount = attributes[:'destination_amount']
|
214
|
-
end
|
215
|
-
|
216
|
-
if attributes.key?(:'source_amount')
|
217
|
-
self.source_amount = attributes[:'source_amount']
|
218
|
-
end
|
219
|
-
|
220
|
-
if attributes.key?(:'attr_set_token')
|
221
|
-
self.attr_set_token = attributes[:'attr_set_token']
|
222
|
-
end
|
223
|
-
|
224
|
-
if attributes.key?(:'exchange_rate')
|
225
|
-
self.exchange_rate = attributes[:'exchange_rate']
|
226
|
-
end
|
227
|
-
|
228
|
-
if attributes.key?(:'fee')
|
229
|
-
self.fee = attributes[:'fee']
|
230
|
-
end
|
231
|
-
|
232
|
-
if attributes.key?(:'expiration')
|
233
|
-
self.expiration = attributes[:'expiration']
|
234
|
-
end
|
235
|
-
|
236
|
-
if attributes.key?(:'pickup_code')
|
237
|
-
self.pickup_code = attributes[:'pickup_code']
|
238
|
-
end
|
239
|
-
|
240
|
-
if attributes.key?(:'status')
|
241
|
-
self.status = attributes[:'status']
|
242
|
-
end
|
243
|
-
|
244
|
-
if attributes.key?(:'payer_logo')
|
245
|
-
self.payer_logo = attributes[:'payer_logo']
|
246
|
-
end
|
247
|
-
|
248
|
-
if attributes.key?(:'payer_name')
|
249
|
-
self.payer_name = attributes[:'payer_name']
|
250
|
-
end
|
251
|
-
|
252
|
-
if attributes.key?(:'delivery_type')
|
253
|
-
self.delivery_type = attributes[:'delivery_type']
|
254
|
-
end
|
255
|
-
|
256
|
-
if attributes.key?(:'country_code')
|
257
|
-
self.country_code = attributes[:'country_code']
|
258
|
-
end
|
259
|
-
|
260
|
-
if attributes.key?(:'metadata')
|
261
|
-
self.metadata = attributes[:'metadata']
|
262
|
-
end
|
263
|
-
|
264
|
-
if attributes.key?(:'estimated_availability')
|
265
|
-
self.estimated_availability = attributes[:'estimated_availability']
|
266
|
-
end
|
267
|
-
|
268
|
-
if attributes.key?(:'status_reason')
|
269
|
-
self.status_reason = attributes[:'status_reason']
|
270
|
-
end
|
271
|
-
|
272
|
-
if attributes.key?(:'attrs')
|
273
|
-
self.attrs = attributes[:'attrs']
|
274
|
-
end
|
275
|
-
end
|
276
|
-
|
277
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
278
|
-
# @return Array for valid properties with the reasons
|
279
|
-
def list_invalid_properties
|
280
|
-
invalid_properties = Array.new
|
281
|
-
if @payout_token.nil?
|
282
|
-
invalid_properties.push('invalid value for "payout_token", payout_token cannot be nil.')
|
283
|
-
end
|
284
|
-
|
285
|
-
if @client_transfer_id.nil?
|
286
|
-
invalid_properties.push('invalid value for "client_transfer_id", client_transfer_id cannot be nil.')
|
287
|
-
end
|
288
|
-
|
289
|
-
if @client_transfer_id.to_s.length > 50
|
290
|
-
invalid_properties.push('invalid value for "client_transfer_id", the character length must be smaller than or equal to 50.')
|
291
|
-
end
|
292
|
-
|
293
|
-
if @source_currency_code.nil?
|
294
|
-
invalid_properties.push('invalid value for "source_currency_code", source_currency_code cannot be nil.')
|
295
|
-
end
|
296
|
-
|
297
|
-
if @destination_currency_code.nil?
|
298
|
-
invalid_properties.push('invalid value for "destination_currency_code", destination_currency_code cannot be nil.')
|
299
|
-
end
|
300
|
-
|
301
|
-
if @source_token.nil?
|
302
|
-
invalid_properties.push('invalid value for "source_token", source_token cannot be nil.')
|
303
|
-
end
|
304
|
-
|
305
|
-
if @destination_token.nil?
|
306
|
-
invalid_properties.push('invalid value for "destination_token", destination_token cannot be nil.')
|
307
|
-
end
|
308
|
-
|
309
|
-
if @destination_amount.nil?
|
310
|
-
invalid_properties.push('invalid value for "destination_amount", destination_amount cannot be nil.')
|
311
|
-
end
|
312
|
-
|
313
|
-
if @source_amount.nil?
|
314
|
-
invalid_properties.push('invalid value for "source_amount", source_amount cannot be nil.')
|
315
|
-
end
|
316
|
-
|
317
|
-
if @attr_set_token.nil?
|
318
|
-
invalid_properties.push('invalid value for "attr_set_token", attr_set_token cannot be nil.')
|
319
|
-
end
|
320
|
-
|
321
|
-
if @exchange_rate.nil?
|
322
|
-
invalid_properties.push('invalid value for "exchange_rate", exchange_rate cannot be nil.')
|
323
|
-
end
|
324
|
-
|
325
|
-
if @fee.nil?
|
326
|
-
invalid_properties.push('invalid value for "fee", fee cannot be nil.')
|
327
|
-
end
|
328
|
-
|
329
|
-
if @expiration.nil?
|
330
|
-
invalid_properties.push('invalid value for "expiration", expiration cannot be nil.')
|
331
|
-
end
|
332
|
-
|
333
|
-
if @pickup_code.nil?
|
334
|
-
invalid_properties.push('invalid value for "pickup_code", pickup_code cannot be nil.')
|
335
|
-
end
|
336
|
-
|
337
|
-
if @status.nil?
|
338
|
-
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
339
|
-
end
|
340
|
-
|
341
|
-
if @payer_name.nil?
|
342
|
-
invalid_properties.push('invalid value for "payer_name", payer_name cannot be nil.')
|
343
|
-
end
|
344
|
-
|
345
|
-
if @delivery_type.nil?
|
346
|
-
invalid_properties.push('invalid value for "delivery_type", delivery_type cannot be nil.')
|
347
|
-
end
|
348
|
-
|
349
|
-
if @country_code.nil?
|
350
|
-
invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
|
351
|
-
end
|
352
|
-
|
353
|
-
if @country_code.to_s.length > 3
|
354
|
-
invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 3.')
|
355
|
-
end
|
356
|
-
|
357
|
-
if @country_code.to_s.length < 3
|
358
|
-
invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 3.')
|
359
|
-
end
|
360
|
-
|
361
|
-
if @estimated_availability.nil?
|
362
|
-
invalid_properties.push('invalid value for "estimated_availability", estimated_availability cannot be nil.')
|
363
|
-
end
|
364
|
-
|
365
|
-
invalid_properties
|
366
|
-
end
|
367
|
-
|
368
|
-
# Check to see if the all the properties in the model are valid
|
369
|
-
# @return true if the model is valid
|
370
|
-
def valid?
|
371
|
-
return false if @payout_token.nil?
|
372
|
-
return false if @client_transfer_id.nil?
|
373
|
-
return false if @client_transfer_id.to_s.length > 50
|
374
|
-
return false if @source_currency_code.nil?
|
375
|
-
return false if @destination_currency_code.nil?
|
376
|
-
return false if @source_token.nil?
|
377
|
-
return false if @destination_token.nil?
|
378
|
-
return false if @destination_amount.nil?
|
379
|
-
return false if @source_amount.nil?
|
380
|
-
return false if @attr_set_token.nil?
|
381
|
-
return false if @exchange_rate.nil?
|
382
|
-
return false if @fee.nil?
|
383
|
-
return false if @expiration.nil?
|
384
|
-
return false if @pickup_code.nil?
|
385
|
-
return false if @status.nil?
|
386
|
-
status_validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "COMPLETED", "CANCELLED", "SCHEDULED", "READY_FOR_PICKUP", "HOLD", "ERROR"])
|
387
|
-
return false unless status_validator.valid?(@status)
|
388
|
-
return false if @payer_name.nil?
|
389
|
-
return false if @delivery_type.nil?
|
390
|
-
delivery_type_validator = EnumAttributeValidator.new('String', ["CASH_PICKUP", "BANK_DEPOSIT", "HOME_DELIVERY", "MOBILE_WALLET", "MASSPAY_CARD", "PAPER_CHECK", "BILL", "CRYPTOCURRENCY"])
|
391
|
-
return false unless delivery_type_validator.valid?(@delivery_type)
|
392
|
-
return false if @country_code.nil?
|
393
|
-
return false if @country_code.to_s.length > 3
|
394
|
-
return false if @country_code.to_s.length < 3
|
395
|
-
return false if @estimated_availability.nil?
|
396
|
-
true
|
397
|
-
end
|
398
|
-
|
399
|
-
# Custom attribute writer method with validation
|
400
|
-
# @param [Object] client_transfer_id Value to be assigned
|
401
|
-
def client_transfer_id=(client_transfer_id)
|
402
|
-
if client_transfer_id.nil?
|
403
|
-
fail ArgumentError, 'client_transfer_id cannot be nil'
|
404
|
-
end
|
405
|
-
|
406
|
-
if client_transfer_id.to_s.length > 50
|
407
|
-
fail ArgumentError, 'invalid value for "client_transfer_id", the character length must be smaller than or equal to 50.'
|
408
|
-
end
|
409
|
-
|
410
|
-
@client_transfer_id = client_transfer_id
|
411
|
-
end
|
412
|
-
|
413
|
-
# Custom attribute writer method checking allowed values (enum).
|
414
|
-
# @param [Object] status Object to be assigned
|
415
|
-
def status=(status)
|
416
|
-
validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "COMPLETED", "CANCELLED", "SCHEDULED", "READY_FOR_PICKUP", "HOLD", "ERROR"])
|
417
|
-
unless validator.valid?(status)
|
418
|
-
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
419
|
-
end
|
420
|
-
@status = status
|
421
|
-
end
|
422
|
-
|
423
|
-
# Custom attribute writer method checking allowed values (enum).
|
424
|
-
# @param [Object] delivery_type Object to be assigned
|
425
|
-
def delivery_type=(delivery_type)
|
426
|
-
validator = EnumAttributeValidator.new('String', ["CASH_PICKUP", "BANK_DEPOSIT", "HOME_DELIVERY", "MOBILE_WALLET", "MASSPAY_CARD", "PAPER_CHECK", "BILL", "CRYPTOCURRENCY"])
|
427
|
-
unless validator.valid?(delivery_type)
|
428
|
-
fail ArgumentError, "invalid value for \"delivery_type\", must be one of #{validator.allowable_values}."
|
429
|
-
end
|
430
|
-
@delivery_type = delivery_type
|
431
|
-
end
|
432
|
-
|
433
|
-
# Custom attribute writer method with validation
|
434
|
-
# @param [Object] country_code Value to be assigned
|
435
|
-
def country_code=(country_code)
|
436
|
-
if country_code.nil?
|
437
|
-
fail ArgumentError, 'country_code cannot be nil'
|
438
|
-
end
|
439
|
-
|
440
|
-
if country_code.to_s.length > 3
|
441
|
-
fail ArgumentError, 'invalid value for "country_code", the character length must be smaller than or equal to 3.'
|
442
|
-
end
|
443
|
-
|
444
|
-
if country_code.to_s.length < 3
|
445
|
-
fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 3.'
|
446
|
-
end
|
447
|
-
|
448
|
-
@country_code = country_code
|
449
|
-
end
|
450
|
-
|
451
|
-
# Checks equality by comparing each attribute.
|
452
|
-
# @param [Object] Object to be compared
|
453
|
-
def ==(o)
|
454
|
-
return true if self.equal?(o)
|
455
|
-
self.class == o.class &&
|
456
|
-
payout_token == o.payout_token &&
|
457
|
-
client_transfer_id == o.client_transfer_id &&
|
458
|
-
source_currency_code == o.source_currency_code &&
|
459
|
-
destination_currency_code == o.destination_currency_code &&
|
460
|
-
source_token == o.source_token &&
|
461
|
-
destination_token == o.destination_token &&
|
462
|
-
destination_amount == o.destination_amount &&
|
463
|
-
source_amount == o.source_amount &&
|
464
|
-
attr_set_token == o.attr_set_token &&
|
465
|
-
exchange_rate == o.exchange_rate &&
|
466
|
-
fee == o.fee &&
|
467
|
-
expiration == o.expiration &&
|
468
|
-
pickup_code == o.pickup_code &&
|
469
|
-
status == o.status &&
|
470
|
-
payer_logo == o.payer_logo &&
|
471
|
-
payer_name == o.payer_name &&
|
472
|
-
delivery_type == o.delivery_type &&
|
473
|
-
country_code == o.country_code &&
|
474
|
-
metadata == o.metadata &&
|
475
|
-
estimated_availability == o.estimated_availability &&
|
476
|
-
status_reason == o.status_reason &&
|
477
|
-
attrs == o.attrs
|
478
|
-
end
|
479
|
-
|
480
|
-
# @see the `==` method
|
481
|
-
# @param [Object] Object to be compared
|
482
|
-
def eql?(o)
|
483
|
-
self == o
|
484
|
-
end
|
485
|
-
|
486
|
-
# Calculates hash code according to all attributes.
|
487
|
-
# @return [Integer] Hash code
|
488
|
-
def hash
|
489
|
-
[payout_token, client_transfer_id, source_currency_code, destination_currency_code, source_token, destination_token, destination_amount, source_amount, attr_set_token, exchange_rate, fee, expiration, pickup_code, status, payer_logo, payer_name, delivery_type, country_code, metadata, estimated_availability, status_reason, attrs].hash
|
490
|
-
end
|
491
|
-
|
492
|
-
# Builds the object from hash
|
493
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
494
|
-
# @return [Object] Returns the model itself
|
495
|
-
def self.build_from_hash(attributes)
|
496
|
-
new.build_from_hash(attributes)
|
497
|
-
end
|
498
|
-
|
499
|
-
# Builds the object from hash
|
500
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
501
|
-
# @return [Object] Returns the model itself
|
502
|
-
def build_from_hash(attributes)
|
503
|
-
return nil unless attributes.is_a?(Hash)
|
504
|
-
attributes = attributes.transform_keys(&:to_sym)
|
505
|
-
self.class.openapi_types.each_pair do |key, type|
|
506
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
507
|
-
self.send("#{key}=", nil)
|
508
|
-
elsif type =~ /\AArray<(.*)>/i
|
509
|
-
# check to ensure the input is an array given that the attribute
|
510
|
-
# is documented as an array but the input is not
|
511
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
512
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
513
|
-
end
|
514
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
515
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
516
|
-
end
|
517
|
-
end
|
518
|
-
|
519
|
-
self
|
520
|
-
end
|
521
|
-
|
522
|
-
# Deserializes the data based on type
|
523
|
-
# @param string type Data type
|
524
|
-
# @param string value Value to be deserialized
|
525
|
-
# @return [Object] Deserialized data
|
526
|
-
def _deserialize(type, value)
|
527
|
-
case type.to_sym
|
528
|
-
when :Time
|
529
|
-
Time.parse(value)
|
530
|
-
when :Date
|
531
|
-
Date.parse(value)
|
532
|
-
when :String
|
533
|
-
value.to_s
|
534
|
-
when :Integer
|
535
|
-
value.to_i
|
536
|
-
when :Float
|
537
|
-
value.to_f
|
538
|
-
when :Boolean
|
539
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
540
|
-
true
|
541
|
-
else
|
542
|
-
false
|
543
|
-
end
|
544
|
-
when :Object
|
545
|
-
# generic object (usually a Hash), return directly
|
546
|
-
value
|
547
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
548
|
-
inner_type = Regexp.last_match[:inner_type]
|
549
|
-
value.map { |v| _deserialize(inner_type, v) }
|
550
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
551
|
-
k_type = Regexp.last_match[:k_type]
|
552
|
-
v_type = Regexp.last_match[:v_type]
|
553
|
-
{}.tap do |hash|
|
554
|
-
value.each do |k, v|
|
555
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
556
|
-
end
|
557
|
-
end
|
558
|
-
else # model
|
559
|
-
# models (e.g. Pet) or oneOf
|
560
|
-
klass = MassPayRubySdk.const_get(type)
|
561
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
562
|
-
end
|
563
|
-
end
|
564
|
-
|
565
|
-
# Returns the string representation of the object
|
566
|
-
# @return [String] String presentation of the object
|
567
|
-
def to_s
|
568
|
-
to_hash.to_s
|
569
|
-
end
|
570
|
-
|
571
|
-
# to_body is an alias to to_hash (backward compatibility)
|
572
|
-
# @return [Hash] Returns the object in the form of hash
|
573
|
-
def to_body
|
574
|
-
to_hash
|
575
|
-
end
|
576
|
-
|
577
|
-
# Returns the object in the form of hash
|
578
|
-
# @return [Hash] Returns the object in the form of hash
|
579
|
-
def to_hash
|
580
|
-
hash = {}
|
581
|
-
self.class.attribute_map.each_pair do |attr, param|
|
582
|
-
value = self.send(attr)
|
583
|
-
if value.nil?
|
584
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
585
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
586
|
-
end
|
587
|
-
|
588
|
-
hash[param] = _to_hash(value)
|
589
|
-
end
|
590
|
-
hash
|
591
|
-
end
|
592
|
-
|
593
|
-
# Outputs non-array value in the form of hash
|
594
|
-
# For object, use to_hash. Otherwise, just return the value
|
595
|
-
# @param [Object] value Any valid value
|
596
|
-
# @return [Hash] Returns the value in the form of hash
|
597
|
-
def _to_hash(value)
|
598
|
-
if value.is_a?(Array)
|
599
|
-
value.compact.map { |v| _to_hash(v) }
|
600
|
-
elsif value.is_a?(Hash)
|
601
|
-
{}.tap do |hash|
|
602
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
603
|
-
end
|
604
|
-
elsif value.respond_to? :to_hash
|
605
|
-
value.to_hash
|
606
|
-
else
|
607
|
-
value
|
608
|
-
end
|
609
|
-
end
|
610
|
-
|
611
|
-
end
|
612
|
-
|
613
|
-
end
|