transferzero-sdk 1.18.0 → 1.19.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +19 -16
  3. data/README.md +12 -4
  4. data/docs/Document.md +2 -0
  5. data/docs/PayinMethod.md +12 -4
  6. data/docs/PayinMethodDetails.md +7 -5
  7. data/docs/PayinMethodDetailsMobile.md +5 -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 +257 -0
  13. data/docs/PayoutMethodDetails.md +1 -1
  14. data/docs/PayoutMethodDetailsXOFCash.md +1 -1
  15. data/docs/RecipientStateReasonDetails.md +3 -3
  16. data/docs/Sender.md +2 -0
  17. data/docs/StateReasonDetails.md +23 -0
  18. data/lib/transferzero-sdk/api/payin_methods_api.rb +247 -0
  19. data/lib/transferzero-sdk/api_client.rb +1 -1
  20. data/lib/transferzero-sdk/models/document.rb +11 -1
  21. data/lib/transferzero-sdk/models/payin_method.rb +47 -9
  22. data/lib/transferzero-sdk/models/payin_method_details.rb +19 -15
  23. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +18 -14
  24. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +2 -2
  25. data/lib/transferzero-sdk/models/payin_method_response.rb +202 -0
  26. data/lib/transferzero-sdk/models/payin_method_state.rb +39 -0
  27. data/lib/transferzero-sdk/models/payin_method_ux_flow.rb +36 -0
  28. data/lib/transferzero-sdk/models/payout_method_details.rb +5 -0
  29. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +6 -1
  30. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +21 -2
  31. data/lib/transferzero-sdk/models/sender.rb +11 -1
  32. data/lib/transferzero-sdk/models/state_reason_details.rb +235 -0
  33. data/lib/transferzero-sdk/version.rb +1 -1
  34. data/lib/transferzero-sdk.rb +5 -0
  35. data/spec/api/payin_methods_api_spec.rb +84 -0
  36. data/spec/models/payin_method_response_spec.rb +41 -0
  37. data/spec/models/payin_method_state_spec.rb +35 -0
  38. data/spec/models/payin_method_ux_flow_spec.rb +35 -0
  39. data/spec/models/state_reason_details_spec.rb +59 -0
  40. data/transferzero-sdk-1.19.0.gem +0 -0
  41. metadata +33 -13
  42. data/transferzero-sdk-1.16.1.gem +0 -0
