transferzero-sdk 1.8.1 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -4
- data/docs/AccountValidationRequest.md +2 -0
- data/docs/Document.md +4 -0
- data/docs/PayoutMethodCashProviderEnum.md +16 -0
- data/docs/PayoutMethodCountryEnum.md +16 -0
- data/docs/PayoutMethodDetails.md +4 -0
- data/docs/PayoutMethodDetailsMobile.md +3 -1
- data/docs/PayoutMethodDetailsXOFCash.md +25 -0
- data/docs/ProofOfPayment.md +23 -0
- data/docs/ProofOfPaymentListResponse.md +17 -0
- data/docs/Recipient.md +4 -0
- data/docs/RecipientStateReasonDetails.md +23 -0
- data/docs/RecipientsApi.md +62 -0
- data/docs/Sender.md +8 -6
- data/lib/transferzero-sdk.rb +6 -0
- data/lib/transferzero-sdk/api/recipients_api.rb +54 -0
- data/lib/transferzero-sdk/api_client.rb +1 -1
- data/lib/transferzero-sdk/models/account_validation_request.rb +10 -1
- data/lib/transferzero-sdk/models/document.rb +21 -1
- data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +31 -0
- data/lib/transferzero-sdk/models/payout_method_country_enum.rb +43 -0
- data/lib/transferzero-sdk/models/payout_method_details.rb +20 -1
- data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +13 -4
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +254 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +3 -0
- data/lib/transferzero-sdk/models/proof_of_payment.rb +233 -0
- data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +204 -0
- data/lib/transferzero-sdk/models/recipient.rb +20 -1
- data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +235 -0
- data/lib/transferzero-sdk/models/sender.rb +29 -7
- data/lib/transferzero-sdk/version.rb +1 -1
- data/spec/models/payout_method_cash_provider_enum_spec.rb +35 -0
- data/spec/models/payout_method_country_enum_spec.rb +35 -0
- data/spec/models/payout_method_details_xof_cash_spec.rb +71 -0
- data/spec/models/proof_of_payment_list_response_spec.rb +41 -0
- data/spec/models/proof_of_payment_spec.rb +59 -0
- data/spec/models/recipient_state_reason_details_spec.rb +59 -0
- data/transferzero-sdk-1.9.0.gem +0 -0
- metadata +27 -2
@@ -217,5 +217,59 @@ module TransferZero
|
|
217
217
|
end
|
218
218
|
return data, status_code, headers
|
219
219
|
end
|
220
|
+
|
221
|
+
|
222
|
+
# Returns list of proof of payments
|
223
|
+
# Returns a list of uploaded proof of payment files for a transaction recipient
|
224
|
+
# @param recipient_id ID of the recipient for whom the proof of payments will be returned. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33/proof_of_payments`
|
225
|
+
# @param [Hash] opts the optional parameters
|
226
|
+
# @return [ProofOfPaymentListResponse]
|
227
|
+
def proof_of_payments(recipient_id, opts = {})
|
228
|
+
data, _status_code, _headers = proof_of_payments_with_http_info(recipient_id, opts)
|
229
|
+
data
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns list of proof of payments
|
233
|
+
# Returns a list of uploaded proof of payment files for a transaction recipient
|
234
|
+
# @param recipient_id ID of the recipient for whom the proof of payments will be returned. Example: `/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33/proof_of_payments`
|
235
|
+
# @param [Hash] opts the optional parameters
|
236
|
+
# @return [Array<(ProofOfPaymentListResponse, Fixnum, Hash)>] ProofOfPaymentListResponse data, response status code and response headers
|
237
|
+
def proof_of_payments_with_http_info(recipient_id, opts = {})
|
238
|
+
if @api_client.config.debugging
|
239
|
+
@api_client.config.logger.debug 'Calling API: RecipientsApi.proof_of_payments ...'
|
240
|
+
end
|
241
|
+
# verify the required parameter 'recipient_id' is set
|
242
|
+
if @api_client.config.client_side_validation && recipient_id.nil?
|
243
|
+
fail ArgumentError, "Missing the required parameter 'recipient_id' when calling RecipientsApi.proof_of_payments"
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = '/recipients/{Recipient ID}/proof_of_payments'.sub('{' + 'Recipient ID' + '}', recipient_id.to_s)
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = {}
|
250
|
+
|
251
|
+
# header parameters
|
252
|
+
header_params = {}
|
253
|
+
# HTTP header 'Accept' (if needed)
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
255
|
+
|
256
|
+
# form parameters
|
257
|
+
form_params = {}
|
258
|
+
|
259
|
+
# http body (model)
|
260
|
+
post_body = nil
|
261
|
+
auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
|
262
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
263
|
+
:header_params => header_params,
|
264
|
+
:query_params => query_params,
|
265
|
+
:form_params => form_params,
|
266
|
+
:body => post_body,
|
267
|
+
:auth_names => auth_names,
|
268
|
+
:return_type => 'ProofOfPaymentListResponse')
|
269
|
+
if @api_client.config.debugging
|
270
|
+
@api_client.config.logger.debug "API called: RecipientsApi#proof_of_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
271
|
+
end
|
272
|
+
return data, status_code, headers
|
273
|
+
end
|
220
274
|
end
|
221
275
|
end
|
@@ -35,7 +35,7 @@ module TransferZero
|
|
35
35
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
36
36
|
def initialize(config = Configuration.default)
|
37
37
|
@config = config
|
38
|
-
@user_agent = "TransferZero-SDK/Ruby/1.
|
38
|
+
@user_agent = "TransferZero-SDK/Ruby/1.12.2"
|
39
39
|
@default_headers = {
|
40
40
|
'Content-Type' => 'application/json',
|
41
41
|
'User-Agent' => @user_agent
|
@@ -23,6 +23,8 @@ class AccountValidationRequest
|
|
23
23
|
# Phone number to query
|
24
24
|
attr_accessor :phone_number
|
25
25
|
|
26
|
+
attr_accessor :mobile_provider
|
27
|
+
|
26
28
|
# Country of account in 2-character alpha ISO 3166-2 country format
|
27
29
|
attr_accessor :country
|
28
30
|
|
@@ -60,6 +62,7 @@ class AccountValidationRequest
|
|
60
62
|
:'bank_account' => :'bank_account',
|
61
63
|
:'bank_code' => :'bank_code',
|
62
64
|
:'phone_number' => :'phone_number',
|
65
|
+
:'mobile_provider' => :'mobile_provider',
|
63
66
|
:'country' => :'country',
|
64
67
|
:'currency' => :'currency',
|
65
68
|
:'method' => :'method'
|
@@ -72,6 +75,7 @@ class AccountValidationRequest
|
|
72
75
|
:'bank_account' => :'String',
|
73
76
|
:'bank_code' => :'String',
|
74
77
|
:'phone_number' => :'String',
|
78
|
+
:'mobile_provider' => :'PayoutMethodMobileProviderEnum',
|
75
79
|
:'country' => :'String',
|
76
80
|
:'currency' => :'String',
|
77
81
|
:'method' => :'String'
|
@@ -105,6 +109,10 @@ class AccountValidationRequest
|
|
105
109
|
self.phone_number = attributes[:'phone_number']
|
106
110
|
end
|
107
111
|
|
112
|
+
if attributes.key?(:'mobile_provider')
|
113
|
+
self.mobile_provider = attributes[:'mobile_provider']
|
114
|
+
end
|
115
|
+
|
108
116
|
if attributes.key?(:'country')
|
109
117
|
self.country = attributes[:'country']
|
110
118
|
end
|
@@ -190,6 +198,7 @@ class AccountValidationRequest
|
|
190
198
|
bank_account == o.bank_account &&
|
191
199
|
bank_code == o.bank_code &&
|
192
200
|
phone_number == o.phone_number &&
|
201
|
+
mobile_provider == o.mobile_provider &&
|
193
202
|
country == o.country &&
|
194
203
|
currency == o.currency &&
|
195
204
|
method == o.method
|
@@ -204,7 +213,7 @@ class AccountValidationRequest
|
|
204
213
|
# Calculates hash code according to all attributes.
|
205
214
|
# @return [Integer] Hash code
|
206
215
|
def hash
|
207
|
-
[bank_account, bank_code, phone_number, country, currency, method].hash
|
216
|
+
[bank_account, bank_code, phone_number, mobile_provider, country, currency, method].hash
|
208
217
|
end
|
209
218
|
|
210
219
|
require 'active_support/core_ext/hash'
|
@@ -44,6 +44,12 @@ class Document
|
|
44
44
|
|
45
45
|
attr_accessor :id
|
46
46
|
|
47
|
+
# Document ID issued by government
|
48
|
+
attr_accessor :document_id
|
49
|
+
|
50
|
+
# Document expiry date issued by government
|
51
|
+
attr_accessor :expiry_date
|
52
|
+
|
47
53
|
# The fields that have some problems and don't pass validation
|
48
54
|
attr_accessor :errors
|
49
55
|
|
@@ -83,6 +89,8 @@ class Document
|
|
83
89
|
:'document_type' => :'document_type',
|
84
90
|
:'issuing_country' => :'issuing_country',
|
85
91
|
:'id' => :'id',
|
92
|
+
:'document_id' => :'document_id',
|
93
|
+
:'expiry_date' => :'expiry_date',
|
86
94
|
:'errors' => :'errors'
|
87
95
|
}
|
88
96
|
end
|
@@ -101,6 +109,8 @@ class Document
|
|
101
109
|
:'document_type' => :'String',
|
102
110
|
:'issuing_country' => :'String',
|
103
111
|
:'id' => :'String',
|
112
|
+
:'document_id' => :'String',
|
113
|
+
:'expiry_date' => :'Date',
|
104
114
|
:'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
|
105
115
|
}
|
106
116
|
end
|
@@ -164,6 +174,14 @@ class Document
|
|
164
174
|
self.id = attributes[:'id']
|
165
175
|
end
|
166
176
|
|
177
|
+
if attributes.key?(:'document_id')
|
178
|
+
self.document_id = attributes[:'document_id']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'expiry_date')
|
182
|
+
self.expiry_date = attributes[:'expiry_date']
|
183
|
+
end
|
184
|
+
|
167
185
|
if attributes.key?(:'errors')
|
168
186
|
if (value = attributes[:'errors']).is_a?(Hash)
|
169
187
|
self.errors = value
|
@@ -222,6 +240,8 @@ class Document
|
|
222
240
|
document_type == o.document_type &&
|
223
241
|
issuing_country == o.issuing_country &&
|
224
242
|
id == o.id &&
|
243
|
+
document_id == o.document_id &&
|
244
|
+
expiry_date == o.expiry_date &&
|
225
245
|
errors == o.errors
|
226
246
|
end
|
227
247
|
|
@@ -234,7 +254,7 @@ class Document
|
|
234
254
|
# Calculates hash code according to all attributes.
|
235
255
|
# @return [Integer] Hash code
|
236
256
|
def hash
|
237
|
-
[upload, url, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, errors].hash
|
257
|
+
[upload, url, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, document_id, expiry_date, errors].hash
|
238
258
|
end
|
239
259
|
|
240
260
|
require 'active_support/core_ext/hash'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class PayoutMethodCashProviderEnum
|
17
|
+
|
18
|
+
WARI = "wari".freeze
|
19
|
+
WIZALL = "wizall".freeze
|
20
|
+
|
21
|
+
# Builds the enum from string
|
22
|
+
# @param [String] The enum value in the form of the string
|
23
|
+
# @return [String] The enum value
|
24
|
+
def build_from_hash(value)
|
25
|
+
constantValues = PayoutMethodCashProviderEnum.constants.select { |c| PayoutMethodCashProviderEnum::const_get(c) == value }
|
26
|
+
raise "Invalid ENUM value #{value} for class #PayoutMethodCashProviderEnum" if constantValues.empty? && !value.empty?
|
27
|
+
value
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
class PayoutMethodCountryEnum
|
17
|
+
|
18
|
+
CI = "CI".freeze
|
19
|
+
ML = "ML".freeze
|
20
|
+
SN = "SN".freeze
|
21
|
+
NG = "NG".freeze
|
22
|
+
MA = "MA".freeze
|
23
|
+
TZ = "TZ".freeze
|
24
|
+
GH = "GH".freeze
|
25
|
+
UG = "UG".freeze
|
26
|
+
KE = "KE".freeze
|
27
|
+
NJ = "NJ".freeze
|
28
|
+
EU = "EU".freeze
|
29
|
+
GB = "GB".freeze
|
30
|
+
ZA = "ZA".freeze
|
31
|
+
EG = "EG".freeze
|
32
|
+
|
33
|
+
# Builds the enum from string
|
34
|
+
# @param [String] The enum value in the form of the string
|
35
|
+
# @return [String] The enum value
|
36
|
+
def build_from_hash(value)
|
37
|
+
constantValues = PayoutMethodCountryEnum.constants.select { |c| PayoutMethodCountryEnum::const_get(c) == value }
|
38
|
+
raise "Invalid ENUM value #{value} for class #PayoutMethodCountryEnum" if constantValues.empty? && !value.empty?
|
39
|
+
value
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -34,6 +34,10 @@ class PayoutMethodDetails
|
|
34
34
|
|
35
35
|
attr_accessor :bank_country
|
36
36
|
|
37
|
+
attr_accessor :cash_provider
|
38
|
+
|
39
|
+
attr_accessor :country
|
40
|
+
|
37
41
|
attr_accessor :sort_code
|
38
42
|
|
39
43
|
attr_accessor :bic
|
@@ -83,6 +87,8 @@ class PayoutMethodDetails
|
|
83
87
|
:'iban' => :'iban',
|
84
88
|
:'bank_name' => :'bank_name',
|
85
89
|
:'bank_country' => :'bank_country',
|
90
|
+
:'cash_provider' => :'cash_provider',
|
91
|
+
:'country' => :'country',
|
86
92
|
:'sort_code' => :'sort_code',
|
87
93
|
:'bic' => :'bic',
|
88
94
|
:'sender_identity_card_type' => :'sender_identity_card_type',
|
@@ -117,6 +123,8 @@ class PayoutMethodDetails
|
|
117
123
|
:'iban' => :'String',
|
118
124
|
:'bank_name' => :'String',
|
119
125
|
:'bank_country' => :'String',
|
126
|
+
:'cash_provider' => :'PayoutMethodCashProviderEnum',
|
127
|
+
:'country' => :'PayoutMethodCountryEnum',
|
120
128
|
:'sort_code' => :'String',
|
121
129
|
:'bic' => :'String',
|
122
130
|
:'sender_identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
|
@@ -150,6 +158,7 @@ class PayoutMethodDetails
|
|
150
158
|
:'PayoutMethodDetailsMobile',
|
151
159
|
:'PayoutMethodDetailsNGNBank',
|
152
160
|
:'PayoutMethodDetailsXOFBank',
|
161
|
+
:'PayoutMethodDetailsXOFCash',
|
153
162
|
:'PayoutMethodDetailsXOFMobile',
|
154
163
|
:'PayoutMethodDetailsZARBank'
|
155
164
|
]
|
@@ -210,6 +219,14 @@ class PayoutMethodDetails
|
|
210
219
|
self.bank_country = attributes[:'bank_country']
|
211
220
|
end
|
212
221
|
|
222
|
+
if attributes.key?(:'cash_provider')
|
223
|
+
self.cash_provider = attributes[:'cash_provider']
|
224
|
+
end
|
225
|
+
|
226
|
+
if attributes.key?(:'country')
|
227
|
+
self.country = attributes[:'country']
|
228
|
+
end
|
229
|
+
|
213
230
|
if attributes.key?(:'sort_code')
|
214
231
|
self.sort_code = attributes[:'sort_code']
|
215
232
|
end
|
@@ -422,6 +439,8 @@ class PayoutMethodDetails
|
|
422
439
|
iban == o.iban &&
|
423
440
|
bank_name == o.bank_name &&
|
424
441
|
bank_country == o.bank_country &&
|
442
|
+
cash_provider == o.cash_provider &&
|
443
|
+
country == o.country &&
|
425
444
|
sort_code == o.sort_code &&
|
426
445
|
bic == o.bic &&
|
427
446
|
sender_identity_card_type == o.sender_identity_card_type &&
|
@@ -451,7 +470,7 @@ class PayoutMethodDetails
|
|
451
470
|
# Calculates hash code according to all attributes.
|
452
471
|
# @return [Integer] Hash code
|
453
472
|
def hash
|
454
|
-
[first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, iban, bank_name, bank_country, sort_code, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference, name, address, street, postal_code, city, email, transfer_reason_code].hash
|
473
|
+
[first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, iban, bank_name, bank_country, cash_provider, country, sort_code, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference, name, address, street, postal_code, city, email, transfer_reason_code].hash
|
455
474
|
end
|
456
475
|
|
457
476
|
require 'active_support/core_ext/hash'
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.0.0-beta3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TransferZero
|
16
|
-
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"212537718685\" # Mandatory; International format preferred \"sender_identity_card_type\" => \"O\", # Mandatory; Values: \"O\": Other, \"PP\": Passport, \"
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"212537718685\" # Mandatory; International format preferred \"sender_identity_card_type\" => \"O\", # Mandatory; Values: \"O\": Other, \"PP\": Passport, \"ID\": National ID \"sender_identity_card_id\" => 'AB12345678', # Mandatory \"sender_city_of_birth\" => \"London\", # Mandatory \"sender_country_of_birth\" => \"GB\", # Mandatory; ISO 2-letter format \"sender_gender\" => \"M\", # Mandatory; Values: \"M\": Male, \"F\": Female \"reason\" => \"Remittance payment\", # Optional; Default value is 'Remittance payment' \"identity_card_type\" => \"ID\", # Optional; Values: \"PP\": Passport, \"ID\": National ID \"identity_card_id\" => 'AB12345678' # Optional } ``` Please note when sending MAD::Cash payments you should subscribe to the recipient.pending webhook, as that will broadcast the payment reference ID the customer need to use to obtain the funds. Example webhook response excerpt - ```JSON { (...) \"state\":\"pending\", \"metadata\": { \"payment_reference\":\"9M5GJRJUBCY\" }, (...) } ``` The reference can also be provided optionally for MAD::Cash, but if you want to use this functionality please contact us for more details.
|
17
17
|
class PayoutMethodDetailsMADCash
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -21,12 +21,15 @@ class PayoutMethodDetailsMobile
|
|
21
21
|
|
22
22
|
attr_accessor :phone_number
|
23
23
|
|
24
|
+
attr_accessor :mobile_provider
|
25
|
+
|
24
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
25
27
|
def self.attribute_map
|
26
28
|
{
|
27
29
|
:'first_name' => :'first_name',
|
28
30
|
:'last_name' => :'last_name',
|
29
|
-
:'phone_number' => :'phone_number'
|
31
|
+
:'phone_number' => :'phone_number',
|
32
|
+
:'mobile_provider' => :'mobile_provider'
|
30
33
|
}
|
31
34
|
end
|
32
35
|
|
@@ -35,7 +38,8 @@ class PayoutMethodDetailsMobile
|
|
35
38
|
{
|
36
39
|
:'first_name' => :'String',
|
37
40
|
:'last_name' => :'String',
|
38
|
-
:'phone_number' => :'String'
|
41
|
+
:'phone_number' => :'String',
|
42
|
+
:'mobile_provider' => :'PayoutMethodMobileProviderEnum'
|
39
43
|
}
|
40
44
|
end
|
41
45
|
|
@@ -65,6 +69,10 @@ class PayoutMethodDetailsMobile
|
|
65
69
|
if attributes.key?(:'phone_number')
|
66
70
|
self.phone_number = attributes[:'phone_number']
|
67
71
|
end
|
72
|
+
|
73
|
+
if attributes.key?(:'mobile_provider')
|
74
|
+
self.mobile_provider = attributes[:'mobile_provider']
|
75
|
+
end
|
68
76
|
end
|
69
77
|
|
70
78
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -102,7 +110,8 @@ class PayoutMethodDetailsMobile
|
|
102
110
|
self.class == o.class &&
|
103
111
|
first_name == o.first_name &&
|
104
112
|
last_name == o.last_name &&
|
105
|
-
phone_number == o.phone_number
|
113
|
+
phone_number == o.phone_number &&
|
114
|
+
mobile_provider == o.mobile_provider
|
106
115
|
end
|
107
116
|
|
108
117
|
# @see the `==` method
|
@@ -114,7 +123,7 @@ class PayoutMethodDetailsMobile
|
|
114
123
|
# Calculates hash code according to all attributes.
|
115
124
|
# @return [Integer] Hash code
|
116
125
|
def hash
|
117
|
-
[first_name, last_name, phone_number].hash
|
126
|
+
[first_name, last_name, phone_number, mobile_provider].hash
|
118
127
|
end
|
119
128
|
|
120
129
|
require 'active_support/core_ext/hash'
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.0.0-beta3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module TransferZero
|
16
|
-
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"iban\": \"SN08SN0000000000000000000000\", \"bank_name\": \"BRM\", \"bank_country\": \"SN\" # ISO country code for Senegal } ```
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"iban\": \"SN08SN0000000000000000000000\", \"bank_name\": \"BRM\", \"bank_country\": \"SN\" # ISO country code for Senegal } ```
|
17
17
|
class PayoutMethodDetailsXOFBank
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -0,0 +1,254 @@
|
|
1
|
+
=begin
|
2
|
+
#TransferZero API
|
3
|
+
|
4
|
+
#Reference documentation for the TransferZero API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TransferZero
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"221774044436\", // local or international format \"cash_provider\": \"wizall\" // Optional; Values: \"wari\" or \"wizall\"; Default value is \"wari\"; \"country\": \"SN\" // Optional; Values: \"CI\", \"ML\" or \"SN\"; Default value is \"SN\"; } ``` Please note when sending Wari cash pickup requests you should subscribe to the recipient.pending webhook, as that will broadcast the payment reference ID the customer need to use to obtain the funds. Example webhook response excerpt - ```JSON { (...) \"state\":\"pending\", \"metadata\": { \"payment_reference\":\"9M5GJRJUBCY\" }, (...) } ``` Please note all senders trying to create Wizall cash pickup requests must have `identity_type` and `identity_number` present. The fields above are generally considered optional for senders for other payment corridors. If you wish to use an existing sender who has some of these fields missing you can provide them alongside the `id` or `external_id` field in the sender details. For example - ```JSON { \"transaction\": { \"sender\": { \"external_id\": \"<id of sender>\", \"identity_type\": \"ID\", \"identity_number\": \"AB12345678\", (...) }, (...) } } ```
|
17
|
+
class PayoutMethodDetailsXOFCash
|
18
|
+
attr_accessor :first_name
|
19
|
+
|
20
|
+
attr_accessor :last_name
|
21
|
+
|
22
|
+
attr_accessor :phone_number
|
23
|
+
|
24
|
+
attr_accessor :cash_provider
|
25
|
+
|
26
|
+
attr_accessor :country
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'first_name' => :'first_name',
|
32
|
+
:'last_name' => :'last_name',
|
33
|
+
:'phone_number' => :'phone_number',
|
34
|
+
:'cash_provider' => :'cash_provider',
|
35
|
+
:'country' => :'country'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'first_name' => :'String',
|
43
|
+
:'last_name' => :'String',
|
44
|
+
:'phone_number' => :'String',
|
45
|
+
:'cash_provider' => :'PayoutMethodCashProviderEnum',
|
46
|
+
:'country' => :'PayoutMethodCountryEnum'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsXOFCash` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsXOFCash`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'first_name')
|
66
|
+
self.first_name = attributes[:'first_name']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'last_name')
|
70
|
+
self.last_name = attributes[:'last_name']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'phone_number')
|
74
|
+
self.phone_number = attributes[:'phone_number']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'cash_provider')
|
78
|
+
self.cash_provider = attributes[:'cash_provider']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'country')
|
82
|
+
self.country = attributes[:'country']
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
87
|
+
# @return Array for valid properties with the reasons
|
88
|
+
def list_invalid_properties
|
89
|
+
invalid_properties = Array.new
|
90
|
+
if @first_name.nil?
|
91
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
if @last_name.nil?
|
95
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
if @phone_number.nil?
|
99
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
100
|
+
end
|
101
|
+
|
102
|
+
invalid_properties
|
103
|
+
end
|
104
|
+
|
105
|
+
# Check to see if the all the properties in the model are valid
|
106
|
+
# @return true if the model is valid
|
107
|
+
def valid?
|
108
|
+
return false if @first_name.nil?
|
109
|
+
return false if @last_name.nil?
|
110
|
+
return false if @phone_number.nil?
|
111
|
+
true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Checks equality by comparing each attribute.
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
first_name == o.first_name &&
|
120
|
+
last_name == o.last_name &&
|
121
|
+
phone_number == o.phone_number &&
|
122
|
+
cash_provider == o.cash_provider &&
|
123
|
+
country == o.country
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(o)
|
129
|
+
self == o
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Integer] Hash code
|
134
|
+
def hash
|
135
|
+
[first_name, last_name, phone_number, cash_provider, country].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
require 'active_support/core_ext/hash'
|
139
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
self.class.openapi_types.each_pair do |key, type|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :DateTime
|
167
|
+
DateTime.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :Boolean
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
temp_model = TransferZero.const_get(type).new
|
198
|
+
temp_model.build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
next if value.nil?
|
221
|
+
hash[param] = _to_hash(value)
|
222
|
+
end
|
223
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
224
|
+
end
|
225
|
+
|
226
|
+
def [](key)
|
227
|
+
to_hash[key]
|
228
|
+
end
|
229
|
+
|
230
|
+
def dig(*args)
|
231
|
+
to_hash.dig(*args)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Outputs non-array value in the form of hash
|
235
|
+
# For object, use to_hash. Otherwise, just return the value
|
236
|
+
# @param [Object] value Any valid value
|
237
|
+
# @return [Hash] Returns the value in the form of hash
|
238
|
+
def _to_hash(value)
|
239
|
+
if value.is_a?(Array)
|
240
|
+
value.compact.map { |v| _to_hash(v) }
|
241
|
+
elsif value.is_a?(Hash)
|
242
|
+
{}.tap do |hash|
|
243
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
244
|
+
end
|
245
|
+
elsif value.respond_to? :to_hash
|
246
|
+
value.to_hash
|
247
|
+
else
|
248
|
+
value
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|