Class: SwaggerClient::PaymentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/payment_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentApi

Returns a new instance of PaymentApi.



19
20
21
# File 'lib/swagger_client/api/payment_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/swagger_client/api/payment_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#perform_payment_post_authorisation(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {}) ⇒ TransactionResponse

Use this to capture/complete a transaction. Partial postauths are allowed. This can be used for postauth and partial postauths.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:



35
36
37
38
# File 'lib/swagger_client/api/payment_api.rb', line 35

def (content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
  data, _status_code, _headers = (content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts)
  return data
end

#perform_payment_post_authorisation_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>

Use this to capture/complete a transaction. Partial postauths are allowed. This can be used for postauth and partial postauths.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:

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

    TransactionResponse data, response status code and response headers



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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/swagger_client/api/payment_api.rb', line 52

def (content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.perform_payment_post_authorisation ..."
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.perform_payment_post_authorisation"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
    fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.perform_payment_post_authorisation"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.perform_payment_post_authorisation"
  end
  # verify the required parameter 'timestamp' is set
  if @api_client.config.client_side_validation && timestamp.nil?
    fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.perform_payment_post_authorisation"
  end
  # verify the required parameter 'message_signature' is set
  if @api_client.config.client_side_validation && message_signature.nil?
    fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.perform_payment_post_authorisation"
  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 PaymentApi.perform_payment_post_authorisation"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.perform_payment_post_authorisation"
  end
  # resource path
  local_var_path = "/v1/payments/{transaction-id}/postauth".sub('{' + 'transaction-id' + '}', transaction_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?

  # 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'] = content_type
  header_params[:'Client-Request-Id'] = client_request_id
  header_params[:'Api-Key'] = api_key
  header_params[:'Timestamp'] = timestamp
  header_params[:'Message-Signature'] = message_signature

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = []
  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 => 'TransactionResponse',
    :error_type => 'TransactionErrorResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#perform_payment_post_authorisation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#primary_payment_transaction(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {}) ⇒ TransactionResponse

Generate a primary transaction Use this to originate a financial transaction, like a sale, preauthorization, or credit.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • payload

    Primary Transaction request

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

    the optional parameters

Returns:



136
137
138
139
# File 'lib/swagger_client/api/payment_api.rb', line 136

def primary_payment_transaction(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {})
  data, _status_code, _headers = primary_payment_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts)
  return data
end

#primary_payment_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>

Generate a primary transaction Use this to originate a financial transaction, like a sale, preauthorization, or credit.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • payload

    Primary Transaction request

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

    the optional parameters

Returns:

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

    TransactionResponse data, response status code and response headers



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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/swagger_client/api/payment_api.rb', line 151

def primary_payment_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.primary_payment_transaction ..."
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.primary_payment_transaction"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
    fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.primary_payment_transaction"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.primary_payment_transaction"
  end
  # verify the required parameter 'timestamp' is set
  if @api_client.config.client_side_validation && timestamp.nil?
    fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.primary_payment_transaction"
  end
  # verify the required parameter 'message_signature' is set
  if @api_client.config.client_side_validation && message_signature.nil?
    fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.primary_payment_transaction"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.primary_payment_transaction"
  end
  # resource path
  local_var_path = "/v1/payments"

  # 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'] = content_type
  header_params[:'Client-Request-Id'] = client_request_id
  header_params[:'Api-Key'] = api_key
  header_params[:'Timestamp'] = timestamp
  header_params[:'Message-Signature'] = message_signature

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = []
  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 => 'TransactionResponse',
    :error_type => 'TransactionErrorResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#primary_payment_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#return_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {}) ⇒ TransactionResponse

Return/refund a transaction. Use this to return/refund an existing transaction. Partial returns are allowed.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:



232
233
234
235
# File 'lib/swagger_client/api/payment_api.rb', line 232

def return_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
  data, _status_code, _headers = return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts)
  return data
end

#return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>

Return/refund a transaction. Use this to return/refund an existing transaction. Partial returns are allowed.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:

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

    TransactionResponse data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
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
# File 'lib/swagger_client/api/payment_api.rb', line 249

def return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.return_transaction ..."
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.return_transaction"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
    fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.return_transaction"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.return_transaction"
  end
  # verify the required parameter 'timestamp' is set
  if @api_client.config.client_side_validation && timestamp.nil?
    fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.return_transaction"
  end
  # verify the required parameter 'message_signature' is set
  if @api_client.config.client_side_validation && message_signature.nil?
    fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.return_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 PaymentApi.return_transaction"
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.return_transaction"
  end
  # resource path
  local_var_path = "/v1/payments/{transaction-id}/return".sub('{' + 'transaction-id' + '}', transaction_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?

  # 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'] = content_type
  header_params[:'Client-Request-Id'] = client_request_id
  header_params[:'Api-Key'] = api_key
  header_params[:'Timestamp'] = timestamp
  header_params[:'Message-Signature'] = message_signature

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  auth_names = []
  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 => 'TransactionResponse',
    :error_type => 'TransactionErrorResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#return_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#transaction_inquiry(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {}) ⇒ TransactionResponse

Retrieve the state of a transaction Use this query to get the current state of an existing transaction.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:



334
335
336
337
# File 'lib/swagger_client/api/payment_api.rb', line 334

def transaction_inquiry(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
  data, _status_code, _headers = transaction_inquiry_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts)
  return data
end

#transaction_inquiry_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>

Retrieve the state of a transaction Use this query to get the current state of an existing transaction.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:

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

    TransactionResponse data, response status code and response headers



350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
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
# File 'lib/swagger_client/api/payment_api.rb', line 350

def transaction_inquiry_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.transaction_inquiry ..."
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.transaction_inquiry"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
    fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.transaction_inquiry"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.transaction_inquiry"
  end
  # verify the required parameter 'timestamp' is set
  if @api_client.config.client_side_validation && timestamp.nil?
    fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.transaction_inquiry"
  end
  # verify the required parameter 'message_signature' is set
  if @api_client.config.client_side_validation && message_signature.nil?
    fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.transaction_inquiry"
  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 PaymentApi.transaction_inquiry"
  end
  # resource path
  local_var_path = "/v1/payments/{transaction-id}".sub('{' + 'transaction-id' + '}', transaction_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?

  # 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'] = content_type
  header_params[:'Client-Request-Id'] = client_request_id
  header_params[:'Api-Key'] = api_key
  header_params[:'Timestamp'] = timestamp
  header_params[:'Message-Signature'] = message_signature

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'TransactionResponse',
    :error_type => 'TransactionErrorResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#transaction_inquiry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#void_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {}) ⇒ TransactionResponse

Reverse a previous action on an existing transaction Use this to reverse a postauth/completion, credit, preauth, or sale.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:



431
432
433
434
# File 'lib/swagger_client/api/payment_api.rb', line 431

def void_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
  data, _status_code, _headers = void_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts)
  return data
end

#void_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {}) ⇒ Array<(TransactionResponse, Fixnum, Hash)>

Reverse a previous action on an existing transaction Use this to reverse a postauth/completion, credit, preauth, or sale.

Parameters:

  • content_type

    content type

  • client_request_id

    A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format.

  • api_key
  • timestamp

    Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).

  • message_signature

    Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal.

  • transaction_id

    Gateway transaction identifier as returned in the parameter ipgTransactionId

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

    the optional parameters

Options Hash (opts):

  • :store_id (String)

    an optional outlet id for clients that support multiple store in the same developer app

Returns:

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

    TransactionResponse data, response status code and response headers



447
448
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
506
507
508
509
510
511
512
513
514
515
# File 'lib/swagger_client/api/payment_api.rb', line 447

def void_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.void_transaction ..."
  end
  # verify the required parameter 'content_type' is set
  if @api_client.config.client_side_validation && content_type.nil?
    fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.void_transaction"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
    fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
  end
  # verify the required parameter 'client_request_id' is set
  if @api_client.config.client_side_validation && client_request_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.void_transaction"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.void_transaction"
  end
  # verify the required parameter 'timestamp' is set
  if @api_client.config.client_side_validation && timestamp.nil?
    fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.void_transaction"
  end
  # verify the required parameter 'message_signature' is set
  if @api_client.config.client_side_validation && message_signature.nil?
    fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.void_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 PaymentApi.void_transaction"
  end
  # resource path
  local_var_path = "/v1/payments/{transaction-id}/void".sub('{' + 'transaction-id' + '}', transaction_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?

  # 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'] = content_type
  header_params[:'Client-Request-Id'] = client_request_id
  header_params[:'Api-Key'] = api_key
  header_params[:'Timestamp'] = timestamp
  header_params[:'Message-Signature'] = message_signature

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'TransactionResponse',
    :error_type => 'TransactionErrorResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#void_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end