@@ -0,0 +1,247 @@
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 'uri'
14
+
15
+ module TransferZero
16
+ class PayinMethodsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+
24
+ # Deleting a payin method
25
+ # Initiates a cancellation request for the specified payin method
26
+ # @param payin_method_id ID of the payin method to delete. Example: `/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [PayinMethodResponse]
29
+ def delete_payin_method(payin_method_id, opts = {})
30
+ data, _status_code, _headers = delete_payin_method_with_http_info(payin_method_id, opts)
31
+ data
32
+ end
33
+
34
+ # Deleting a payin method
35
+ # Initiates a cancellation request for the specified payin method
36
+ # @param payin_method_id ID of the payin method to delete. Example: `/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(PayinMethodResponse, Fixnum, Hash)>] PayinMethodResponse data, response status code and response headers
39
+ def delete_payin_method_with_http_info(payin_method_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: PayinMethodsApi.delete_payin_method ...'
42
+ end
43
+ # verify the required parameter 'payin_method_id' is set
44
+ if @api_client.config.client_side_validation && payin_method_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.delete_payin_method"
46
+ end
47
+ # resource path
48
+ local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)
49
+
50
+ # query parameters
51
+ query_params = {}
52
+
53
+ # header parameters
54
+ header_params = {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = nil
63
+ auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
64
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'PayinMethodResponse')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: PayinMethodsApi#delete_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+
77
+
78
+ # Fetching a payin method
79
+ # Show a payin method by id
80
+ # @param payin_method_id ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [PayinMethodResponse]
83
+ def get_payin_method(payin_method_id, opts = {})
84
+ data, _status_code, _headers = get_payin_method_with_http_info(payin_method_id, opts)
85
+ data
86
+ end
87
+
88
+ # Fetching a payin method
89
+ # Show a payin method by id
90
+ # @param payin_method_id ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [Array<(PayinMethodResponse, Fixnum, Hash)>] PayinMethodResponse data, response status code and response headers
93
+ def get_payin_method_with_http_info(payin_method_id, opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug 'Calling API: PayinMethodsApi.get_payin_method ...'
96
+ end
97
+ # verify the required parameter 'payin_method_id' is set
98
+ if @api_client.config.client_side_validation && payin_method_id.nil?
99
+ fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.get_payin_method"
100
+ end
101
+ # resource path
102
+ local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)
103
+
104
+ # query parameters
105
+ query_params = {}
106
+
107
+ # header parameters
108
+ header_params = {}
109
+ # HTTP header 'Accept' (if needed)
110
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
111
+
112
+ # form parameters
113
+ form_params = {}
114
+
115
+ # http body (model)
116
+ post_body = nil
117
+ auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
118
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
119
+ :header_params => header_params,
120
+ :query_params => query_params,
121
+ :form_params => form_params,
122
+ :body => post_body,
123
+ :auth_names => auth_names,
124
+ :return_type => 'PayinMethodResponse')
125
+ if @api_client.config.debugging
126
+ @api_client.config.logger.debug "API called: PayinMethodsApi#get_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
127
+ end
128
+ return data, status_code, headers
129
+ end
130
+
131
+
132
+ # Updating a payin method
133
+ # Updates the payin method specified in the URL path.
134
+ # @param payin_method_id ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
135
+ # @param payin_method
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [PayinMethodResponse]
138
+ def patch_payin_method(payin_method_id, payin_method, opts = {})
139
+ data, _status_code, _headers = patch_payin_method_with_http_info(payin_method_id, payin_method, opts)
140
+ data
141
+ end
142
+
143
+ # Updating a payin method
144
+ # Updates the payin method specified in the URL path.
145
+ # @param payin_method_id ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;
146
+ # @param payin_method
147
+ # @param [Hash] opts the optional parameters
148
+ # @return [Array<(PayinMethodResponse, Fixnum, Hash)>] PayinMethodResponse data, response status code and response headers
149
+ def patch_payin_method_with_http_info(payin_method_id, payin_method, opts = {})
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug 'Calling API: PayinMethodsApi.patch_payin_method ...'
152
+ end
153
+ # verify the required parameter 'payin_method_id' is set
154
+ if @api_client.config.client_side_validation && payin_method_id.nil?
155
+ fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.patch_payin_method"
156
+ end
157
+ # verify the required parameter 'payin_method' is set
158
+ if @api_client.config.client_side_validation && payin_method.nil?
159
+ fail ArgumentError, "Missing the required parameter 'payin_method' when calling PayinMethodsApi.patch_payin_method"
160
+ end
161
+ # resource path
162
+ local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)
163
+
164
+ # query parameters
165
+ query_params = {}
166
+
167
+ # header parameters
168
+ header_params = {}
169
+ # HTTP header 'Accept' (if needed)
170
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
171
+ # HTTP header 'Content-Type'
172
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
173
+
174
+ # form parameters
175
+ form_params = {}
176
+
177
+ # http body (model)
178
+ post_body = @api_client.object_to_http_body(payin_method)
179
+ auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
180
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => 'PayinMethodResponse')
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: PayinMethodsApi#patch_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+
193
+
194
+ # Retries PayinMethod
195
+ # Retries the collection process for the payin method. Please note only payin methods in `error` state can be retried.
196
+ # @param payin_method_id ID of the payin method whose collection process should be retried Example: &#x60;/v1/payin_methods/9d4d7b73-a94c-4979-ab57-09074fd55d33/retry&#x60;
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [PayinMethodResponse]
199
+ def retry_payin_method(payin_method_id, opts = {})
200
+ data, _status_code, _headers = retry_payin_method_with_http_info(payin_method_id, opts)
201
+ data
202
+ end
203
+
204
+ # Retries PayinMethod
205
+ # Retries the collection process for the payin method. Please note only payin methods in &#x60;error&#x60; state can be retried.
206
+ # @param payin_method_id ID of the payin method whose collection process should be retried Example: &#x60;/v1/payin_methods/9d4d7b73-a94c-4979-ab57-09074fd55d33/retry&#x60;
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(PayinMethodResponse, Fixnum, Hash)>] PayinMethodResponse data, response status code and response headers
209
+ def retry_payin_method_with_http_info(payin_method_id, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug 'Calling API: PayinMethodsApi.retry_payin_method ...'
212
+ end
213
+ # verify the required parameter 'payin_method_id' is set
214
+ if @api_client.config.client_side_validation && payin_method_id.nil?
215
+ fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.retry_payin_method"
216
+ end
217
+ # resource path
218
+ local_var_path = '/payin_methods/{PayinMethod ID}/retry'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)
219
+
220
+ # query parameters
221
+ query_params = {}
222
+
223
+ # header parameters
224
+ header_params = {}
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
227
+
228
+ # form parameters
229
+ form_params = {}
230
+
231
+ # http body (model)
232
+ post_body = nil
233
+ auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
234
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => 'PayinMethodResponse')
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: PayinMethodsApi#retry_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+ end
247
+ 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.18.0"
38
+ @user_agent = "TransferZero-SDK/Ruby/1.19.2"
39
39
  @default_headers = {
40
40
  'Content-Type' => 'application/json',
41
41
  'User-Agent' => @user_agent
@@ -50,6 +50,9 @@ class Document
50
50
  # Document expiry date issued by government
51
51
  attr_accessor :expiry_date
52
52
 
53
+ # Determines the document's source. Default value \"Manual\"
54
+ attr_accessor :source
55
+
53
56
  # The fields that have some problems and don't pass validation
54
57
  attr_accessor :errors
55
58
 
@@ -91,6 +94,7 @@ class Document
91
94
  :'id' => :'id',
92
95
  :'document_id' => :'document_id',
93
96
  :'expiry_date' => :'expiry_date',
97
+ :'source' => :'source',
94
98
  :'errors' => :'errors'
95
99
  }
