transferzero-sdk 1.16.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +92 -0
  3. data/README.md +15 -4
  4. data/docs/Document.md +2 -0
  5. data/docs/PayinMethod.md +12 -4
  6. data/docs/PayinMethodDetails.md +5 -5
  7. data/docs/PayinMethodDetailsMobile.md +3 -3
  8. data/docs/PayinMethodDetailsNGNBank.md +2 -2
  9. data/docs/PayinMethodResponse.md +17 -0
  10. data/docs/PayinMethodState.md +16 -0
  11. data/docs/PayinMethodUxFlow.md +16 -0
  12. data/docs/PayinMethodsApi.md +256 -0
  13. data/docs/PayoutMethod.md +1 -1
  14. data/docs/PayoutMethodDetails.md +4 -2
  15. data/docs/PayoutMethodDetailsGNFMobile.md +23 -0
  16. data/docs/PayoutMethodDetailsKESBank.md +3 -1
  17. data/docs/PayoutMethodDetailsKESMobile.md +3 -1
  18. data/docs/PayoutMethodDetailsXAFMobile.md +25 -0
  19. data/docs/PayoutMethodDetailsXOFBank.md +3 -1
  20. data/docs/PayoutMethodDetailsXOFCash.md +1 -1
  21. data/docs/PayoutMethodDetailsXOFMobile.md +3 -1
  22. data/docs/PayoutMethodDetailsZARBank.md +2 -0
  23. data/docs/PayoutMethodTransferReasonEnum.md +16 -0
  24. data/docs/Recipient.md +2 -0
  25. data/docs/RecipientStateReasonDetails.md +3 -3
  26. data/docs/Sender.md +4 -0
  27. data/docs/StateReasonDetails.md +23 -0
  28. data/lib/transferzero-sdk/api/payin_methods_api.rb +244 -0
  29. data/lib/transferzero-sdk/api_client.rb +1 -1
  30. data/lib/transferzero-sdk/models/document.rb +11 -1
  31. data/lib/transferzero-sdk/models/payin_method.rb +47 -9
  32. data/lib/transferzero-sdk/models/payin_method_details.rb +9 -15
  33. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +8 -14
  34. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  35. data/lib/transferzero-sdk/models/payin_method_response.rb +202 -0
  36. data/lib/transferzero-sdk/models/payin_method_state.rb +39 -0
  37. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +31 -0
  38. data/lib/transferzero-sdk/models/payout_method.rb +1 -1
  39. data/lib/transferzero-sdk/models/payout_method_details.rb +17 -6
  40. data/lib/transferzero-sdk/models/payout_method_details_gnf_mobile.rb +250 -0
  41. data/lib/transferzero-sdk/models/payout_method_details_kes_bank.rb +11 -7
  42. data/lib/transferzero-sdk/models/payout_method_details_kes_mobile.rb +11 -7
  43. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +1 -1
  44. data/lib/transferzero-sdk/models/payout_method_details_xaf_mobile.rb +259 -0
  45. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +14 -5
  46. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +6 -1
  47. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +14 -5
  48. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +11 -2
  49. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +1 -0
  50. data/lib/transferzero-sdk/models/payout_method_transfer_reason_enum.rb +137 -0
  51. data/lib/transferzero-sdk/models/recipient.rb +45 -1
  52. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +21 -2
  53. data/lib/transferzero-sdk/models/sender.rb +21 -1
  54. data/lib/transferzero-sdk/models/state_reason_details.rb +235 -0
  55. data/lib/transferzero-sdk/version.rb +1 -1
  56. data/lib/transferzero-sdk.rb +8 -0
  57. data/spec/api/payin_methods_api_spec.rb +84 -0
  58. data/spec/models/payin_method_response_spec.rb +41 -0
  59. data/spec/models/payin_method_state_spec.rb +35 -0
  60. data/spec/models/payin_method_ux_flow_spec.rb +35 -0
  61. data/spec/models/payout_method_details_gnf_mobile_spec.rb +59 -0
  62. data/spec/models/payout_method_details_xaf_mobile_spec.rb +65 -0
  63. data/spec/models/payout_method_transfer_reason_enum_spec.rb +35 -0
  64. data/spec/models/state_reason_details_spec.rb +59 -0
  65. metadata +35 -2
@@ -30,6 +30,8 @@ class PayoutMethodDetails
30
30
 
31
31
  attr_accessor :country
32
32
 
33
+ attr_accessor :transfer_reason
34
+
33
35
  attr_accessor :iban
34
36
 
35
37
  attr_accessor :bank_name
@@ -99,6 +101,7 @@ class PayoutMethodDetails
99
101
  :'phone_number' => :'phone_number',
100
102
  :'mobile_provider' => :'mobile_provider',
101
103
  :'country' => :'country',
104
+ :'transfer_reason' => :'transfer_reason',
102
105
  :'iban' => :'iban',
103
106
  :'bank_name' => :'bank_name',
104
107
  :'bank_country' => :'bank_country',
