Class: Yapstone::PaymentsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentsApi



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

def api_client
  @api_client
end

Instance Method Details

#cancel_payment(authorization, x_yapstone_ip_address, payment_id, opts = {}) ⇒ PaymentCancelResponse

Cancel Payment by payment Id Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment.

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



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

def cancel_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end

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

Cancel Payment by payment Id Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment.

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



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
101
102
# File 'lib/yapstone-payments/api/payments_api.rb', line 45

def cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_payment ...'
  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 PaymentsApi.cancel_payment"
  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 PaymentsApi.cancel_payment"
  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 PaymentsApi.cancel_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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?
  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] || 'PaymentCancelResponse' 

  # 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: PaymentsApi#cancel_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {}) ⇒ PaymentCancelTransactionResponse

Cancel Transaction by TransactionId Use a transaction identifier to cancel a transaction.

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



113
114
115
116
# File 'lib/yapstone-payments/api/payments_api.rb', line 113

def cancel_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
  data
end

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

Cancel Transaction by TransactionId Use a transaction identifier to cancel a transaction.

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



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/payments_api.rb', line 127

def cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_transaction ...'
  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 PaymentsApi.cancel_transaction"
  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 PaymentsApi.cancel_transaction"
  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 PaymentsApi.cancel_transaction"
  end
  # resource path
  local_var_path = '/v2/payments/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?
  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] || 'PaymentCancelTransactionResponse' 

  # 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: PaymentsApi#cancel_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#capture_payment(authorization, x_yapstone_ip_address, payment_id, opts = {}) ⇒ PaymentResponse

Capture a prior authorized payment Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer’s account to the merchant’s account.

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

  • :capture_payment_request (CapturePaymentRequest)


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

def capture_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end

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

Capture a prior authorized payment Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer&#39;s account to the merchant&#39;s account.

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

  • :capture_payment_request (CapturePaymentRequest)


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
269
270
# File 'lib/yapstone-payments/api/payments_api.rb', line 211

def capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.capture_payment ...'
  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 PaymentsApi.capture_payment"
  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 PaymentsApi.capture_payment"
  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 PaymentsApi.capture_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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'])
  # 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(opts[:'capture_payment_request']) 

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

  # 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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#capture_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_payment(authorization, x_yapstone_ip_address, process_payment, opts = {}) ⇒ PaymentResponse

Process Payment The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from.

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)

    A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment.



281
282
283
284
# File 'lib/yapstone-payments/api/payments_api.rb', line 281

def create_payment(authorization, x_yapstone_ip_address, process_payment, opts = {})
  data, _status_code, _headers = create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts)
  data
end

#create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts = {}) ⇒ Array<(PaymentResponse, Integer, Hash)>

Process Payment The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from.

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)

    A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment.



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
348
349
350
351
352
353
354
# File 'lib/yapstone-payments/api/payments_api.rb', line 295

def create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
  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 PaymentsApi.create_payment"
  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 PaymentsApi.create_payment"
  end
  # verify the required parameter 'process_payment' is set
  if @api_client.config.client_side_validation && process_payment.nil?
    fail ArgumentError, "Missing the required parameter 'process_payment' when calling PaymentsApi.create_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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(process_payment) 

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

  # 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: PaymentsApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payment(authorization, x_yapstone_ip_address, payment_id, opts = {}) ⇒ PaymentResponse

Get with Payment Id This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response.

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.



364
365
366
367
# File 'lib/yapstone-payments/api/payments_api.rb', line 364

def get_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end

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

Get with Payment Id This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response.

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.



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
427
428
429
430
431
432
433
# File 'lib/yapstone-payments/api/payments_api.rb', line 377

def get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
  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 PaymentsApi.get_payment"
  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 PaymentsApi.get_payment"
  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 PaymentsApi.get_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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] || 'PaymentResponse' 

  # 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: PaymentsApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {}) ⇒ OrderTransactions

Get Transaction by Transaction Id Retrieve information about a specific transaction.

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.



443
444
445
446
# File 'lib/yapstone-payments/api/payments_api.rb', line 443

def get_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
  data
end

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

Get Transaction by Transaction Id Retrieve information about a specific transaction.

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.



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
506
507
508
509
510
511
512
# File 'lib/yapstone-payments/api/payments_api.rb', line 456

def get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_transaction ...'
  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 PaymentsApi.get_transaction"
  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 PaymentsApi.get_transaction"
  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 PaymentsApi.get_transaction"
  end
  # resource path
  local_var_path = '/v2/payments/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] || 'OrderTransactions' 

  # 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: PaymentsApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#verify_payment_instrument(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {}) ⇒ InstrumentVerificationResponse

Verify payment instrument Use this endpoint to verify that a customer’s payment instrument is valid and associated with them.

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



523
524
525
526
# File 'lib/yapstone-payments/api/payments_api.rb', line 523

def verify_payment_instrument(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
  data, _status_code, _headers = verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts)
  data
end

#verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {}) ⇒ Array<(InstrumentVerificationResponse, Integer, Hash)>

Verify payment instrument Use this endpoint to verify that a customer&#39;s payment instrument is valid and associated with them.

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



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/yapstone-payments/api/payments_api.rb', line 537

def verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.verify_payment_instrument ...'
  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 PaymentsApi.verify_payment_instrument"
  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 PaymentsApi.verify_payment_instrument"
  end
  # verify the required parameter 'verify_instrument_request' is set
  if @api_client.config.client_side_validation && verify_instrument_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_instrument_request' when calling PaymentsApi.verify_payment_instrument"
  end
  # resource path
  local_var_path = '/v2/payments/instrument/verify'

  # 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(verify_instrument_request) 

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

  # 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: PaymentsApi#verify_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end