transferzero-sdk 1.9.0 → 1.13.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/Gemfile.lock +94 -0
- data/README.md +12 -4
- data/docs/AccountValidationRequest.md +2 -0
- data/docs/Document.md +4 -0
- data/docs/PayoutMethod.md +1 -1
- data/docs/PayoutMethodCashProviderEnum.md +16 -0
- data/docs/PayoutMethodCountryEnum.md +16 -0
- data/docs/PayoutMethodDetails.md +4 -0
- data/docs/PayoutMethodDetailsGHSCash.md +21 -0
- data/docs/PayoutMethodDetailsXOFCash.md +25 -0
- data/docs/PayoutMethodDetailsXOFMobile.md +3 -1
- 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 +3 -1
- data/lib/transferzero-sdk.rb +7 -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.rb +1 -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 +21 -1
- data/lib/transferzero-sdk/models/payout_method_details_ghs_cash.rb +236 -0
- data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +1 -1
- 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 +14 -5
- 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 +1 -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 +12 -2
- 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_ghs_cash_spec.rb +53 -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
- metadata +32 -3
data/docs/Sender.md
CHANGED
@@ -17,7 +17,8 @@ Name | Type | Description | Notes
|
|
17
17
|
**ip** | **String** | IP of sender |
|
18
18
|
**address_description** | **String** | Description of address | [optional]
|
19
19
|
**identification_number** | **String** | Identification number of document used | [optional]
|
20
|
-
**identification_type** | **String** | Document to be identified. The identification type can be one of the following: - `DL`: Driving License - `PP`: International Passport - `ID`: National ID - `OT`: Other | [optional]
|
20
|
+
**identification_type** | **String** | Document to be identified. The identification type can be one of the following: - `DL`: Driving License - `PP`: International Passport - `ID`: National ID - `OT`: Other Please note for Wizall `XOF::Cash` transactions the valid options are: - `ID`: National ID - `PP`: Passport | [optional]
|
21
|
+
**lang** | **String** | Determines language of the served content. Defaults to English | [optional]
|
21
22
|
**name** | **String** | Name of sender (used only with a Business sender) | [optional]
|
22
23
|
**first_name** | **String** | First name of sender (used only with a Personal sender) | [optional]
|
23
24
|
**middle_name** | **String** | Middle name of sender (used only with a Personal sender) | [optional]
|
@@ -72,6 +73,7 @@ instance = TransferZero::Sender.new(id: bf9ff782-e182-45ac-abea-5bce83ad6670,
|
|
72
73
|
address_description: null,
|
73
74
|
identification_number: AB123456,
|
74
75
|
identification_type: ID,
|
76
|
+
lang: en,
|
75
77
|
name: null,
|
76
78
|
first_name: Johnny,
|
77
79
|
middle_name: Johnny,
|
data/lib/transferzero-sdk.rb
CHANGED
@@ -61,16 +61,20 @@ require 'transferzero-sdk/models/payment_method_list_response'
|
|
61
61
|
require 'transferzero-sdk/models/payment_method_opposite'
|
62
62
|
require 'transferzero-sdk/models/payout_method'
|
63
63
|
require 'transferzero-sdk/models/payout_method_bank_account_type_enum'
|
64
|
+
require 'transferzero-sdk/models/payout_method_cash_provider_enum'
|
65
|
+
require 'transferzero-sdk/models/payout_method_country_enum'
|
64
66
|
require 'transferzero-sdk/models/payout_method_details'
|
65
67
|
require 'transferzero-sdk/models/payout_method_details_btc'
|
66
68
|
require 'transferzero-sdk/models/payout_method_details_balance'
|
67
69
|
require 'transferzero-sdk/models/payout_method_details_gbp_bank'
|
68
70
|
require 'transferzero-sdk/models/payout_method_details_ghs_bank'
|
71
|
+
require 'transferzero-sdk/models/payout_method_details_ghs_cash'
|
69
72
|
require 'transferzero-sdk/models/payout_method_details_iban'
|
70
73
|
require 'transferzero-sdk/models/payout_method_details_mad_cash'
|
71
74
|
require 'transferzero-sdk/models/payout_method_details_mobile'
|
72
75
|
require 'transferzero-sdk/models/payout_method_details_ngn_bank'
|
73
76
|
require 'transferzero-sdk/models/payout_method_details_xof_bank'
|
77
|
+
require 'transferzero-sdk/models/payout_method_details_xof_cash'
|
74
78
|
require 'transferzero-sdk/models/payout_method_details_xof_mobile'
|
75
79
|
require 'transferzero-sdk/models/payout_method_details_zar_bank'
|
76
80
|
require 'transferzero-sdk/models/payout_method_gender_enum'
|
@@ -81,11 +85,14 @@ require 'transferzero-sdk/models/payout_method_request'
|
|
81
85
|
require 'transferzero-sdk/models/payout_method_response'
|
82
86
|
require 'transferzero-sdk/models/payout_method_webhook'
|
83
87
|
require 'transferzero-sdk/models/politically_exposed_person'
|
88
|
+
require 'transferzero-sdk/models/proof_of_payment'
|
89
|
+
require 'transferzero-sdk/models/proof_of_payment_list_response'
|
84
90
|
require 'transferzero-sdk/models/recipient'
|
85
91
|
require 'transferzero-sdk/models/recipient_list_response'
|
86
92
|
require 'transferzero-sdk/models/recipient_request'
|
87
93
|
require 'transferzero-sdk/models/recipient_response'
|
88
94
|
require 'transferzero-sdk/models/recipient_state'
|
95
|
+
require 'transferzero-sdk/models/recipient_state_reason_details'
|
89
96
|
require 'transferzero-sdk/models/recipient_webhook'
|
90
97
|
require 'transferzero-sdk/models/sender'
|
91
98
|
require 'transferzero-sdk/models/sender_list_response'
|
@@ -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.13.0"
|
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'
|
@@ -15,7 +15,7 @@ require 'date'
|
|
15
15
|
module TransferZero
|
16
16
|
# This describes the specific details on how the payment has to be routed to the recipient.
|
17
17
|
class PayoutMethod
|
18
|
-
# Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for
|
18
|
+
# Contains the currency to send the money to, and the type of the money movement Commonly used payout types are: - `NGN::Bank` - for Nigerian bank account payments. - `NGN::Mobile` - for Nigerian mobile money payments. - `GHS::Bank` - for Ghanaian bank account payments. - `GHS::Mobile` - for Ghanaian mobile money payments. - `GHS::Cash` - for Ghanaian cash remittance payments. - `UGX::Mobile` - for Ugandan mobile money payments. - `TZS::Mobile` - for Tanzanian mobile money payments. - `XOF::Mobile` - for mobile money payments to West-Africa. - `XOF::Bank` - for Senegalese bank account payments. - `XOF::Cash` - for Senegalese cash remittance payments. - `MAD::Cash` - for Moroccan cash remittance payments. - `EUR::Bank` - for IBAN bank transfers in EUR. - `GBP::Bank` - for IBAN bank and FP accounts transfers in GBP. - `ZAR::Bank` - for South Africa bank account payments. You can also send funds to the internal balance using `CCY::Balance`, where `CCY` is the appropriate currency. See [Collection from senders](https://docs.transferzero.com/docs/additional-features/#collections-from-senders) for more info on how to collect money into internal balance
|
19
19
|
attr_accessor :type
|
20
20
|
|
21
21
|
attr_accessor :details
|
@@ -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
|
@@ -28,12 +28,16 @@ class PayoutMethodDetails
|
|
28
28
|
|
29
29
|
attr_accessor :mobile_provider
|
30
30
|
|
31
|
+
attr_accessor :country
|
32
|
+
|
31
33
|
attr_accessor :iban
|
32
34
|
|
33
35
|
attr_accessor :bank_name
|
34
36
|
|
35
37
|
attr_accessor :bank_country
|
36
38
|
|
39
|
+
attr_accessor :cash_provider
|
40
|
+
|
37
41
|
attr_accessor :sort_code
|
38
42
|
|
39
43
|
attr_accessor :bic
|
@@ -80,9 +84,11 @@ class PayoutMethodDetails
|
|
80
84
|
:'bank_account_type' => :'bank_account_type',
|
81
85
|
:'phone_number' => :'phone_number',
|
82
86
|
:'mobile_provider' => :'mobile_provider',
|
87
|
+
:'country' => :'country',
|
83
88
|
:'iban' => :'iban',
|
84
89
|
:'bank_name' => :'bank_name',
|
85
90
|
:'bank_country' => :'bank_country',
|
91
|
+
:'cash_provider' => :'cash_provider',
|
86
92
|
:'sort_code' => :'sort_code',
|
87
93
|
:'bic' => :'bic',
|
88
94
|
:'sender_identity_card_type' => :'sender_identity_card_type',
|
@@ -114,9 +120,11 @@ class PayoutMethodDetails
|
|
114
120
|
:'bank_account_type' => :'PayoutMethodBankAccountTypeEnum',
|
115
121
|
:'phone_number' => :'String',
|
116
122
|
:'mobile_provider' => :'PayoutMethodMobileProviderEnum',
|
123
|
+
:'country' => :'PayoutMethodCountryEnum',
|
117
124
|
:'iban' => :'String',
|
118
125
|
:'bank_name' => :'String',
|
119
126
|
:'bank_country' => :'String',
|
127
|
+
:'cash_provider' => :'PayoutMethodCashProviderEnum',
|
120
128
|
:'sort_code' => :'String',
|
121
129
|
:'bic' => :'String',
|
122
130
|
:'sender_identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
|
@@ -145,11 +153,13 @@ class PayoutMethodDetails
|
|
145
153
|
:'PayoutMethodDetailsBalance',
|
146
154
|
:'PayoutMethodDetailsGBPBank',
|
147
155
|
:'PayoutMethodDetailsGHSBank',
|
156
|
+
:'PayoutMethodDetailsGHSCash',
|
148
157
|
:'PayoutMethodDetailsIBAN',
|
149
158
|
:'PayoutMethodDetailsMADCash',
|
150
159
|
:'PayoutMethodDetailsMobile',
|
151
160
|
:'PayoutMethodDetailsNGNBank',
|
152
161
|
:'PayoutMethodDetailsXOFBank',
|
162
|
+
:'PayoutMethodDetailsXOFCash',
|
153
163
|
:'PayoutMethodDetailsXOFMobile',
|
154
164
|
:'PayoutMethodDetailsZARBank'
|
155
165
|
]
|
@@ -198,6 +208,10 @@ class PayoutMethodDetails
|
|
198
208
|
self.mobile_provider = attributes[:'mobile_provider']
|
199
209
|
end
|
200
210
|
|
211
|
+
if attributes.key?(:'country')
|
212
|
+
self.country = attributes[:'country']
|
213
|
+
end
|
214
|
+
|
201
215
|
if attributes.key?(:'iban')
|
202
216
|
self.iban = attributes[:'iban']
|
203
217
|
end
|
@@ -210,6 +224,10 @@ class PayoutMethodDetails
|
|
210
224
|
self.bank_country = attributes[:'bank_country']
|
211
225
|
end
|
212
226
|
|
227
|
+
if attributes.key?(:'cash_provider')
|
228
|
+
self.cash_provider = attributes[:'cash_provider']
|
229
|
+
end
|
230
|
+
|
213
231
|
if attributes.key?(:'sort_code')
|
214
232
|
self.sort_code = attributes[:'sort_code']
|
215
233
|
end
|
@@ -419,9 +437,11 @@ class PayoutMethodDetails
|
|
419
437
|
bank_account_type == o.bank_account_type &&
|
420
438
|
phone_number == o.phone_number &&
|
421
439
|
mobile_provider == o.mobile_provider &&
|
440
|
+
country == o.country &&
|
422
441
|
iban == o.iban &&
|
423
442
|
bank_name == o.bank_name &&
|
424
443
|
bank_country == o.bank_country &&
|
444
|
+
cash_provider == o.cash_provider &&
|
425
445
|
sort_code == o.sort_code &&
|
426
446
|
bic == o.bic &&
|
427
447
|
sender_identity_card_type == o.sender_identity_card_type &&
|
@@ -451,7 +471,7 @@ class PayoutMethodDetails
|
|
451
471
|
# Calculates hash code according to all attributes.
|
452
472
|
# @return [Integer] Hash code
|
453
473
|
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
|
474
|
+
[first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, country, iban, bank_name, bank_country, cash_provider, 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
475
|
end
|
456
476
|
|
457
477
|
require 'active_support/core_ext/hash'
|
@@ -0,0 +1,236 @@
|
|
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\": \"0322023144\" } ```
|
17
|
+
class PayoutMethodDetailsGHSCash
|
18
|
+
attr_accessor :first_name
|
19
|
+
|
20
|
+
attr_accessor :last_name
|
21
|
+
|
22
|
+
attr_accessor :phone_number
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'first_name' => :'first_name',
|
28
|
+
:'last_name' => :'last_name',
|
29
|
+
:'phone_number' => :'phone_number'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Attribute type mapping.
|
34
|
+
def self.openapi_types
|
35
|
+
{
|
36
|
+
:'first_name' => :'String',
|
37
|
+
:'last_name' => :'String',
|
38
|
+
:'phone_number' => :'String'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Initializes the object
|
43
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
44
|
+
def initialize(attributes = {})
|
45
|
+
if (!attributes.is_a?(Hash))
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsGHSCash` initialize method"
|
47
|
+
end
|
48
|
+
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
51
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsGHSCash`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
53
|
+
end
|
54
|
+
h[k.to_sym] = v
|
55
|
+
}
|
56
|
+
|
57
|
+
if attributes.key?(:'first_name')
|
58
|
+
self.first_name = attributes[:'first_name']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.key?(:'last_name')
|
62
|
+
self.last_name = attributes[:'last_name']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:'phone_number')
|
66
|
+
self.phone_number = attributes[:'phone_number']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properties with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
if @first_name.nil?
|
75
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
76
|
+
end
|
77
|
+
|
78
|
+
if @last_name.nil?
|
79
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
80
|
+
end
|
81
|
+
|
82
|
+
if @phone_number.nil?
|
83
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
return false if @first_name.nil?
|
93
|
+
return false if @last_name.nil?
|
94
|
+
return false if @phone_number.nil?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
first_name == o.first_name &&
|
104
|
+
last_name == o.last_name &&
|
105
|
+
phone_number == o.phone_number
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Integer] Hash code
|
116
|
+
def hash
|
117
|
+
[first_name, last_name, phone_number].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
require 'active_support/core_ext/hash'
|
121
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
self.class.openapi_types.each_pair do |key, type|
|
128
|
+
if type =~ /\AArray<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
133
|
+
end
|
134
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
135
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
136
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
137
|
+
end
|
138
|
+
|
139
|
+
self
|
140
|
+
end
|
141
|
+
|
142
|
+
# Deserializes the data based on type
|
143
|
+
# @param string type Data type
|
144
|
+
# @param string value Value to be deserialized
|
145
|
+
# @return [Object] Deserialized data
|
146
|
+
def _deserialize(type, value)
|
147
|
+
case type.to_sym
|
148
|
+
when :DateTime
|
149
|
+
DateTime.parse(value)
|
150
|
+
when :Date
|
151
|
+
Date.parse(value)
|
152
|
+
when :String
|
153
|
+
value.to_s
|
154
|
+
when :Integer
|
155
|
+
value.to_i
|
156
|
+
when :Float
|
157
|
+
value.to_f
|
158
|
+
when :Boolean
|
159
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
160
|
+
true
|
161
|
+
else
|
162
|
+
false
|
163
|
+
end
|
164
|
+
when :Object
|
165
|
+
# generic object (usually a Hash), return directly
|
166
|
+
value
|
167
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
168
|
+
inner_type = Regexp.last_match[:inner_type]
|
169
|
+
value.map { |v| _deserialize(inner_type, v) }
|
170
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
171
|
+
k_type = Regexp.last_match[:k_type]
|
172
|
+
v_type = Regexp.last_match[:v_type]
|
173
|
+
{}.tap do |hash|
|
174
|
+
value.each do |k, v|
|
175
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
else # model
|
179
|
+
temp_model = TransferZero.const_get(type).new
|
180
|
+
temp_model.build_from_hash(value)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
# Returns the string representation of the object
|
185
|
+
# @return [String] String presentation of the object
|
186
|
+
def to_s
|
187
|
+
to_hash.to_s
|
188
|
+
end
|
189
|
+
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
192
|
+
def to_body
|
193
|
+
to_hash
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the object in the form of hash
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_hash
|
199
|
+
hash = {}
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
201
|
+
value = self.send(attr)
|
202
|
+
next if value.nil?
|
203
|
+
hash[param] = _to_hash(value)
|
204
|
+
end
|
205
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
206
|
+
end
|
207
|
+
|
208
|
+
def [](key)
|
209
|
+
to_hash[key]
|
210
|
+
end
|
211
|
+
|
212
|
+
def dig(*args)
|
213
|
+
to_hash.dig(*args)
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|