96
100
  end
@@ -111,6 +115,7 @@ class Document
111
115
  :'id' => :'String',
112
116
  :'document_id' => :'String',
113
117
  :'expiry_date' => :'Date',
118
+ :'source' => :'String',
114
119
  :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
115
120
  }
116
121
  end
@@ -182,6 +187,10 @@ class Document
182
187
  self.expiry_date = attributes[:'expiry_date']
183
188
  end
184
189
 
190
+ if attributes.key?(:'source')
191
+ self.source = attributes[:'source']
192
+ end
193
+
185
194
  if attributes.key?(:'errors')
186
195
  if (value = attributes[:'errors']).is_a?(Hash)
187
196
  self.errors = value
@@ -242,6 +251,7 @@ class Document
242
251
  id == o.id &&
243
252
  document_id == o.document_id &&
244
253
  expiry_date == o.expiry_date &&
254
+ source == o.source &&
245
255
  errors == o.errors
246
256
  end
247
257
 
@@ -254,7 +264,7 @@ class Document
254
264
  # Calculates hash code according to all attributes.
255
265
  # @return [Integer] Hash code
256
266
  def 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
267
+ [upload, url, upload_file_name, metadata, upload_content_type, upload_file_size, category, side, document_type, issuing_country, id, document_id, expiry_date, source, errors].hash
258
268
  end
259
269
 
260
270
  require 'active_support/core_ext/hash'
@@ -15,28 +15,40 @@ require 'date'
15
15
  module TransferZero
16
16
  # This describes the specific details on how the funds should be collected from the sender.
17
17
  class PayinMethod
18
- # Describes how the payment should be requested from the user. Possible values: - `NGN::Bank`: NGN bank and card collection requests - `NGN::Mobile`: NGN mobile collections - `GHS::Mobile`: GHS mobile collections - `TZS::Mobile`: TZS mobile collections - `UGX::Mobile`: UGX mobile collections - `EUR::Bank`: EUR IBAN collections - `GBP::Bank`: GBP IBAN collections
18
+ # Describes how the payment should be requested from the sender. Possible values: - `GHS::Mobile`: GHS mobile collections - `UGX::Mobile`: UGX mobile collections - `EUR::Bank`: EUR IBAN collections - `GBP::Bank`: GBP IBAN collections
19
19
  attr_accessor :type
20
20
 
21
+ attr_accessor :ux_flow
22
+
21
23
  attr_accessor :in_details
22
24
 
25
+ attr_accessor :id
26
+
27
+ attr_accessor :state
28
+
29
+ attr_accessor :state_reason_details
30
+
23
31
  # This will contain the description on where to pay the funds. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on what to expect here.