@@ -142,6 +145,7 @@ class PayoutMethodDetails
142
145
  :'phone_number' => :'String',
143
146
  :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
144
147
  :'country' => :'PayoutMethodCountryEnum',
148
+ :'transfer_reason' => :'PayoutMethodTransferReasonEnum',
145
149
  :'iban' => :'String',
146
150
  :'bank_name' => :'String',
147
151
  :'bank_country' => :'String',
@@ -182,6 +186,7 @@ class PayoutMethodDetails
182
186
  :'PayoutMethodDetailsGBPBank',
183
187
  :'PayoutMethodDetailsGHSBank',
184
188
  :'PayoutMethodDetailsGHSCash',
189
+ :'PayoutMethodDetailsGNFMobile',
185
190
  :'PayoutMethodDetailsIBAN',
186
191
  :'PayoutMethodDetailsKESBank',
187
192
  :'PayoutMethodDetailsKESMobile',
@@ -190,6 +195,7 @@ class PayoutMethodDetails
190
195
  :'PayoutMethodDetailsNGNBank',
191
196
  :'PayoutMethodDetailsUSDBank',
192
197
  :'PayoutMethodDetailsUSDCash',
198
+ :'PayoutMethodDetailsXAFMobile',
193
199
  :'PayoutMethodDetailsXOFBank',
194
200
  :'PayoutMethodDetailsXOFCash',
195
201
  :'PayoutMethodDetailsXOFMobile',
@@ -244,6 +250,10 @@ class PayoutMethodDetails
244
250
  self.country = attributes[:'country']
245
251
  end
246
252
 
253
+ if attributes.key?(:'transfer_reason')
254
+ self.transfer_reason = attributes[:'transfer_reason']
255
+ end
256
+
247
257
  if attributes.key?(:'iban')
248
258
  self.iban = attributes[:'iban']
249
259
  end
@@ -401,6 +411,10 @@ class PayoutMethodDetails
401
411
  invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
402
412
  end
403
413
 
414
+ if @cash_provider.nil?
415
+ invalid_properties.push('invalid value for "cash_provider", cash_provider cannot be nil.')
416
+ end
417
+
404
418
  if @sender_identity_card_type.nil?
405
419
  invalid_properties.push('invalid value for "sender_identity_card_type", sender_identity_card_type cannot be nil.')
406
420
  end
@@ -437,10 +451,6 @@ class PayoutMethodDetails
437
451
  invalid_properties.push('invalid value for "city", city cannot be nil.')
438
452
  end
439
453
 
440
- if @transfer_reason_code.nil?
441
- invalid_properties.push('invalid value for "transfer_reason_code", transfer_reason_code cannot be nil.')
442
- end
443
-
444
454
  if @swift_code.nil?
445
455
  invalid_properties.push('invalid value for "swift_code", swift_code cannot be nil.')
446
456
  end
@@ -460,6 +470,7 @@ class PayoutMethodDetails
460
470
  return false if @country.nil?
461
471
  return false if @iban.nil?
462
472
  return false if @bank_name.nil?
473
+ return false if @cash_provider.nil?
463
474
  return false if @sender_identity_card_type.nil?
464
475
  return false if @sender_identity_card_id.nil?
465
476
  return false if @identity_card_type.nil?
@@ -469,7 +480,6 @@ class PayoutMethodDetails
469
480
  return false if @street.nil?
470
481
  return false if @postal_code.nil?
471
482
  return false if @city.nil?
472
- return false if @transfer_reason_code.nil?
473
483
  return false if @swift_code.nil?
474
484
  _one_of_found = false
475
485
  openapi_one_of.each do |_class|
@@ -503,6 +513,7 @@ class PayoutMethodDetails
503
513
  phone_number == o.phone_number &&
504
514
  mobile_provider == o.mobile_provider &&
505
515
  country == o.country &&
516
+ transfer_reason == o.transfer_reason &&
506
517
  iban == o.iban &&
507
518
  bank_name == o.bank_name &&
508
519
  bank_country == o.bank_country &&
@@ -543,7 +554,7 @@ class PayoutMethodDetails
543
554
  # Calculates hash code according to all attributes.
544
555
  # @return [Integer] Hash code
545
556
  def hash
546
- [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, contact_first_name, contact_last_name, registration_number, nature_of_business, legal_entity_type, branch_code, swift_code].hash
557
+ [first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, country, transfer_reason, 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, contact_first_name, contact_last_name, registration_number, nature_of_business, legal_entity_type, branch_code, swift_code].hash
547
558
  end
548
559
 
549
560
  require 'active_support/core_ext/hash'
@@ -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\", \"transfer_reason_code\": \"185\", \"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_code list
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\", \"transfer_reason_code\": \"185\", \"identity_card_type\": \"ID\", \"identity_card_id\": \"AB12345678\" } ``` See [KES Mobile](https://docs.transferzero.com/docs/payout-details/#kesmobile) documentation for transfer_reason_code lists
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\" # 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\" }, (...) } ```
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