Class: TransferZero::PayinMethodsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/transferzero-sdk/api/payin_methods_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PayinMethodsApi

Returns a new instance of PayinMethodsApi.



19
20
21
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_payin_method(payin_method_id, opts = {}) ⇒ PayinMethodResponse

Deleting a payin method Initiates a cancellation request for the specified payin method

Parameters:

  • payin_method_id

    ID of the payin method to delete. Example: `/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670`

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 29

def delete_payin_method(payin_method_id, opts = {})
  data, _status_code, _headers = delete_payin_method_with_http_info(payin_method_id, opts)
  data
end

#delete_payin_method_with_http_info(payin_method_id, opts = {}) ⇒ Array<(PayinMethodResponse, Fixnum, Hash)>

Deleting a payin method Initiates a cancellation request for the specified payin method

Parameters:

  • payin_method_id

    ID of the payin method to delete. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PayinMethodResponse, Fixnum, Hash)>)

    PayinMethodResponse data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 39

def delete_payin_method_with_http_info(payin_method_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinMethodsApi.delete_payin_method ...'
  end
  # verify the required parameter 'payin_method_id' is set
  if @api_client.config.client_side_validation && payin_method_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.delete_payin_method"
  end
  # resource path
  local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayinMethodResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinMethodsApi#delete_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payin_method(payin_method_id, opts = {}) ⇒ PayinMethodResponse

Fetching a payin method Show a payin method by id

Parameters:

  • payin_method_id

    ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



83
84
85
86
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 83

def get_payin_method(payin_method_id, opts = {})
  data, _status_code, _headers = get_payin_method_with_http_info(payin_method_id, opts)
  data
end

#get_payin_method_with_http_info(payin_method_id, opts = {}) ⇒ Array<(PayinMethodResponse, Fixnum, Hash)>

Fetching a payin method Show a payin method by id

Parameters:

  • payin_method_id

    ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PayinMethodResponse, Fixnum, Hash)>)

    PayinMethodResponse data, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 93

def get_payin_method_with_http_info(payin_method_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinMethodsApi.get_payin_method ...'
  end
  # verify the required parameter 'payin_method_id' is set
  if @api_client.config.client_side_validation && payin_method_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.get_payin_method"
  end
  # resource path
  local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayinMethodResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinMethodsApi#get_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_payin_method(payin_method_id, payin_method, opts = {}) ⇒ PayinMethodResponse

Updating a payin method Updates a single payin method by the Payin Method ID

Parameters:

  • payin_method_id

    ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • payin_method
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



138
139
140
141
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 138

def patch_payin_method(payin_method_id, payin_method, opts = {})
  data, _status_code, _headers = patch_payin_method_with_http_info(payin_method_id, payin_method, opts)
  data
end

#patch_payin_method_with_http_info(payin_method_id, payin_method, opts = {}) ⇒ Array<(PayinMethodResponse, Fixnum, Hash)>

Updating a payin method Updates a single payin method by the Payin Method ID

Parameters:

  • payin_method_id

    ID of the payin method to get. Example: &#x60;/v1/payin_methods/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • payin_method
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PayinMethodResponse, Fixnum, Hash)>)

    PayinMethodResponse data, response status code and response headers



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 149

def patch_payin_method_with_http_info(payin_method_id, payin_method, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinMethodsApi.patch_payin_method ...'
  end
  # verify the required parameter 'payin_method_id' is set
  if @api_client.config.client_side_validation && payin_method_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.patch_payin_method"
  end
  # verify the required parameter 'payin_method' is set
  if @api_client.config.client_side_validation && payin_method.nil?
    fail ArgumentError, "Missing the required parameter 'payin_method' when calling PayinMethodsApi.patch_payin_method"
  end
  # resource path
  local_var_path = '/payin_methods/{PayinMethod ID}'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payin_method)
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayinMethodResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinMethodsApi#patch_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retry_payin_method(payin_method_id, opts = {}) ⇒ PayinMethodResponse

Retries PayinMethod Retries the collection process for the payin method. Please note only payin methods in ‘error` state can be retried.

Parameters:

  • 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;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



199
200
201
202
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 199

def retry_payin_method(payin_method_id, opts = {})
  data, _status_code, _headers = retry_payin_method_with_http_info(payin_method_id, opts)
  data
end

#retry_payin_method_with_http_info(payin_method_id, opts = {}) ⇒ Array<(PayinMethodResponse, Fixnum, Hash)>

Retries PayinMethod Retries the collection process for the payin method. Please note only payin methods in &#x60;error&#x60; state can be retried.

Parameters:

  • 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;

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PayinMethodResponse, Fixnum, Hash)>)

    PayinMethodResponse data, response status code and response headers



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/transferzero-sdk/api/payin_methods_api.rb', line 209

def retry_payin_method_with_http_info(payin_method_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinMethodsApi.retry_payin_method ...'
  end
  # verify the required parameter 'payin_method_id' is set
  if @api_client.config.client_side_validation && payin_method_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_method_id' when calling PayinMethodsApi.retry_payin_method"
  end
  # resource path
  local_var_path = '/payin_methods/{PayinMethod ID}/retry'.sub('{' + 'PayinMethod ID' + '}', payin_method_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayinMethodResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinMethodsApi#retry_payin_method\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end