24
32
  attr_accessor :out_details
25
33
 
26
34
  # This will contain the instructions on how to pay the funds. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on what to expect here.
27
35
  attr_accessor :instructions
28
36
 
29
- # Describes which provider to use for collection. Please see the [Collections Details](https://docs.transferzero.com/docs/collection-details) in the API documentation on the valid values
30
- attr_accessor :provider
37
+ # The fields that have some problems and don't pass validation
38
+ attr_accessor :errors
31
39
 
32
40
  # Attribute mapping from ruby-style variable name to JSON key.
33
41
  def self.attribute_map
34
42
  {
35
43
  :'type' => :'type',
44
+ :'ux_flow' => :'ux_flow',
36
45
  :'in_details' => :'in_details',
46
+ :'id' => :'id',
47
+ :'state' => :'state',
48
+ :'state_reason_details' => :'state_reason_details',
37
49
  :'out_details' => :'out_details',
38
50
  :'instructions' => :'instructions',
39
- :'provider' => :'provider'
51
+ :'errors' => :'errors'
40
52
  }
41
53
  end
42
54
 
@@ -44,10 +56,14 @@ class PayinMethod
44
56
  def self.openapi_types
45
57
  {
46
58
  :'type' => :'String',
59
+ :'ux_flow' => :'PayinMethodUxFlow',
47
60
  :'in_details' => :'PayinMethodDetails',
61
+ :'id' => :'String',
62
+ :'state' => :'PayinMethodState',
63
+ :'state_reason_details' => :'StateReasonDetails',
48
64
  :'out_details' => :'Object',
49
65
  :'instructions' => :'Object',
50
- :'provider' => :'String'
66
+ :'errors' => :'Hash<String, Array<ValidationErrorDescription>>'
51
67
  }
52
68
  end
53
69
 
@@ -70,10 +86,26 @@ class PayinMethod
70
86
  self.type = attributes[:'type']
71
87
  end
72
88
 
89
+ if attributes.key?(:'ux_flow')
90
+ self.ux_flow = attributes[:'ux_flow']
91
+ end
92
+
73
93
  if attributes.key?(:'in_details')
74
94
  self.in_details = attributes[:'in_details']
75
95
  end
76
96
 
97
+ if attributes.key?(:'id')
98
+ self.id = attributes[:'id']
99
+ end
100
+
101
+ if attributes.key?(:'state')
102
+ self.state = attributes[:'state']
103
+ end
104
+
105
+ if attributes.key?(:'state_reason_details')
106
+ self.state_reason_details = attributes[:'state_reason_details']
107
+ end
108
+
77
109
  if attributes.key?(:'out_details')
78
110
  self.out_details = attributes[:'out_details']
79
111
  end
@@ -82,8 +114,10 @@ class PayinMethod
82
114
  self.instructions = attributes[:'instructions']
83
115
  end
84
116
 
85
- if attributes.key?(:'provider')
86
- self.provider = attributes[:'provider']
117
+ if attributes.key?(:'errors')
118
+ if (value = attributes[:'errors']).is_a?(Hash)
119
+ self.errors = value
120
+ end
87
121
  end
88
122
  end
89
123
 
@@ -106,10 +140,14 @@ class PayinMethod
106
140
  return true if self.equal?(o)
107
141
  self.class == o.class &&
108
142
  type == o.type &&
143
+ ux_flow == o.ux_flow &&
109
144
  in_details == o.in_details &&
145
+ id == o.id &&
146
+ state == o.state &&
147
+ state_reason_details == o.state_reason_details &&
110
148
  out_details == o.out_details &&
111
149
  instructions == o.instructions &&
112
- provider == o.provider
150
+ errors == o.errors
113
151
  end
114
152
 
115
153
  # @see the `==` method
@@ -121,7 +159,7 @@ class PayinMethod
121
159
  # Calculates hash code according to all attributes.
122
160
  # @return [Integer] Hash code
123
161
  def hash
124
- [type, in_details, out_details, instructions, provider].hash
162
+ [type, ux_flow, in_details, id, state, state_reason_details, out_details, instructions, errors].hash
125
163
  end
126
164
 
127
165
  require 'active_support/core_ext/hash'
@@ -15,17 +15,19 @@ require 'date'
15
15
  module TransferZero
