first_data_gateway 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +123 -0
  4. data/Rakefile +8 -0
  5. data/docs/AccessTokenResponse.md +11 -0
  6. data/docs/Address.md +14 -0
  7. data/docs/Airline.md +21 -0
  8. data/docs/AirlineAncillaryServiceCategory.md +8 -0
  9. data/docs/AirlineTravelRoute.md +16 -0
  10. data/docs/Amount.md +10 -0
  11. data/docs/AmountComponents.md +14 -0
  12. data/docs/AuthenticationApi.md +68 -0
  13. data/docs/AuthenticationResponseVerification.md +10 -0
  14. data/docs/BasketItem.md +11 -0
  15. data/docs/Billing.md +13 -0
  16. data/docs/CarRental.md +15 -0
  17. data/docs/CarRentalExtraCharges.md +8 -0
  18. data/docs/CardVerificationsTransaction.md +9 -0
  19. data/docs/ClientLocale.md +9 -0
  20. data/docs/Contact.md +11 -0
  21. data/docs/Error.md +10 -0
  22. data/docs/ErrorDetails.md +9 -0
  23. data/docs/ErrorResponse.md +11 -0
  24. data/docs/Expiration.md +9 -0
  25. data/docs/Frequency.md +9 -0
  26. data/docs/IndustrySpecificExtensions.md +10 -0
  27. data/docs/InstallmentOptions.md +10 -0
  28. data/docs/Lodging.md +12 -0
  29. data/docs/LodgingExtraCharges.md +8 -0
  30. data/docs/Order.md +10 -0
  31. data/docs/OrderApi.md +148 -0
  32. data/docs/PayPal.md +8 -0
  33. data/docs/PaymentApi.md +345 -0
  34. data/docs/PaymentCard.md +15 -0
  35. data/docs/PaymentCardAuthenticationRequest.md +8 -0
  36. data/docs/PaymentCardAuthenticationResult.md +12 -0
  37. data/docs/PaymentMethod.md +11 -0
  38. data/docs/PaymentSchedulesRequest.md +21 -0
  39. data/docs/PaymentSchedulesResponse.md +11 -0
  40. data/docs/PaymentUrlRequest.md +11 -0
  41. data/docs/PaymentUrlResponse.md +13 -0
  42. data/docs/PrimaryTransaction.md +18 -0
  43. data/docs/PrimaryTransactionAdditionalDetails.md +14 -0
  44. data/docs/ProcessorData.md +10 -0
  45. data/docs/ResponseType.md +7 -0
  46. data/docs/SecondaryTransaction.md +9 -0
  47. data/docs/Sepa.md +12 -0
  48. data/docs/SepaMandate.md +11 -0
  49. data/docs/Shipping.md +10 -0
  50. data/docs/SplitShipment.md +9 -0
  51. data/docs/StoredCredential.md +11 -0
  52. data/docs/TransactionErrorResponse.md +28 -0
  53. data/docs/TransactionResponse.md +27 -0
  54. data/docs/TransactionResponseAuthenticationRedirect.md +10 -0
  55. data/docs/TransactionResponseAuthenticationRedirectParams.md +10 -0
  56. data/docs/TransactionType.md +7 -0
  57. data/first_data_gateway.gemspec +45 -0
  58. data/git_push.sh +55 -0
  59. data/lib/simple/client_context.rb +15 -0
  60. data/lib/simple/gateway.rb +155 -0
  61. data/lib/simple/merchant_credentials.rb +10 -0
  62. data/lib/simple/signature.rb +52 -0
  63. data/lib/simple_client.rb +4 -0
  64. data/lib/swagger_client.rb +91 -0
  65. data/lib/swagger_client/api/authentication_api.rb +111 -0
  66. data/lib/swagger_client/api/order_api.rb +229 -0
  67. data/lib/swagger_client/api/payment_api.rb +517 -0
  68. data/lib/swagger_client/api_client.rb +390 -0
  69. data/lib/swagger_client/api_error.rb +38 -0
  70. data/lib/swagger_client/configuration.rb +202 -0
  71. data/lib/swagger_client/models/access_token_response.rb +252 -0
  72. data/lib/swagger_client/models/address.rb +361 -0
  73. data/lib/swagger_client/models/airline.rb +487 -0
  74. data/lib/swagger_client/models/airline_ancillary_service_category.rb +221 -0
  75. data/lib/swagger_client/models/airline_travel_route.rb +406 -0
  76. data/lib/swagger_client/models/amount.rb +217 -0
  77. data/lib/swagger_client/models/amount_components.rb +242 -0
  78. data/lib/swagger_client/models/authentication_response_verification.rb +239 -0
  79. data/lib/swagger_client/models/basket_item.rb +218 -0
  80. data/lib/swagger_client/models/billing.rb +282 -0
  81. data/lib/swagger_client/models/car_rental.rb +317 -0
  82. data/lib/swagger_client/models/car_rental_extra_charges.rb +221 -0
  83. data/lib/swagger_client/models/card_verifications_transaction.rb +203 -0
  84. data/lib/swagger_client/models/client_locale.rb +209 -0
  85. data/lib/swagger_client/models/contact.rb +279 -0
  86. data/lib/swagger_client/models/error.rb +211 -0
  87. data/lib/swagger_client/models/error_details.rb +199 -0
  88. data/lib/swagger_client/models/error_response.rb +218 -0
  89. data/lib/swagger_client/models/expiration.rb +207 -0
  90. data/lib/swagger_client/models/frequency.rb +270 -0
  91. data/lib/swagger_client/models/industry_specific_extensions.rb +206 -0
  92. data/lib/swagger_client/models/installment_options.rb +259 -0
  93. data/lib/swagger_client/models/lodging.rb +245 -0
  94. data/lib/swagger_client/models/lodging_extra_charges.rb +221 -0
  95. data/lib/swagger_client/models/order.rb +206 -0
  96. data/lib/swagger_client/models/pay_pal.rb +213 -0
  97. data/lib/swagger_client/models/payment_card.rb +294 -0
  98. data/lib/swagger_client/models/payment_card_authentication_request.rb +222 -0
  99. data/lib/swagger_client/models/payment_card_authentication_result.rb +336 -0
  100. data/lib/swagger_client/models/payment_method.rb +254 -0
  101. data/lib/swagger_client/models/payment_schedules_request.rb +398 -0
  102. data/lib/swagger_client/models/payment_schedules_response.rb +267 -0
  103. data/lib/swagger_client/models/payment_url_request.rb +232 -0
  104. data/lib/swagger_client/models/payment_url_response.rb +286 -0
  105. data/lib/swagger_client/models/primary_transaction.rb +298 -0
  106. data/lib/swagger_client/models/primary_transaction_additional_details.rb +244 -0
  107. data/lib/swagger_client/models/processor_data.rb +216 -0
  108. data/lib/swagger_client/models/response_type.rb +37 -0
  109. data/lib/swagger_client/models/secondary_transaction.rb +197 -0
  110. data/lib/swagger_client/models/sepa.rb +321 -0
  111. data/lib/swagger_client/models/sepa_mandate.rb +321 -0
  112. data/lib/swagger_client/models/shipping.rb +222 -0
  113. data/lib/swagger_client/models/split_shipment.rb +201 -0
  114. data/lib/swagger_client/models/stored_credential.rb +290 -0
  115. data/lib/swagger_client/models/transaction_error_response.rb +445 -0
  116. data/lib/swagger_client/models/transaction_response.rb +436 -0
  117. data/lib/swagger_client/models/transaction_response_authentication_redirect.rb +239 -0
  118. data/lib/swagger_client/models/transaction_response_authentication_redirect_params.rb +206 -0
  119. data/lib/swagger_client/models/transaction_type.rb +36 -0
  120. data/lib/swagger_client/version.rb +15 -0
  121. data/spec/api/authentication_api_spec.rb +51 -0
  122. data/spec/api/order_api_spec.rb +73 -0
  123. data/spec/api/payment_api_spec.rb +126 -0
  124. data/spec/api_client_spec.rb +226 -0
  125. data/spec/configuration_spec.rb +42 -0
  126. data/spec/models/access_token_response_spec.rb +64 -0
  127. data/spec/models/address_spec.rb +78 -0
  128. data/spec/models/airline_ancillary_service_category_spec.rb +46 -0
  129. data/spec/models/airline_spec.rb +124 -0
  130. data/spec/models/airline_travel_route_spec.rb +94 -0
  131. data/spec/models/amount_components_spec.rb +78 -0
  132. data/spec/models/amount_spec.rb +54 -0
  133. data/spec/models/authentication_response_verification_spec.rb +58 -0
  134. data/spec/models/basket_item_spec.rb +60 -0
  135. data/spec/models/billing_spec.rb +76 -0
  136. data/spec/models/car_rental_extra_charges_spec.rb +46 -0
  137. data/spec/models/car_rental_spec.rb +84 -0
  138. data/spec/models/card_verifications_transaction_spec.rb +48 -0
  139. data/spec/models/client_locale_spec.rb +48 -0
  140. data/spec/models/contact_spec.rb +60 -0
  141. data/spec/models/error_details_spec.rb +48 -0
  142. data/spec/models/error_response_spec.rb +60 -0
  143. data/spec/models/error_spec.rb +54 -0
  144. data/spec/models/expiration_spec.rb +48 -0
  145. data/spec/models/frequency_spec.rb +52 -0
  146. data/spec/models/industry_specific_extensions_spec.rb +54 -0
  147. data/spec/models/installment_options_spec.rb +54 -0
  148. data/spec/models/lodging_extra_charges_spec.rb +46 -0
  149. data/spec/models/lodging_spec.rb +66 -0
  150. data/spec/models/order_spec.rb +54 -0
  151. data/spec/models/pay_pal_spec.rb +42 -0
  152. data/spec/models/payment_card_authentication_request_spec.rb +46 -0
  153. data/spec/models/payment_card_authentication_result_spec.rb +78 -0
  154. data/spec/models/payment_card_spec.rb +88 -0
  155. data/spec/models/payment_method_spec.rb +64 -0
  156. data/spec/models/payment_schedules_request_spec.rb +124 -0
  157. data/spec/models/payment_schedules_response_spec.rb +64 -0
  158. data/spec/models/payment_url_request_spec.rb +60 -0
  159. data/spec/models/payment_url_response_spec.rb +76 -0
  160. data/spec/models/primary_transaction_additional_details_spec.rb +78 -0
  161. data/spec/models/primary_transaction_spec.rb +102 -0
  162. data/spec/models/processor_data_spec.rb +54 -0
  163. data/spec/models/response_type_spec.rb +36 -0
  164. data/spec/models/secondary_transaction_spec.rb +48 -0
  165. data/spec/models/sepa_mandate_spec.rb +64 -0
  166. data/spec/models/sepa_spec.rb +66 -0
  167. data/spec/models/shipping_spec.rb +54 -0
  168. data/spec/models/split_shipment_spec.rb +48 -0
  169. data/spec/models/stored_credential_spec.rb +68 -0
  170. data/spec/models/transaction_error_response_spec.rb +170 -0
  171. data/spec/models/transaction_response_authentication_redirect_params_spec.rb +54 -0
  172. data/spec/models/transaction_response_authentication_redirect_spec.rb +58 -0
  173. data/spec/models/transaction_response_spec.rb +164 -0
  174. data/spec/models/transaction_type_spec.rb +36 -0
  175. data/spec/spec_helper.rb +111 -0
  176. metadata +457 -0
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #Payment Gateway API Specification
3
+
4
+ #Payment Gateway API for payment processing.
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module SwaggerClient
16
+ class OrderApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Use this to capture/complete a transaction. Partial postauths are allowed.
24
+ # This can be used for postauth and partial postauths.
25
+ # @param content_type content type
26
+ # @param 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.
27
+ # @param api_key
28
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
29
+ # @param 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.
30
+ # @param order_id Gateway order identifier as returned in the parameter orderId
31
+ # @param payload
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
34
+ # @return [TransactionResponse]
35
+ def perform_payment_post_authorisation(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts = {})
36
+ data, _status_code, _headers = perform_payment_post_authorisation_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts)
37
+ return data
38
+ end
39
+
40
+ # Use this to capture/complete a transaction. Partial postauths are allowed.
41
+ # This can be used for postauth and partial postauths.
42
+ # @param content_type content type
43
+ # @param 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.
44
+ # @param api_key
45
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
46
+ # @param 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.
47
+ # @param order_id Gateway order identifier as returned in the parameter orderId
48
+ # @param payload
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
51
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
52
+ def perform_payment_post_authorisation_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts = {})
53
+ if @api_client.config.debugging
54
+ @api_client.config.logger.debug "Calling API: OrderApi.perform_payment_post_authorisation ..."
55
+ end
56
+ # verify the required parameter 'content_type' is set
57
+ if @api_client.config.client_side_validation && content_type.nil?
58
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling OrderApi.perform_payment_post_authorisation"
59
+ end
60
+ # verify enum value
61
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
62
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
63
+ end
64
+ # verify the required parameter 'client_request_id' is set
65
+ if @api_client.config.client_side_validation && client_request_id.nil?
66
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling OrderApi.perform_payment_post_authorisation"
67
+ end
68
+ # verify the required parameter 'api_key' is set
69
+ if @api_client.config.client_side_validation && api_key.nil?
70
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling OrderApi.perform_payment_post_authorisation"
71
+ end
72
+ # verify the required parameter 'timestamp' is set
73
+ if @api_client.config.client_side_validation && timestamp.nil?
74
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling OrderApi.perform_payment_post_authorisation"
75
+ end
76
+ # verify the required parameter 'message_signature' is set
77
+ if @api_client.config.client_side_validation && message_signature.nil?
78
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling OrderApi.perform_payment_post_authorisation"
79
+ end
80
+ # verify the required parameter 'order_id' is set
81
+ if @api_client.config.client_side_validation && order_id.nil?
82
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.perform_payment_post_authorisation"
83
+ end
84
+ # verify the required parameter 'payload' is set
85
+ if @api_client.config.client_side_validation && payload.nil?
86
+ fail ArgumentError, "Missing the required parameter 'payload' when calling OrderApi.perform_payment_post_authorisation"
87
+ end
88
+ # resource path
89
+ local_var_path = "/v1/orders/{order-id}/postauth".sub('{' + 'order-id' + '}', order_id.to_s)
90
+
91
+ # query parameters
92
+ query_params = {}
93
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
94
+
95
+ # header parameters
96
+ header_params = {}
97
+ # HTTP header 'Accept' (if needed)
98
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
99
+ # HTTP header 'Content-Type'
100
+ # header_params[:'Content-Type'] = content_type
101
+ header_params[:'Client-Request-Id'] = client_request_id
102
+ header_params[:'Api-Key'] = api_key
103
+ header_params[:'Timestamp'] = timestamp
104
+ header_params[:'Message-Signature'] = message_signature
105
+
106
+ # form parameters
107
+ form_params = {}
108
+
109
+ # http body (model)
110
+ post_body = @api_client.object_to_http_body(payload)
111
+ auth_names = []
112
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
113
+ :header_params => header_params,
114
+ :query_params => query_params,
115
+ :form_params => form_params,
116
+ :body => post_body,
117
+ :auth_names => auth_names,
118
+ :return_type => 'TransactionResponse',
119
+ :error_type => 'TransactionErrorResponse')
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: OrderApi#perform_payment_post_authorisation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+
126
+ # Use this to return/refund on the order. Partial returns are allowed.
127
+ # This can be used for Returns and Partial Returns.
128
+ # @param content_type content type
129
+ # @param 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.
130
+ # @param api_key
131
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
132
+ # @param 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.
133
+ # @param order_id Gateway order identifier as returned in the parameter orderId
134
+ # @param payload
135
+ # @param [Hash] opts the optional parameters
136
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
137
+ # @return [TransactionResponse]
138
+ def return_transaction(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts = {})
139
+ data, _status_code, _headers = return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts)
140
+ return data
141
+ end
142
+
143
+ # Use this to return/refund on the order. Partial returns are allowed.
144
+ # This can be used for Returns and Partial Returns.
145
+ # @param content_type content type
146
+ # @param 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.
147
+ # @param api_key
148
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
149
+ # @param 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.
150
+ # @param order_id Gateway order identifier as returned in the parameter orderId
151
+ # @param payload
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
154
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
155
+ def return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, order_id, payload, opts = {})
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug "Calling API: OrderApi.return_transaction ..."
158
+ end
159
+ # verify the required parameter 'content_type' is set
160
+ if @api_client.config.client_side_validation && content_type.nil?
161
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling OrderApi.return_transaction"
162
+ end
163
+ # verify enum value
164
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
165
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
166
+ end
167
+ # verify the required parameter 'client_request_id' is set
168
+ if @api_client.config.client_side_validation && client_request_id.nil?
169
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling OrderApi.return_transaction"
170
+ end
171
+ # verify the required parameter 'api_key' is set
172
+ if @api_client.config.client_side_validation && api_key.nil?
173
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling OrderApi.return_transaction"
174
+ end
175
+ # verify the required parameter 'timestamp' is set
176
+ if @api_client.config.client_side_validation && timestamp.nil?
177
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling OrderApi.return_transaction"
178
+ end
179
+ # verify the required parameter 'message_signature' is set
180
+ if @api_client.config.client_side_validation && message_signature.nil?
181
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling OrderApi.return_transaction"
182
+ end
183
+ # verify the required parameter 'order_id' is set
184
+ if @api_client.config.client_side_validation && order_id.nil?
185
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.return_transaction"
186
+ end
187
+ # verify the required parameter 'payload' is set
188
+ if @api_client.config.client_side_validation && payload.nil?
189
+ fail ArgumentError, "Missing the required parameter 'payload' when calling OrderApi.return_transaction"
190
+ end
191
+ # resource path
192
+ local_var_path = "/v1/orders/{order-id}/return".sub('{' + 'order-id' + '}', order_id.to_s)
193
+
194
+ # query parameters
195
+ query_params = {}
196
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
197
+
198
+ # header parameters
199
+ header_params = {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
202
+ # HTTP header 'Content-Type'
203
+ # header_params[:'Content-Type'] = content_type
204
+ header_params[:'Client-Request-Id'] = client_request_id
205
+ header_params[:'Api-Key'] = api_key
206
+ header_params[:'Timestamp'] = timestamp
207
+ header_params[:'Message-Signature'] = message_signature
208
+
209
+ # form parameters
210
+ form_params = {}
211
+
212
+ # http body (model)
213
+ post_body = @api_client.object_to_http_body(payload)
214
+ auth_names = []
215
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
216
+ :header_params => header_params,
217
+ :query_params => query_params,
218
+ :form_params => form_params,
219
+ :body => post_body,
220
+ :auth_names => auth_names,
221
+ :return_type => 'TransactionResponse',
222
+ :error_type => 'TransactionErrorResponse')
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug "API called: OrderApi#return_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
+ end
226
+ return data, status_code, headers
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,517 @@
1
+ =begin
2
+ #Payment Gateway API Specification
3
+
4
+ #Payment Gateway API for payment processing.
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module SwaggerClient
16
+ class PaymentApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Use this to capture/complete a transaction. Partial postauths are allowed.
24
+ # This can be used for postauth and partial postauths.
25
+ # @param content_type content type
26
+ # @param 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.
27
+ # @param api_key
28
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
29
+ # @param 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.
30
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
31
+ # @param payload
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
34
+ # @return [TransactionResponse]
35
+ def perform_payment_post_authorisation(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
36
+ data, _status_code, _headers = perform_payment_post_authorisation_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts)
37
+ return data
38
+ end
39
+
40
+ # Use this to capture/complete a transaction. Partial postauths are allowed.
41
+ # This can be used for postauth and partial postauths.
42
+ # @param content_type content type
43
+ # @param 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.
44
+ # @param api_key
45
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
46
+ # @param 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.
47
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
48
+ # @param payload
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
51
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
52
+ def perform_payment_post_authorisation_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
53
+ if @api_client.config.debugging
54
+ @api_client.config.logger.debug "Calling API: PaymentApi.perform_payment_post_authorisation ..."
55
+ end
56
+ # verify the required parameter 'content_type' is set
57
+ if @api_client.config.client_side_validation && content_type.nil?
58
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.perform_payment_post_authorisation"
59
+ end
60
+ # verify enum value
61
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
62
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
63
+ end
64
+ # verify the required parameter 'client_request_id' is set
65
+ if @api_client.config.client_side_validation && client_request_id.nil?
66
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.perform_payment_post_authorisation"
67
+ end
68
+ # verify the required parameter 'api_key' is set
69
+ if @api_client.config.client_side_validation && api_key.nil?
70
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.perform_payment_post_authorisation"
71
+ end
72
+ # verify the required parameter 'timestamp' is set
73
+ if @api_client.config.client_side_validation && timestamp.nil?
74
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.perform_payment_post_authorisation"
75
+ end
76
+ # verify the required parameter 'message_signature' is set
77
+ if @api_client.config.client_side_validation && message_signature.nil?
78
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.perform_payment_post_authorisation"
79
+ end
80
+ # verify the required parameter 'transaction_id' is set
81
+ if @api_client.config.client_side_validation && transaction_id.nil?
82
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentApi.perform_payment_post_authorisation"
83
+ end
84
+ # verify the required parameter 'payload' is set
85
+ if @api_client.config.client_side_validation && payload.nil?
86
+ fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.perform_payment_post_authorisation"
87
+ end
88
+ # resource path
89
+ local_var_path = "/v1/payments/{transaction-id}/postauth".sub('{' + 'transaction-id' + '}', transaction_id.to_s)
90
+
91
+ # query parameters
92
+ query_params = {}
93
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
94
+
95
+ # header parameters
96
+ header_params = {}
97
+ # HTTP header 'Accept' (if needed)
98
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
99
+ # HTTP header 'Content-Type'
100
+ # header_params[:'Content-Type'] = content_type
101
+ header_params[:'Client-Request-Id'] = client_request_id
102
+ header_params[:'Api-Key'] = api_key
103
+ header_params[:'Timestamp'] = timestamp
104
+ header_params[:'Message-Signature'] = message_signature
105
+
106
+ # form parameters
107
+ form_params = {}
108
+
109
+ # http body (model)
110
+ post_body = @api_client.object_to_http_body(payload)
111
+ auth_names = []
112
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
113
+ :header_params => header_params,
114
+ :query_params => query_params,
115
+ :form_params => form_params,
116
+ :body => post_body,
117
+ :auth_names => auth_names,
118
+ :return_type => 'TransactionResponse',
119
+ :error_type => 'TransactionErrorResponse')
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: PaymentApi#perform_payment_post_authorisation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+
126
+ # Generate a primary transaction
127
+ # Use this to originate a financial transaction, like a sale, preauthorization, or credit.
128
+ # @param content_type content type
129
+ # @param 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.
130
+ # @param api_key
131
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
132
+ # @param 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.
133
+ # @param payload Primary Transaction request
134
+ # @param [Hash] opts the optional parameters
135
+ # @return [TransactionResponse]
136
+ def primary_payment_transaction(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {})
137
+ data, _status_code, _headers = primary_payment_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts)
138
+ return data
139
+ end
140
+
141
+ # Generate a primary transaction
142
+ # Use this to originate a financial transaction, like a sale, preauthorization, or credit.
143
+ # @param content_type content type
144
+ # @param 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.
145
+ # @param api_key
146
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
147
+ # @param 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.
148
+ # @param payload Primary Transaction request
149
+ # @param [Hash] opts the optional parameters
150
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
151
+ def primary_payment_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, payload, opts = {})
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "Calling API: PaymentApi.primary_payment_transaction ..."
154
+ end
155
+ # verify the required parameter 'content_type' is set
156
+ if @api_client.config.client_side_validation && content_type.nil?
157
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.primary_payment_transaction"
158
+ end
159
+ # verify enum value
160
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
161
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
162
+ end
163
+ # verify the required parameter 'client_request_id' is set
164
+ if @api_client.config.client_side_validation && client_request_id.nil?
165
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.primary_payment_transaction"
166
+ end
167
+ # verify the required parameter 'api_key' is set
168
+ if @api_client.config.client_side_validation && api_key.nil?
169
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.primary_payment_transaction"
170
+ end
171
+ # verify the required parameter 'timestamp' is set
172
+ if @api_client.config.client_side_validation && timestamp.nil?
173
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.primary_payment_transaction"
174
+ end
175
+ # verify the required parameter 'message_signature' is set
176
+ if @api_client.config.client_side_validation && message_signature.nil?
177
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.primary_payment_transaction"
178
+ end
179
+ # verify the required parameter 'payload' is set
180
+ if @api_client.config.client_side_validation && payload.nil?
181
+ fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.primary_payment_transaction"
182
+ end
183
+ # resource path
184
+ local_var_path = "/v1/payments"
185
+
186
+ # query parameters
187
+ query_params = {}
188
+
189
+ # header parameters
190
+ header_params = {}
191
+ # HTTP header 'Accept' (if needed)
192
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
193
+ # HTTP header 'Content-Type'
194
+ # header_params[:'Content-Type'] = content_type
195
+ header_params[:'Client-Request-Id'] = client_request_id
196
+ header_params[:'Api-Key'] = api_key
197
+ header_params[:'Timestamp'] = timestamp
198
+ header_params[:'Message-Signature'] = message_signature
199
+
200
+ # form parameters
201
+ form_params = {}
202
+
203
+ # http body (model)
204
+ post_body = @api_client.object_to_http_body(payload)
205
+ auth_names = []
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => 'TransactionResponse',
213
+ :error_type => 'TransactionErrorResponse')
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "API called: PaymentApi#primary_payment_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ end
217
+ return data, status_code, headers
218
+ end
219
+
220
+ # Return/refund a transaction.
221
+ # Use this to return/refund an existing transaction. Partial returns are allowed.
222
+ # @param content_type content type
223
+ # @param 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.
224
+ # @param api_key
225
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
226
+ # @param 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.
227
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
228
+ # @param payload
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
231
+ # @return [TransactionResponse]
232
+ def return_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
233
+ data, _status_code, _headers = return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts)
234
+ return data
235
+ end
236
+
237
+ # Return/refund a transaction.
238
+ # Use this to return/refund an existing transaction. Partial returns are allowed.
239
+ # @param content_type content type
240
+ # @param 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.
241
+ # @param api_key
242
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
243
+ # @param 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.
244
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
245
+ # @param payload
246
+ # @param [Hash] opts the optional parameters
247
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
248
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
249
+ def return_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, payload, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug "Calling API: PaymentApi.return_transaction ..."
252
+ end
253
+ # verify the required parameter 'content_type' is set
254
+ if @api_client.config.client_side_validation && content_type.nil?
255
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.return_transaction"
256
+ end
257
+ # verify enum value
258
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
259
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
260
+ end
261
+ # verify the required parameter 'client_request_id' is set
262
+ if @api_client.config.client_side_validation && client_request_id.nil?
263
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.return_transaction"
264
+ end
265
+ # verify the required parameter 'api_key' is set
266
+ if @api_client.config.client_side_validation && api_key.nil?
267
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.return_transaction"
268
+ end
269
+ # verify the required parameter 'timestamp' is set
270
+ if @api_client.config.client_side_validation && timestamp.nil?
271
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.return_transaction"
272
+ end
273
+ # verify the required parameter 'message_signature' is set
274
+ if @api_client.config.client_side_validation && message_signature.nil?
275
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.return_transaction"
276
+ end
277
+ # verify the required parameter 'transaction_id' is set
278
+ if @api_client.config.client_side_validation && transaction_id.nil?
279
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentApi.return_transaction"
280
+ end
281
+ # verify the required parameter 'payload' is set
282
+ if @api_client.config.client_side_validation && payload.nil?
283
+ fail ArgumentError, "Missing the required parameter 'payload' when calling PaymentApi.return_transaction"
284
+ end
285
+ # resource path
286
+ local_var_path = "/v1/payments/{transaction-id}/return".sub('{' + 'transaction-id' + '}', transaction_id.to_s)
287
+
288
+ # query parameters
289
+ query_params = {}
290
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
291
+
292
+ # header parameters
293
+ header_params = {}
294
+ # HTTP header 'Accept' (if needed)
295
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
296
+ # HTTP header 'Content-Type'
297
+ # header_params[:'Content-Type'] = content_type
298
+ header_params[:'Client-Request-Id'] = client_request_id
299
+ header_params[:'Api-Key'] = api_key
300
+ header_params[:'Timestamp'] = timestamp
301
+ header_params[:'Message-Signature'] = message_signature
302
+
303
+ # form parameters
304
+ form_params = {}
305
+
306
+ # http body (model)
307
+ post_body = @api_client.object_to_http_body(payload)
308
+ auth_names = []
309
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
310
+ :header_params => header_params,
311
+ :query_params => query_params,
312
+ :form_params => form_params,
313
+ :body => post_body,
314
+ :auth_names => auth_names,
315
+ :return_type => 'TransactionResponse',
316
+ :error_type => 'TransactionErrorResponse')
317
+ if @api_client.config.debugging
318
+ @api_client.config.logger.debug "API called: PaymentApi#return_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+
323
+ # Retrieve the state of a transaction
324
+ # Use this query to get the current state of an existing transaction.
325
+ # @param content_type content type
326
+ # @param 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.
327
+ # @param api_key
328
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
329
+ # @param 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.
330
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
331
+ # @param [Hash] opts the optional parameters
332
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
333
+ # @return [TransactionResponse]
334
+ def transaction_inquiry(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
335
+ data, _status_code, _headers = transaction_inquiry_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts)
336
+ return data
337
+ end
338
+
339
+ # Retrieve the state of a transaction
340
+ # Use this query to get the current state of an existing transaction.
341
+ # @param content_type content type
342
+ # @param 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.
343
+ # @param api_key
344
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
345
+ # @param 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.
346
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
347
+ # @param [Hash] opts the optional parameters
348
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
349
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
350
+ def transaction_inquiry_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug "Calling API: PaymentApi.transaction_inquiry ..."
353
+ end
354
+ # verify the required parameter 'content_type' is set
355
+ if @api_client.config.client_side_validation && content_type.nil?
356
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.transaction_inquiry"
357
+ end
358
+ # verify enum value
359
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
360
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
361
+ end
362
+ # verify the required parameter 'client_request_id' is set
363
+ if @api_client.config.client_side_validation && client_request_id.nil?
364
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.transaction_inquiry"
365
+ end
366
+ # verify the required parameter 'api_key' is set
367
+ if @api_client.config.client_side_validation && api_key.nil?
368
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.transaction_inquiry"
369
+ end
370
+ # verify the required parameter 'timestamp' is set
371
+ if @api_client.config.client_side_validation && timestamp.nil?
372
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.transaction_inquiry"
373
+ end
374
+ # verify the required parameter 'message_signature' is set
375
+ if @api_client.config.client_side_validation && message_signature.nil?
376
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.transaction_inquiry"
377
+ end
378
+ # verify the required parameter 'transaction_id' is set
379
+ if @api_client.config.client_side_validation && transaction_id.nil?
380
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentApi.transaction_inquiry"
381
+ end
382
+ # resource path
383
+ local_var_path = "/v1/payments/{transaction-id}".sub('{' + 'transaction-id' + '}', transaction_id.to_s)
384
+
385
+ # query parameters
386
+ query_params = {}
387
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
388
+
389
+ # header parameters
390
+ header_params = {}
391
+ # HTTP header 'Accept' (if needed)
392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
393
+ # HTTP header 'Content-Type'
394
+ # header_params[:'Content-Type'] = content_type
395
+ header_params[:'Client-Request-Id'] = client_request_id
396
+ header_params[:'Api-Key'] = api_key
397
+ header_params[:'Timestamp'] = timestamp
398
+ header_params[:'Message-Signature'] = message_signature
399
+
400
+ # form parameters
401
+ form_params = {}
402
+
403
+ # http body (model)
404
+ post_body = nil
405
+ auth_names = []
406
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
407
+ :header_params => header_params,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body,
411
+ :auth_names => auth_names,
412
+ :return_type => 'TransactionResponse',
413
+ :error_type => 'TransactionErrorResponse')
414
+ if @api_client.config.debugging
415
+ @api_client.config.logger.debug "API called: PaymentApi#transaction_inquiry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
416
+ end
417
+ return data, status_code, headers
418
+ end
419
+
420
+ # Reverse a previous action on an existing transaction
421
+ # Use this to reverse a postauth/completion, credit, preauth, or sale.
422
+ # @param content_type content type
423
+ # @param 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.
424
+ # @param api_key
425
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
426
+ # @param 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.
427
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
428
+ # @param [Hash] opts the optional parameters
429
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
430
+ # @return [TransactionResponse]
431
+ def void_transaction(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
432
+ data, _status_code, _headers = void_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts)
433
+ return data
434
+ end
435
+
436
+ # Reverse a previous action on an existing transaction
437
+ # Use this to reverse a postauth/completion, credit, preauth, or sale.
438
+ # @param content_type content type
439
+ # @param 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.
440
+ # @param api_key
441
+ # @param timestamp Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins).
442
+ # @param 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.
443
+ # @param transaction_id Gateway transaction identifier as returned in the parameter ipgTransactionId
444
+ # @param [Hash] opts the optional parameters
445
+ # @option opts [String] :store_id an optional outlet id for clients that support multiple store in the same developer app
446
+ # @return [Array<(TransactionResponse, Fixnum, Hash)>] TransactionResponse data, response status code and response headers
447
+ def void_transaction_with_http_info(content_type, client_request_id, api_key, timestamp, message_signature, transaction_id, opts = {})
448
+ if @api_client.config.debugging
449
+ @api_client.config.logger.debug "Calling API: PaymentApi.void_transaction ..."
450
+ end
451
+ # verify the required parameter 'content_type' is set
452
+ if @api_client.config.client_side_validation && content_type.nil?
453
+ fail ArgumentError, "Missing the required parameter 'content_type' when calling PaymentApi.void_transaction"
454
+ end
455
+ # verify enum value
456
+ if @api_client.config.client_side_validation && !['application/json'].include?(content_type)
457
+ fail ArgumentError, "invalid value for 'content_type', must be one of application/json"
458
+ end
459
+ # verify the required parameter 'client_request_id' is set
460
+ if @api_client.config.client_side_validation && client_request_id.nil?
461
+ fail ArgumentError, "Missing the required parameter 'client_request_id' when calling PaymentApi.void_transaction"
462
+ end
463
+ # verify the required parameter 'api_key' is set
464
+ if @api_client.config.client_side_validation && api_key.nil?
465
+ fail ArgumentError, "Missing the required parameter 'api_key' when calling PaymentApi.void_transaction"
466
+ end
467
+ # verify the required parameter 'timestamp' is set
468
+ if @api_client.config.client_side_validation && timestamp.nil?
469
+ fail ArgumentError, "Missing the required parameter 'timestamp' when calling PaymentApi.void_transaction"
470
+ end
471
+ # verify the required parameter 'message_signature' is set
472
+ if @api_client.config.client_side_validation && message_signature.nil?
473
+ fail ArgumentError, "Missing the required parameter 'message_signature' when calling PaymentApi.void_transaction"
474
+ end
475
+ # verify the required parameter 'transaction_id' is set
476
+ if @api_client.config.client_side_validation && transaction_id.nil?
477
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentApi.void_transaction"
478
+ end
479
+ # resource path
480
+ local_var_path = "/v1/payments/{transaction-id}/void".sub('{' + 'transaction-id' + '}', transaction_id.to_s)
481
+
482
+ # query parameters
483
+ query_params = {}
484
+ query_params[:'storeId'] = opts[:'store_id'] if !opts[:'store_id'].nil?
485
+
486
+ # header parameters
487
+ header_params = {}
488
+ # HTTP header 'Accept' (if needed)
489
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
490
+ # HTTP header 'Content-Type'
491
+ # header_params[:'Content-Type'] = content_type
492
+ header_params[:'Client-Request-Id'] = client_request_id
493
+ header_params[:'Api-Key'] = api_key
494
+ header_params[:'Timestamp'] = timestamp
495
+ header_params[:'Message-Signature'] = message_signature
496
+
497
+ # form parameters
498
+ form_params = {}
499
+
500
+ # http body (model)
501
+ post_body = nil
502
+ auth_names = []
503
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
504
+ :header_params => header_params,
505
+ :query_params => query_params,
506
+ :form_params => form_params,
507
+ :body => post_body,
508
+ :auth_names => auth_names,
509
+ :return_type => 'TransactionResponse',
510
+ :error_type => 'TransactionErrorResponse')
511
+ if @api_client.config.debugging
512
+ @api_client.config.logger.debug "API called: PaymentApi#void_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
513
+ end
514
+ return data, status_code, headers
515
+ end
516
+ end
517
+ end