Class: Yapstone::RefundsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/yapstone-payments/api/refunds_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RefundsApi

Returns a new instance of RefundsApi.



19
20
21
# File 'lib/yapstone-payments/api/refunds_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/yapstone-payments/api/refunds_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#cancel_refund(authorization, x_yapstone_ip_address, refund_id, opts = {}) ⇒ RefundCancelResponse

Cancel Payment by payment Id

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    Ip Address of the client

  • refund_id (String)

    refundId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    X-Yapstone-Trace-Id

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:



30
31
32
33
# File 'lib/yapstone-payments/api/refunds_api.rb', line 30

def cancel_refund(authorization, x_yapstone_ip_address, refund_id, opts = {})
  data, _status_code, _headers = cancel_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts)
  data
end

#cancel_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts = {}) ⇒ Array<(RefundCancelResponse, Integer, Hash)>

Cancel Payment by payment Id

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    Ip Address of the client

  • refund_id (String)

    refundId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    X-Yapstone-Trace-Id

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:

  • (Array<(RefundCancelResponse, Integer, Hash)>)

    RefundCancelResponse data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/yapstone-payments/api/refunds_api.rb', line 43

def cancel_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.cancel_refund ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.cancel_refund"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.cancel_refund"
  end
  # verify the required parameter 'refund_id' is set
  if @api_client.config.client_side_validation && refund_id.nil?
    fail ArgumentError, "Missing the required parameter 'refund_id' when calling RefundsApi.cancel_refund"
  end
  # resource path
  local_var_path = '/v2/refunds/refund/{refundId}'.sub('{' + 'refundId' + '}', CGI.escape(refund_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'RefundCancelResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#cancel_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_payment_refund(authorization, x_yapstone_ip_address, refund_request, opts = {}) ⇒ RefundResponse

Create a refund Create a refund for a payment that was processed

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:



111
112
113
114
# File 'lib/yapstone-payments/api/refunds_api.rb', line 111

def create_payment_refund(authorization, x_yapstone_ip_address, refund_request, opts = {})
  data, _status_code, _headers = create_payment_refund_with_http_info(authorization, x_yapstone_ip_address, refund_request, opts)
  data
end

#create_payment_refund_with_http_info(authorization, x_yapstone_ip_address, refund_request, opts = {}) ⇒ Array<(RefundResponse, Integer, Hash)>

Create a refund Create a refund for a payment that was processed

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:

  • (Array<(RefundResponse, Integer, Hash)>)

    RefundResponse data, response status code and response headers



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
# File 'lib/yapstone-payments/api/refunds_api.rb', line 125

def create_payment_refund_with_http_info(authorization, x_yapstone_ip_address, refund_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.create_payment_refund ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.create_payment_refund"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.create_payment_refund"
  end
  # verify the required parameter 'refund_request' is set
  if @api_client.config.client_side_validation && refund_request.nil?
    fail ArgumentError, "Missing the required parameter 'refund_request' when calling RefundsApi.create_payment_refund"
  end
  # resource path
  local_var_path = '/v2/refunds/payment'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(refund_request) 

  # return_type
  return_type = opts[:return_type] || 'RefundResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#create_payment_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_transaction_refund(authorization, x_yapstone_ip_address, transaction, opts = {}) ⇒ RefundResponse

Create a refund Use this end point to kick off a refund for transaction. If you’ve already captured the transaction, this will result in a refund of the amount captured and the details of that refund will be returned in the response body.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:



195
196
197
198
# File 'lib/yapstone-payments/api/refunds_api.rb', line 195

def create_transaction_refund(authorization, x_yapstone_ip_address, transaction, opts = {})
  data, _status_code, _headers = create_transaction_refund_with_http_info(authorization, x_yapstone_ip_address, transaction, opts)
  data
end

#create_transaction_refund_with_http_info(authorization, x_yapstone_ip_address, transaction, opts = {}) ⇒ Array<(RefundResponse, Integer, Hash)>

Create a refund Use this end point to kick off a refund for transaction. If you&#39;ve already captured the transaction, this will result in a refund of the amount captured and the details of that refund will be returned in the response body.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

  • :x_yapstone_fpsid (String)

    Device Finger Print Id

Returns:

  • (Array<(RefundResponse, Integer, Hash)>)

    RefundResponse 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/yapstone-payments/api/refunds_api.rb', line 209

def create_transaction_refund_with_http_info(authorization, x_yapstone_ip_address, transaction, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.create_transaction_refund ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.create_transaction_refund"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.create_transaction_refund"
  end
  # verify the required parameter 'transaction' is set
  if @api_client.config.client_side_validation && transaction.nil?
    fail ArgumentError, "Missing the required parameter 'transaction' when calling RefundsApi.create_transaction_refund"
  end
  # resource path
  local_var_path = '/v2/refunds/transaction'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(transaction) 

  # return_type
  return_type = opts[:return_type] || 'RefundResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#create_transaction_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_originaltransaction_id(authorization, x_yapstone_ip_address, transaction_id, opts = {}) ⇒ TransactionResponse

Get master Transaction details including all refund details by transaction Id Transactions are nested inside payments. Master transactions are nested inside the master payment.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • transaction_id (String)

    transactionId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:



278
279
280
281
# File 'lib/yapstone-payments/api/refunds_api.rb', line 278

def get_by_originaltransaction_id(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = get_by_originaltransaction_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
  data
end

#get_by_originaltransaction_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Integer, Hash)>

Get master Transaction details including all refund details by transaction Id Transactions are nested inside payments. Master transactions are nested inside the master payment.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • transaction_id (String)

    transactionId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:

  • (Array<(TransactionResponse, Integer, Hash)>)

    TransactionResponse data, response status code and response headers



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/yapstone-payments/api/refunds_api.rb', line 291

def get_by_originaltransaction_id_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.get_by_originaltransaction_id ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.get_by_originaltransaction_id"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.get_by_originaltransaction_id"
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling RefundsApi.get_by_originaltransaction_id"
  end
  # resource path
  local_var_path = '/v2/refunds/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'TransactionResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#get_by_originaltransaction_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_refund(authorization, x_yapstone_ip_address, refund_id, opts = {}) ⇒ RefundResponse

Get master payment details including all refund detail by refund ID. A master payment is the initial payment that all other payment details and transactions tied to that payment connect to. You can use a refund ID to retrieve master payment information.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • refund_id (String)

    refundId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:



357
358
359
360
# File 'lib/yapstone-payments/api/refunds_api.rb', line 357

def get_refund(authorization, x_yapstone_ip_address, refund_id, opts = {})
  data, _status_code, _headers = get_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts)
  data
end

#get_refund_by_payment_id(authorization, x_yapstone_ip_address, payment_id, opts = {}) ⇒ RefundResponse

Get master payment details including all refund details by Payment Id. A master payment is the initial payment that all other payment details and transactions tied to that payment connect to.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • payment_id (String)

    paymentId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:



436
437
438
439
# File 'lib/yapstone-payments/api/refunds_api.rb', line 436

def get_refund_by_payment_id(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = get_refund_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end

#get_refund_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {}) ⇒ Array<(RefundResponse, Integer, Hash)>

Get master payment details including all refund details by Payment Id. A master payment is the initial payment that all other payment details and transactions tied to that payment connect to.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • payment_id (String)

    paymentId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:

  • (Array<(RefundResponse, Integer, Hash)>)

    RefundResponse data, response status code and response headers



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# File 'lib/yapstone-payments/api/refunds_api.rb', line 449

def get_refund_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.get_refund_by_payment_id ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.get_refund_by_payment_id"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.get_refund_by_payment_id"
  end
  # verify the required parameter 'payment_id' is set
  if @api_client.config.client_side_validation && payment_id.nil?
    fail ArgumentError, "Missing the required parameter 'payment_id' when calling RefundsApi.get_refund_by_payment_id"
  end
  # resource path
  local_var_path = '/v2/refunds/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'RefundResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#get_refund_by_payment_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts = {}) ⇒ Array<(RefundResponse, Integer, Hash)>

Get master payment details including all refund detail by refund ID. A master payment is the initial payment that all other payment details and transactions tied to that payment connect to. You can use a refund ID to retrieve master payment information.

Parameters:

  • authorization (String)

    Authorization

  • x_yapstone_ip_address (String)

    IP Address of the client

  • refund_id (String)

    refundId

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

    the optional parameters

Options Hash (opts):

  • :x_yapstone_trace_id (String)

    Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string.

Returns:

  • (Array<(RefundResponse, Integer, Hash)>)

    RefundResponse data, response status code and response headers



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/yapstone-payments/api/refunds_api.rb', line 370

def get_refund_with_http_info(authorization, x_yapstone_ip_address, refund_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RefundsApi.get_refund ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling RefundsApi.get_refund"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling RefundsApi.get_refund"
  end
  # verify the required parameter 'refund_id' is set
  if @api_client.config.client_side_validation && refund_id.nil?
    fail ArgumentError, "Missing the required parameter 'refund_id' when calling RefundsApi.get_refund"
  end
  # resource path
  local_var_path = '/v2/refunds/refund/{refundId}'.sub('{' + 'refundId' + '}', CGI.escape(refund_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'RefundResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RefundsApi#get_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end