16
16
  # Fields needed by the payment processor. Depends on the chose payin type. See the appropriate model details for more info: - `NGN::Bank`: see [`PayinMethodDetailsNGNBank`](#model-PayinMethodDetailsNGNBank) - `GHS::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) - `UGX::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) - `TZS::Mobile`: see [`PayinMethodDetailsMobile`](#model-PayinMethodDetailsMobile) Note that some payin processors don't require additional input, these include `paga` through `NGN::Mobile`, `lhv` through `EUR::Bank` and `GBP::Bank`. Some providers like `providus` also have all of their fields set as optional, so you might not want to set any values. To use these providers please set this value to `{}` (an empty hash)
17
17
  class PayinMethodDetails
18
- # The payment method which the user will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
18
+ # The payment method which the sender will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
19
19
  attr_accessor :payment_method
20
20
 
21
- # This is where the user should be redirected back when the payment has been finished
21
+ # This is where the sender should be redirected back when the payment has been finished
22
22
  attr_accessor :redirect_url
23
23
 
24
24
  # The phone number where the funds should be collected from
25
25
  attr_accessor :phone_number
26
26
 
27
- # States whether to send out the instructions to the phone number on how to pay the funds or not. This shuold always be set to true, otherwise the sender might not receive a prompt for payment.
28
- attr_accessor :send_instructions
27
+ attr_accessor :mobile_provider
28
+
29
+ # The OTP that the sender received in otp verified ussd popup ux flow.
30
+ attr_accessor :otp
29
31
 
30
32
  # Please make sure the refund_address is a valid BTC address belonging to the sender, as that is going to be used in case the transaction has to be refunded.
31
33
  attr_accessor :refund_address
@@ -36,7 +38,8 @@ class PayinMethodDetails
36
38
  :'payment_method' => :'payment_method',
37
39
  :'redirect_url' => :'redirect_url',
38
40
  :'phone_number' => :'phone_number',
39
- :'send_instructions' => :'send_instructions',
41
+ :'mobile_provider' => :'mobile_provider',
42
+ :'otp' => :'otp',
40
43
  :'refund_address' => :'refund_address'
41
44
  }
42
45
  end
@@ -47,7 +50,8 @@ class PayinMethodDetails
47
50
  :'payment_method' => :'String',
48
51
  :'redirect_url' => :'String',
49
52
  :'phone_number' => :'String',
50
- :'send_instructions' => :'Boolean',
53
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
54
+ :'otp' => :'String',
51
55
  :'refund_address' => :'String'
52
56
  }
53
57
  end
@@ -88,8 +92,12 @@ class PayinMethodDetails
88
92
  self.phone_number = attributes[:'phone_number']
89
93
  end
90
94
 
91
- if attributes.key?(:'send_instructions')
92
- self.send_instructions = attributes[:'send_instructions']
95
+ if attributes.key?(:'mobile_provider')
96
+ self.mobile_provider = attributes[:'mobile_provider']
97
+ end
98
+
99
+ if attributes.key?(:'otp')
100
+ self.otp = attributes[:'otp']
93
101
  end
94
102
 
95
103
  if attributes.key?(:'refund_address')
@@ -101,17 +109,12 @@ class PayinMethodDetails
101
109
  # @return Array for valid properties with the reasons
102
110
  def list_invalid_properties
103
111
  invalid_properties = Array.new
104
- if @phone_number.nil?
105
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
106
- end
107
-
108
112
  invalid_properties
109
113
  end
110
114
 
111
115
  # Check to see if the all the properties in the model are valid
112
116
  # @return true if the model is valid
113
117
  def valid?
114
- return false if @phone_number.nil?
115
118
  _one_of_found = false
116
119
  openapi_one_of.each do |_class|
117
120
  _one_of = TransferZero.const_get(_class).build_from_hash(self.to_hash)
@@ -139,7 +142,8 @@ class PayinMethodDetails
139
142
  payment_method == o.payment_method &&
140
143
  redirect_url == o.redirect_url &&
141
144
  phone_number == o.phone_number &&
142
- send_instructions == o.send_instructions &&
145
+ mobile_provider == o.mobile_provider &&
146
+ otp == o.otp &&
143
147
  refund_address == o.refund_address
144
148
  end
145
149
 
