transferzero-sdk 1.15.1 → 1.18.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 +89 -0
- data/README.md +8 -5
- data/docs/PayoutMethod.md +1 -1
- data/docs/PayoutMethodDetails.md +4 -2
- data/docs/PayoutMethodDetailsGNFMobile.md +23 -0
- data/docs/PayoutMethodDetailsKESBank.md +3 -1
- data/docs/PayoutMethodDetailsKESMobile.md +3 -1
- data/docs/PayoutMethodDetailsUSDBank.md +1 -1
- data/docs/PayoutMethodDetailsUSDCash.md +23 -0
- data/docs/PayoutMethodDetailsXAFMobile.md +25 -0
- data/docs/PayoutMethodDetailsXOFBank.md +3 -1
- data/docs/PayoutMethodDetailsXOFMobile.md +3 -1
- data/docs/PayoutMethodDetailsZARBank.md +2 -0
- data/docs/{PayoutMethodCountryEnumUSDBank.md → PayoutMethodTransferReasonEnum.md} +2 -2
- data/docs/Recipient.md +2 -0
- data/docs/Sender.md +2 -0
- data/lib/transferzero-sdk/api_client.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details.rb +14 -7
- data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +250 -0
- data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +11 -7
- data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +11 -7
- data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +1 -1
- data/lib/transferzero-sdk/models/payout_method_details_usd_bank.rb +2 -2
- data/lib/transferzero-sdk/models/payout_method_details_usd_cash.rb +250 -0
- data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +259 -0
- data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +14 -5
- data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +14 -5
- data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +11 -2
- data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +3 -0
- data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +137 -0
- data/lib/transferzero-sdk/models/recipient.rb +45 -1
- data/lib/transferzero-sdk/models/sender.rb +11 -1
- data/lib/transferzero-sdk/version.rb +1 -1
- data/lib/transferzero-sdk.rb +4 -1
- data/spec/models/payout_method_details_gnf_mobile_spec.rb +59 -0
- data/spec/models/payout_method_details_usd_cash_spec.rb +59 -0
- data/spec/models/payout_method_details_xaf_mobile_spec.rb +65 -0
- data/spec/models/{payout_method_country_enum_usd_bank_spec.rb → payout_method_transfer_reason_enum_spec.rb} +6 -6
- data/transferzero-sdk-1.16.1.gem +0 -0
- metadata +21 -7
- data/lib/transferzero-sdk/models/payout_method_country_enum_usd_bank.rb +0 -269
@@ -0,0 +1,250 @@
|
|
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\": \"444044436\", // local or international Guinea format \"mobile_provider\": \"mtn\" } ```
|
17
|
+
class PayoutMethodDetailsGNFMobile
|
18
|
+
attr_accessor :first_name
|
19
|
+
|
20
|
+
attr_accessor :last_name
|
21
|
+
|
22
|
+
attr_accessor :phone_number
|
23
|
+
|
24
|
+
attr_accessor :mobile_provider
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'first_name' => :'first_name',
|
30
|
+
:'last_name' => :'last_name',
|
31
|
+
:'phone_number' => :'phone_number',
|
32
|
+
:'mobile_provider' => :'mobile_provider'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'first_name' => :'String',
|
40
|
+
:'last_name' => :'String',
|
41
|
+
:'phone_number' => :'String',
|
42
|
+
:'mobile_provider' => :'PayoutMethodMobileProviderEnum'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsGNFMobile` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsGNFMobile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'first_name')
|
62
|
+
self.first_name = attributes[:'first_name']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:'last_name')
|
66
|
+
self.last_name = attributes[:'last_name']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'phone_number')
|
70
|
+
self.phone_number = attributes[:'phone_number']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'mobile_provider')
|
74
|
+
self.mobile_provider = attributes[:'mobile_provider']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
if @first_name.nil?
|
83
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @last_name.nil?
|
87
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if @phone_number.nil?
|
91
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
if @mobile_provider.nil?
|
95
|
+
invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
return false if @first_name.nil?
|
105
|
+
return false if @last_name.nil?
|
106
|
+
return false if @phone_number.nil?
|
107
|
+
return false if @mobile_provider.nil?
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
# Checks equality by comparing each attribute.
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def ==(o)
|
114
|
+
return true if self.equal?(o)
|
115
|
+
self.class == o.class &&
|
116
|
+
first_name == o.first_name &&
|
117
|
+
last_name == o.last_name &&
|
118
|
+
phone_number == o.phone_number &&
|
119
|
+
mobile_provider == o.mobile_provider
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Integer] Hash code
|
130
|
+
def hash
|
131
|
+
[first_name, last_name, phone_number, mobile_provider].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
require 'active_support/core_ext/hash'
|
135
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
temp_model = TransferZero.const_get(type).new
|
194
|
+
temp_model.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
next if value.nil?
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
220
|
+
end
|
221
|
+
|
222
|
+
def [](key)
|
223
|
+
to_hash[key]
|
224
|
+
end
|
225
|
+
|
226
|
+
def dig(*args)
|
227
|
+
to_hash.dig(*args)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
@@ -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\", \"street\": \"Main Street\", \"bank_code\": \"68\", \"bank_account\": \"12345678\", \"bank_name\": \"Equity Bank Ltd\", \"branch_code\": \"404\", \"swift_code\" \"ABCLKENA\", \"
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"street\": \"Main Street\", \"bank_code\": \"68\", \"bank_account\": \"12345678\", \"bank_name\": \"Equity Bank Ltd\", \"branch_code\": \"404\", \"swift_code\" \"ABCLKENA\", \"transfer_reason\": \"personal_account\", // New transfer reason field \"identity_card_type\": \"ID\", \"identity_card_id\": \"AB12345678\" } ``` The valid bank_code values are: - Habib Bank Limited: 08 - Trans-National Bank Limited: 26 - Housing Finance Co. Kenya: 61 - UBA Kenya Bank Ltd: 76 - Kenya Commercial Bank: 01000 - Standard Chartered Bank: 02000 - Barclays Bank of Kenya: 03000 - Bank of India: 05000 - Bank of Boroda: 06000 - NCBA Bank: 07000 - Prime Bank: 10000 - Co-operative Bank of Kenya: 11000 - National Bank of Kenya: 12000 - M-Oriental Commercial Bank Limited: 14000 - Citibank: 16000 - Habib Bank A.G. Zurich: 17000 - Middle East Bank: 18000 - Bank of Africa Kenya: 19000 - Consolidated Bank of Kenya: 23000 - Credit Bank Ltd: 25000 - Chase Bank: 30000 - Stanbic Bank Kenya: 31000 - African Banking Corporation: 35000 - Giro Bank Limited: 42000 - ECO Bank Kenya: 43000 - Spire Bank Limited: 49000 - Paramount Universal Bank Limited: 50000 - Jamii Bora Bank: 51000 - Guaranty Trust Bank Kenya: 53000 - Victoria Bank Limited: 54000 - Guardian Bank: 55000 - Investments and Mortgages Bank Limited: 57000 - Development Bank of Kenya: 59000 - Fidelity Commercial Bank: 46000 - Diamond Trust Bank: 63000 - Sidian Bank: 66000 - Equity Bank Limited: 68000 - Family Bank: 70000 - Gulf African Bank: 72000 - First Community Bank: 74000 - KWFT Bank: 78000 See [KES Bank](https://docs.transferzero.com/docs/payout-details/#kesbank) documentation for the transfer_reason list
|
17
17
|
class PayoutMethodDetailsKESBank
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -33,6 +33,8 @@ class PayoutMethodDetailsKESBank
|
|
33
33
|
|
34
34
|
attr_accessor :transfer_reason_code
|
35
35
|
|
36
|
+
attr_accessor :transfer_reason
|
37
|
+
|
36
38
|
attr_accessor :identity_card_type
|
37
39
|
|
38
40
|
attr_accessor :identity_card_id
|
@@ -49,6 +51,7 @@ class PayoutMethodDetailsKESBank
|
|
49
51
|
:'branch_code' => :'branch_code',
|
50
52
|
:'swift_code' => :'swift_code',
|
51
53
|
:'transfer_reason_code' => :'transfer_reason_code',
|
54
|
+
:'transfer_reason' => :'transfer_reason',
|
52
55
|
:'identity_card_type' => :'identity_card_type',
|
53
56
|
:'identity_card_id' => :'identity_card_id'
|
54
57
|
}
|
@@ -66,6 +69,7 @@ class PayoutMethodDetailsKESBank
|
|
66
69
|
:'branch_code' => :'String',
|
67
70
|
:'swift_code' => :'String',
|
68
71
|
:'transfer_reason_code' => :'String',
|
72
|
+
:'transfer_reason' => :'PayoutMethodTransferReasonEnum',
|
69
73
|
:'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
|
70
74
|
:'identity_card_id' => :'String'
|
71
75
|
}
|
@@ -122,6 +126,10 @@ class PayoutMethodDetailsKESBank
|
|
122
126
|
self.transfer_reason_code = attributes[:'transfer_reason_code']
|
123
127
|
end
|
124
128
|
|
129
|
+
if attributes.key?(:'transfer_reason')
|
130
|
+
self.transfer_reason = attributes[:'transfer_reason']
|
131
|
+
end
|
132
|
+
|
125
133
|
if attributes.key?(:'identity_card_type')
|
126
134
|
self.identity_card_type = attributes[:'identity_card_type']
|
127
135
|
end
|
@@ -163,10 +171,6 @@ class PayoutMethodDetailsKESBank
|
|
163
171
|
invalid_properties.push('invalid value for "swift_code", swift_code cannot be nil.')
|
164
172
|
end
|
165
173
|
|
166
|
-
if @transfer_reason_code.nil?
|
167
|
-
invalid_properties.push('invalid value for "transfer_reason_code", transfer_reason_code cannot be nil.')
|
168
|
-
end
|
169
|
-
|
170
174
|
if @identity_card_type.nil?
|
171
175
|
invalid_properties.push('invalid value for "identity_card_type", identity_card_type cannot be nil.')
|
172
176
|
end
|
@@ -188,7 +192,6 @@ class PayoutMethodDetailsKESBank
|
|
188
192
|
return false if @bank_account.nil?
|
189
193
|
return false if @bank_name.nil?
|
190
194
|
return false if @swift_code.nil?
|
191
|
-
return false if @transfer_reason_code.nil?
|
192
195
|
return false if @identity_card_type.nil?
|
193
196
|
return false if @identity_card_id.nil?
|
194
197
|
true
|
@@ -208,6 +211,7 @@ class PayoutMethodDetailsKESBank
|
|
208
211
|
branch_code == o.branch_code &&
|
209
212
|
swift_code == o.swift_code &&
|
210
213
|
transfer_reason_code == o.transfer_reason_code &&
|
214
|
+
transfer_reason == o.transfer_reason &&
|
211
215
|
identity_card_type == o.identity_card_type &&
|
212
216
|
identity_card_id == o.identity_card_id
|
213
217
|
end
|
@@ -221,7 +225,7 @@ class PayoutMethodDetailsKESBank
|
|
221
225
|
# Calculates hash code according to all attributes.
|
222
226
|
# @return [Integer] Hash code
|
223
227
|
def hash
|
224
|
-
[first_name, last_name, bank_code, street, bank_account, bank_name, branch_code, swift_code, transfer_reason_code, identity_card_type, identity_card_id].hash
|
228
|
+
[first_name, last_name, bank_code, street, bank_account, bank_name, branch_code, swift_code, transfer_reason_code, transfer_reason, identity_card_type, identity_card_id].hash
|
225
229
|
end
|
226
230
|
|
227
231
|
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\", \"street\": \"Main Street\", \"phone_number\": \"+254997853134\", \"mobile_provider\": \"mpesa\", \"
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"street\": \"Main Street\", \"phone_number\": \"+254997853134\", \"mobile_provider\": \"mpesa\", \"transfer_reason\": \"personal_account\", // New transfer reason field \"identity_card_type\": \"ID\", \"identity_card_id\": \"AB12345678\" } ``` See [KES Mobile](https://docs.transferzero.com/docs/payout-details/#kesmobile) documentation for transfer_reason lists
|
17
17
|
class PayoutMethodDetailsKESMobile
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -27,6 +27,8 @@ class PayoutMethodDetailsKESMobile
|
|
27
27
|
|
28
28
|
attr_accessor :transfer_reason_code
|
29
29
|
|
30
|
+
attr_accessor :transfer_reason
|
31
|
+
|
30
32
|
attr_accessor :identity_card_type
|
31
33
|
|
32
34
|
attr_accessor :identity_card_id
|
@@ -40,6 +42,7 @@ class PayoutMethodDetailsKESMobile
|
|
40
42
|
:'phone_number' => :'phone_number',
|
41
43
|
:'mobile_provider' => :'mobile_provider',
|
42
44
|
:'transfer_reason_code' => :'transfer_reason_code',
|
45
|
+
:'transfer_reason' => :'transfer_reason',
|
43
46
|
:'identity_card_type' => :'identity_card_type',
|
44
47
|
:'identity_card_id' => :'identity_card_id'
|
45
48
|
}
|
@@ -54,6 +57,7 @@ class PayoutMethodDetailsKESMobile
|
|
54
57
|
:'phone_number' => :'String',
|
55
58
|
:'mobile_provider' => :'PayoutMethodMobileProviderEnum',
|
56
59
|
:'transfer_reason_code' => :'String',
|
60
|
+
:'transfer_reason' => :'PayoutMethodTransferReasonEnum',
|
57
61
|
:'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
|
58
62
|
:'identity_card_id' => :'String'
|
59
63
|
}
|
@@ -98,6 +102,10 @@ class PayoutMethodDetailsKESMobile
|
|
98
102
|
self.transfer_reason_code = attributes[:'transfer_reason_code']
|
99
103
|
end
|
100
104
|
|
105
|
+
if attributes.key?(:'transfer_reason')
|
106
|
+
self.transfer_reason = attributes[:'transfer_reason']
|
107
|
+
end
|
108
|
+
|
101
109
|
if attributes.key?(:'identity_card_type')
|
102
110
|
self.identity_card_type = attributes[:'identity_card_type']
|
103
111
|
end
|
@@ -131,10 +139,6 @@ class PayoutMethodDetailsKESMobile
|
|
131
139
|
invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
|
132
140
|
end
|
133
141
|
|
134
|
-
if @transfer_reason_code.nil?
|
135
|
-
invalid_properties.push('invalid value for "transfer_reason_code", transfer_reason_code cannot be nil.')
|
136
|
-
end
|
137
|
-
|
138
142
|
if @identity_card_type.nil?
|
139
143
|
invalid_properties.push('invalid value for "identity_card_type", identity_card_type cannot be nil.')
|
140
144
|
end
|
@@ -154,7 +158,6 @@ class PayoutMethodDetailsKESMobile
|
|
154
158
|
return false if @street.nil?
|
155
159
|
return false if @phone_number.nil?
|
156
160
|
return false if @mobile_provider.nil?
|
157
|
-
return false if @transfer_reason_code.nil?
|
158
161
|
return false if @identity_card_type.nil?
|
159
162
|
return false if @identity_card_id.nil?
|
160
163
|
true
|
@@ -171,6 +174,7 @@ class PayoutMethodDetailsKESMobile
|
|
171
174
|
phone_number == o.phone_number &&
|
172
175
|
mobile_provider == o.mobile_provider &&
|
173
176
|
transfer_reason_code == o.transfer_reason_code &&
|
177
|
+
transfer_reason == o.transfer_reason &&
|
174
178
|
identity_card_type == o.identity_card_type &&
|
175
179
|
identity_card_id == o.identity_card_id
|
176
180
|
end
|
@@ -184,7 +188,7 @@ class PayoutMethodDetailsKESMobile
|
|
184
188
|
# Calculates hash code according to all attributes.
|
185
189
|
# @return [Integer] Hash code
|
186
190
|
def hash
|
187
|
-
[first_name, last_name, street, phone_number, mobile_provider, transfer_reason_code, identity_card_type, identity_card_id].hash
|
191
|
+
[first_name, last_name, street, phone_number, mobile_provider, transfer_reason_code, transfer_reason, identity_card_type, identity_card_id].hash
|
188
192
|
end
|
189
193
|
|
190
194
|
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\": \"7087661234\"
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"7087661234\" // local or international format } ``` Please note when sending XOF::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\" }, (...) } ```
|
17
17
|
class PayoutMethodDetailsMobile
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -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\": \"Jane\", \"last_name\": \"Doe\", \"phone_number\": \"+2341234567\", \"bank_code\": \"057\", \"bank_account\": \"1234567890\", \"country\": \"NG\" } ``` See [USD Bank](https://docs.transferzero.com/docs/payout-details/#usdbank) documentation for the bank_code
|
16
|
+
# ```JSON \"details\": { \"first_name\": \"Jane\", \"last_name\": \"Doe\", \"phone_number\": \"+2341234567\", \"bank_code\": \"057\", \"bank_account\": \"1234567890\", \"country\": \"NG\" } ``` See [USD Bank](https://docs.transferzero.com/docs/payout-details/#usdbank) documentation for the bank_code and country lists
|
17
17
|
class PayoutMethodDetailsUSDBank
|
18
18
|
attr_accessor :first_name
|
19
19
|
|
@@ -47,7 +47,7 @@ class PayoutMethodDetailsUSDBank
|
|
47
47
|
:'phone_number' => :'String',
|
48
48
|
:'bank_code' => :'String',
|
49
49
|
:'bank_account' => :'String',
|
50
|
-
:'country' => :'
|
50
|
+
:'country' => :'PayoutMethodCountryEnum'
|
51
51
|
}
|
52
52
|
end
|
53
53
|
|
@@ -0,0 +1,250 @@
|
|
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\": \"Jane\", \"last_name\": \"Doe\", \"phone_number\": \"+2341234567\", \"country\": \"NG\" } ``` See [USD Cash](https://docs.transferzero.com/docs/payout-details/#usdcash) documentation for the country list
|
17
|
+
class PayoutMethodDetailsUSDCash
|
18
|
+
attr_accessor :first_name
|
19
|
+
|
20
|
+
attr_accessor :last_name
|
21
|
+
|
22
|
+
attr_accessor :phone_number
|
23
|
+
|
24
|
+
attr_accessor :country
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'first_name' => :'first_name',
|
30
|
+
:'last_name' => :'last_name',
|
31
|
+
:'phone_number' => :'phone_number',
|
32
|
+
:'country' => :'country'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'first_name' => :'String',
|
40
|
+
:'last_name' => :'String',
|
41
|
+
:'phone_number' => :'String',
|
42
|
+
:'country' => :'PayoutMethodCountryEnum'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
if (!attributes.is_a?(Hash))
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsUSDCash` initialize method"
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsUSDCash`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
h[k.to_sym] = v
|
59
|
+
}
|
60
|
+
|
61
|
+
if attributes.key?(:'first_name')
|
62
|
+
self.first_name = attributes[:'first_name']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:'last_name')
|
66
|
+
self.last_name = attributes[:'last_name']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'phone_number')
|
70
|
+
self.phone_number = attributes[:'phone_number']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'country')
|
74
|
+
self.country = attributes[:'country']
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properties with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
if @first_name.nil?
|
83
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
84
|
+
end
|
85
|
+
|
86
|
+
if @last_name.nil?
|
87
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if @phone_number.nil?
|
91
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
if @country.nil?
|
95
|
+
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
return false if @first_name.nil?
|
105
|
+
return false if @last_name.nil?
|
106
|
+
return false if @phone_number.nil?
|
107
|
+
return false if @country.nil?
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
# Checks equality by comparing each attribute.
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def ==(o)
|
114
|
+
return true if self.equal?(o)
|
115
|
+
self.class == o.class &&
|
116
|
+
first_name == o.first_name &&
|
117
|
+
last_name == o.last_name &&
|
118
|
+
phone_number == o.phone_number &&
|
119
|
+
country == o.country
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Integer] Hash code
|
130
|
+
def hash
|
131
|
+
[first_name, last_name, phone_number, country].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
require 'active_support/core_ext/hash'
|
135
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
temp_model = TransferZero.const_get(type).new
|
194
|
+
temp_model.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
next if value.nil?
|
217
|
+
hash[param] = _to_hash(value)
|
218
|
+
end
|
219
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
220
|
+
end
|
221
|
+
|
222
|
+
def [](key)
|
223
|
+
to_hash[key]
|
224
|
+
end
|
225
|
+
|
226
|
+
def dig(*args)
|
227
|
+
to_hash.dig(*args)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|