@@ -152,7 +156,7 @@ class PayinMethodDetails
152
156
  # Calculates hash code according to all attributes.
153
157
  # @return [Integer] Hash code
154
158
  def hash
155
- [payment_method, redirect_url, phone_number, send_instructions, refund_address].hash
159
+ [payment_method, redirect_url, phone_number, mobile_provider, otp, refund_address].hash
156
160
  end
157
161
 
158
162
  require 'active_support/core_ext/hash'
@@ -13,19 +13,22 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # ```JSON \"details\": { \"phone_number\": \"+2569999999\", \"send_instructions\": true } ```
16
+ # ```JSON \"details\": { \"phone_number\": \"+2569999999\", } ```
17
17
  class PayinMethodDetailsMobile
18
18
  # The phone number where the funds should be collected from
19
19
  attr_accessor :phone_number
20
20
 
21
- # States whether to send out the instructions to the phone number on how to pay the funds or not. This shuold always be set to true, otherwise the sender might not receive a prompt for payment.
22
- attr_accessor :send_instructions
21
+ attr_accessor :mobile_provider
22
+
23
+ # The OTP that the sender received in otp verified ussd popup ux flow.
24
+ attr_accessor :otp
23
25
 
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'phone_number' => :'phone_number',
28
- :'send_instructions' => :'send_instructions'
30
+ :'mobile_provider' => :'mobile_provider',
31
+ :'otp' => :'otp'
29
32
  }
30
33
  end
31
34
 
@@ -33,7 +36,8 @@ class PayinMethodDetailsMobile
33
36
  def self.openapi_types
34
37
  {
35
38
  :'phone_number' => :'String',
36
- :'send_instructions' => :'Boolean'
39
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
40
+ :'otp' => :'String'
37
41
  }
38
42
  end
39
43
 
@@ -56,8 +60,12 @@ class PayinMethodDetailsMobile
56
60
  self.phone_number = attributes[:'phone_number']
57
61
  end
58
62
 
59
- if attributes.key?(:'send_instructions')
60
- self.send_instructions = attributes[:'send_instructions']
63
+ if attributes.key?(:'mobile_provider')
64
+ self.mobile_provider = attributes[:'mobile_provider']
65
+ end
66
+
67
+ if attributes.key?(:'otp')
68
+ self.otp = attributes[:'otp']
61
69
  end
62
70
  end
63
71
 
@@ -65,17 +73,12 @@ class PayinMethodDetailsMobile
65
73
  # @return Array for valid properties with the reasons
66
74
  def list_invalid_properties
67
75
  invalid_properties = Array.new
68
- if @phone_number.nil?
69
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
70
- end
71
-
72
76
  invalid_properties
73
77
  end
74
78
 
75
79
  # Check to see if the all the properties in the model are valid
76
80
  # @return true if the model is valid
77
81
  def valid?
78
- return false if @phone_number.nil?
79
82
  true
80
83
  end
81
84
 
@@ -85,7 +88,8 @@ class PayinMethodDetailsMobile
85
88
  return true if self.equal?(o)
86
89
  self.class == o.class &&
87
90
  phone_number == o.phone_number &&
88
- send_instructions == o.send_instructions
91
+ mobile_provider == o.mobile_provider &&
92
+ otp == o.otp
89
93
  end
90
94
 
91
95
  # @see the `==` method
@@ -97,7 +101,7 @@ class PayinMethodDetailsMobile
97
101
  # Calculates hash code according to all attributes.
98
102
  # @return [Integer] Hash code
99
103
  def hash
100
- [phone_number, send_instructions].hash
104
+ [phone_number, mobile_provider, otp].hash
101
105
  end
102
106
 
103
107
  require 'active_support/core_ext/hash'
@@ -15,10 +15,10 @@ require 'date'
15
15
  module TransferZero
16
16
  # ```JSON \"details\": { \"redirect_url\": \"http://redirect.back.to\" } ```
17
17
  class PayinMethodDetailsNGNBank
18
- # The payment method which the user will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
18
+ # The payment method which the sender will use to make the payments. Options are `bank`, `card` or you can leave empty to support both.
19
19
  attr_accessor :payment_method
20
20
 
21
- # This is where the user should be redirected back when the payment has been finished
21
+ # This is where the sender should be redirected back when the payment has been finished
22
22
  attr_accessor :redirect_url
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.