citypay_api_client 1.0.2 → 1.1.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 (243) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/api_key.rb +16 -0
  104. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  105. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  106. data/lib/citypay_api_client/models/auth_request.rb +79 -33
  107. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  108. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  109. data/lib/citypay_api_client/models/batch.rb +264 -0
  110. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  111. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  112. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  113. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  114. data/lib/citypay_api_client/models/bin.rb +299 -0
  115. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  116. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  117. data/lib/citypay_api_client/models/capture_request.rb +38 -20
  118. data/lib/citypay_api_client/models/card.rb +67 -10
  119. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  120. data/lib/citypay_api_client/models/card_status.rb +21 -8
  121. data/lib/citypay_api_client/models/charge_request.rb +96 -24
  122. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  123. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  124. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  125. data/lib/citypay_api_client/models/decision.rb +21 -8
  126. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  127. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  128. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  129. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  130. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  131. data/lib/citypay_api_client/models/error.rb +35 -12
  132. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  133. data/lib/citypay_api_client/models/exists.rb +244 -0
  134. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  135. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  136. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  137. data/lib/citypay_api_client/models/merchant.rb +21 -8
  138. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  139. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  140. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  142. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  143. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  144. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  145. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  146. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  147. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  148. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  149. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  150. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  151. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  152. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  153. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  154. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  155. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  156. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  157. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  159. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  160. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  161. data/lib/citypay_api_client/models/ping.rb +21 -8
  162. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  163. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  164. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  165. data/lib/citypay_api_client/models/register_card.rb +59 -12
  166. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  167. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  168. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  169. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  170. data/lib/citypay_api_client/models/void_request.rb +22 -19
  171. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  172. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  173. data/lib/citypay_api_client/version.rb +3 -3
  174. data/lib/citypay_api_client.rb +53 -6
  175. data/spec/.DS_Store +0 -0
  176. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  177. data/spec/api/batch_processing_api___spec.rb +70 -0
  178. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  179. data/spec/api/direct_post_api___spec.rb +98 -0
  180. data/spec/api/operational_functions_api___spec.rb +94 -0
  181. data/spec/api/paylink_api___spec.rb +131 -0
  182. data/spec/api_client_spec.rb +4 -4
  183. data/spec/configuration_spec.rb +5 -5
  184. data/spec/it_api_sandbox_spec.rb +222 -0
  185. data/spec/models/acknowledgement_spec.rb +6 -8
  186. data/spec/models/acl_check_request_spec.rb +33 -0
  187. data/spec/models/acl_check_response_model_spec.rb +51 -0
  188. data/spec/models/auth_references_spec.rb +7 -8
  189. data/spec/models/auth_response_spec.rb +29 -30
  190. data/spec/models/batch_report_request_spec.rb +39 -0
  191. data/spec/models/batch_report_response_model_spec.rb +63 -0
  192. data/spec/models/batch_spec.rb +45 -0
  193. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  194. data/spec/models/batch_transaction_spec.rb +51 -0
  195. data/spec/models/bin_lookup_spec.rb +33 -0
  196. data/spec/models/bin_spec.rb +81 -0
  197. data/spec/models/card_holder_account_spec.rb +8 -5
  198. data/spec/models/check_batch_status_response_spec.rb +45 -0
  199. data/spec/models/check_batch_status_spec.rb +39 -0
  200. data/spec/models/decision_spec.rb +1 -1
  201. data/spec/models/direct_post_request_spec.rb +153 -0
  202. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  203. data/spec/models/domain_key_check_request_spec.rb +33 -0
  204. data/spec/models/domain_key_request_spec.rb +45 -0
  205. data/spec/models/domain_key_response_spec.rb +57 -0
  206. data/spec/models/event_data_model_spec.rb +57 -0
  207. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  208. data/spec/models/list_merchants_response_spec.rb +2 -2
  209. data/spec/models/paylink_address_spec.rb +69 -0
  210. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  212. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  213. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  214. data/spec/models/paylink_card_holder_spec.rb +87 -0
  215. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  216. data/spec/models/paylink_cart_spec.rb +69 -0
  217. data/spec/models/paylink_config_spec.rb +159 -0
  218. data/spec/models/paylink_custom_param_spec.rb +87 -0
  219. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  220. data/spec/models/paylink_error_code_spec.rb +39 -0
  221. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  222. data/spec/models/paylink_part_payments_spec.rb +63 -0
  223. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  224. data/spec/models/paylink_state_event_spec.rb +45 -0
  225. data/spec/models/paylink_token_created_spec.rb +111 -0
  226. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  227. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  228. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  229. data/spec/models/paylink_token_status_spec.rb +195 -0
  230. data/spec/models/paylink_ui_spec.rb +51 -0
  231. data/spec/models/process_batch_request_spec.rb +51 -0
  232. data/spec/models/process_batch_response_spec.rb +39 -0
  233. data/spec/models/refund_request_spec.rb +64 -0
  234. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  235. data/spec/spec_helper.rb +2 -2
  236. data/spec/utils/direct_post_mac_spec.rb +13 -0
  237. metadata +212 -37
  238. data/Gemfile.lock +0 -70
  239. data/git_push.sh +0 -58
  240. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  241. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  242. data/lib/citypay_api_client/test.rb +0 -20
  243. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -1,147 +0,0 @@
1
- =begin
2
- #CityPay Payment API
3
-
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security <aside class=\"notice\"> Before we begin a reminder that your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council including: </aside> * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
-
6
- Contact: support@citypay.com
7
- Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 5.0.0-SNAPSHOT
9
-
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module CityPayApiClient
15
- class OperationalApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # List Merchants Request
22
- # An operational request to list current merchants for a client. ### Sorting Sorting can be performed by include a query parameter i.e. `/merchants/?sort=merchantid` Fields that can be sorted are `merchantid` or `name`.
23
- # @param clientid [String] The client id to return merchants for, specifying \&quot;default\&quot; will use the value in your api key.
24
- # @param [Hash] opts the optional parameters
25
- # @return [ListMerchantsResponse]
26
- def list_merchants_request(clientid, opts = {})
27
- data, _status_code, _headers = list_merchants_request_with_http_info(clientid, opts)
28
- data
29
- end
30
-
31
- # List Merchants Request
32
- # An operational request to list current merchants for a client. ### Sorting Sorting can be performed by include a query parameter i.e. &#x60;/merchants/?sort&#x3D;merchantid&#x60; Fields that can be sorted are &#x60;merchantid&#x60; or &#x60;name&#x60;.
33
- # @param clientid [String] The client id to return merchants for, specifying \&quot;default\&quot; will use the value in your api key.
34
- # @param [Hash] opts the optional parameters
35
- # @return [Array<(ListMerchantsResponse, Integer, Hash)>] ListMerchantsResponse data, response status code and response headers
36
- def list_merchants_request_with_http_info(clientid, opts = {})
37
- if @api_client.config.debugging
38
- @api_client.config.logger.debug 'Calling API: OperationalApi.list_merchants_request ...'
39
- end
40
- # verify the required parameter 'clientid' is set
41
- if @api_client.config.client_side_validation && clientid.nil?
42
- fail ArgumentError, "Missing the required parameter 'clientid' when calling OperationalApi.list_merchants_request"
43
- end
44
- # resource path
45
- local_var_path = '/merchants/{clientid}'.sub('{' + 'clientid' + '}', CGI.escape(clientid.to_s))
46
-
47
- # query parameters
48
- query_params = opts[:query_params] || {}
49
-
50
- # header parameters
51
- header_params = opts[:header_params] || {}
52
- # HTTP header 'Accept' (if needed)
53
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
54
-
55
- # form parameters
56
- form_params = opts[:form_params] || {}
57
-
58
- # http body (model)
59
- post_body = opts[:body]
60
-
61
- # return_type
62
- return_type = opts[:return_type] || 'ListMerchantsResponse'
63
-
64
- # auth_names
65
- auth_names = opts[:auth_names] || ['cp-api-key']
66
-
67
- new_options = opts.merge(
68
- :header_params => header_params,
69
- :query_params => query_params,
70
- :form_params => form_params,
71
- :body => post_body,
72
- :auth_names => auth_names,
73
- :return_type => return_type
74
- )
75
-
76
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
77
- if @api_client.config.debugging
78
- @api_client.config.logger.debug "API called: OperationalApi#list_merchants_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
- end
80
- return data, status_code, headers
81
- end
82
-
83
- # Ping Request
84
- # A ping request which performs a connection and authentication test to the CityPay API server. The request will return a standard Acknowledgement with a response code `044` to signify a successful ping. The ping call is useful to confirm that you will be able to access the API from behind any firewalls and that the permission model is granting access from your source.
85
- # @param ping [Ping]
86
- # @param [Hash] opts the optional parameters
87
- # @return [Acknowledgement]
88
- def ping_request(ping, opts = {})
89
- data, _status_code, _headers = ping_request_with_http_info(ping, opts)
90
- data
91
- end
92
-
93
- # Ping Request
94
- # A ping request which performs a connection and authentication test to the CityPay API server. The request will return a standard Acknowledgement with a response code &#x60;044&#x60; to signify a successful ping. The ping call is useful to confirm that you will be able to access the API from behind any firewalls and that the permission model is granting access from your source.
95
- # @param ping [Ping]
96
- # @param [Hash] opts the optional parameters
97
- # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
98
- def ping_request_with_http_info(ping, opts = {})
99
- if @api_client.config.debugging
100
- @api_client.config.logger.debug 'Calling API: OperationalApi.ping_request ...'
101
- end
102
- # verify the required parameter 'ping' is set
103
- if @api_client.config.client_side_validation && ping.nil?
104
- fail ArgumentError, "Missing the required parameter 'ping' when calling OperationalApi.ping_request"
105
- end
106
- # resource path
107
- local_var_path = '/ping'
108
-
109
- # query parameters
110
- query_params = opts[:query_params] || {}
111
-
112
- # header parameters
113
- header_params = opts[:header_params] || {}
114
- # HTTP header 'Accept' (if needed)
115
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
116
- # HTTP header 'Content-Type'
117
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
118
-
119
- # form parameters
120
- form_params = opts[:form_params] || {}
121
-
122
- # http body (model)
123
- post_body = opts[:body] || @api_client.object_to_http_body(ping)
124
-
125
- # return_type
126
- return_type = opts[:return_type] || 'Acknowledgement'
127
-
128
- # auth_names
129
- auth_names = opts[:auth_names] || ['cp-api-key']
130
-
131
- new_options = opts.merge(
132
- :header_params => header_params,
133
- :query_params => query_params,
134
- :form_params => form_params,
135
- :body => post_body,
136
- :auth_names => auth_names,
137
- :return_type => return_type
138
- )
139
-
140
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
141
- if @api_client.config.debugging
142
- @api_client.config.logger.debug "API called: OperationalApi#ping_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
- end
144
- return data, status_code, headers
145
- end
146
- end
147
- end
@@ -1,405 +0,0 @@
1
- =begin
2
- #CityPay Payment API
3
-
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security <aside class=\"notice\"> Before we begin a reminder that your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council including: </aside> * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
-
6
- Contact: support@citypay.com
7
- Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 5.0.0-SNAPSHOT
9
-
10
- =end
11
-
12
- require 'cgi'
13
-
14
- module CityPayApiClient
15
- class PaymentProcessingApi
16
- attr_accessor :api_client
17
-
18
- def initialize(api_client = ApiClient.default)
19
- @api_client = api_client
20
- end
21
- # Authorisation
22
- # An authorisation process performs a standard transaction authorisation based on the provided parameters of its request. The CityPay gateway will route your transaction via an Acquiring bank for subsequent authorisation to the appropriate card schemes such as Visa or MasterCard. The authorisation API should be used for server environments to process transactions on demand and in realtime. The authorisation API can be used for multiple types of transactions including E-commerce, mail order, telephone order, customer present (keyed), continuous authority, pre-authorisation and others. CityPay will configure your account for the appropriate coding and this will perform transparently by the gateway. Data properties that are required, may depend on the environment you are conducting payment for. Our API aims to be flexible enough to cater for these structures. Our integration team will aid you in providing the necessary data to transact. ### E-commerce workflows For E-commerce transactions requiring 3DSv1 and 3DSv2 transactions, the API contains a fully accredited in built mechanism to handle authentication. The gateway has been accredited extensively with both Acquirers and Card Schemes and simplifies the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditation with Visa and MasterCard. 3D-secure has been around for a number of years and aims to shift the liability of a transaction away from a merchant back to the card holder. A *liability shift* determines whether a card holder can charge back a transaction as unknown. Effectively the process asks for a card holder to authenticate the transaction prior to authorisation producing a Cardholder verification value (CAVV) as evidence of authorisation. #### 3DSv1 ```json { \"AuthenticationRequired\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"pareq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\", \"md\": \"WQgZXZlcnl0aGluZyBiZW\" } } ``` ```xml <AuthenticationRequired> <acsurl>https://bank.com/3DS/ACS</acsurl> <pareq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</pareq> <md>WQgZXZlcnl0aGluZyBiZW</md> </AuthenticationRequired> ``` For E-commerce transactions requiring 3DSv1, the API contains a built in MPI which will be called to check whether the card is participating in 3DSv1 with Verified by Visa or MasterCard SecureCode. We only support Amex SafeKey with 3DSv2. Should the card be enrolled, a payer request (PAReq) value will be created and returned back as an [authentication required](#authenticationrequired) response object. Your system will need to process this authentication packet and forward the user's browser to an authentication server (ACS) to gain the user's authentication. Once complete, the ACS will produce a HTTP `POST` call back to the URL supplied in the authentication request as `merchant_termurl`. This URL should behave as a controller and handle the post data from the ACS and on a forked server to server HTTP request, forward this data to the [pares authentication url](#pares) for subsequent authorisation processing. You may prefer to provide a processing page whilst this is being processed. Processing with our systems should be relatively quick and be between 500ms - 3000ms however it is desirable to let the user see that something is happening rather than a pending browser. The main reason for ensuring that this controller is two fold: 1. We are never in control of the user's browser in a server API call 2. The controller is actioned on your site to ensure that any post actions from authorisation can be executed in real time To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"PaReq\" value=\"{{PaReq Packet from Response}}\" /> <input type=\"hidden\" name=\"TermUrl\" value=\"{{Your Controller}}\" /> <input type=\"hidden\" name=\"MD\" value=\"{{MD From Response}}\" /> </form> </body> </html> ``` Please note that 3DSv1 is being phased out due to changes to strong customer authentication mechanisms. 3DSv2 addresses this and will solidify the authorisation and confirmation process. We provide a Test ACS for full 3DSv1 integration testing that simulates an ACS. #### 3DSv2 ```json { \"RequestChallenged\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"creq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\" } } ``` ```xml <RequestChallenged> <acsurl>https://bank.com/3DS/ACS</acsurl> <creq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</creq> </RequestChallenged> ``` All merchants in the EEC will require to migrate their E-commerce transactions to a secure customer authentication model (SCA) throughout 2020. This has been adopted by the payment's industry as a progressive move alongside the European Unions payments service directive. CityPay support 3DSv2 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.0 and will be rolling out acquirers on the new platform from Q2 2020. The new enhancement to 3DSv2 will allow for CityPay to seamlessly authenticate transactions in a \"frictionless\" flowed method which will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of the merchant and cardholder. For these transactions you will not be required to change anything. However, should a transaction be \"challenged\" the API will return a [request challenge](#requestchallenged) which will require your integration to forward the cardholder's browser to the given [ACS url](#acsurl) by posting the [creq](#creq) value. Once complete, the ACS will have already been in touch with our servers by sending us a result of the authentication known as `RReq`. Our servers however will await confirmation that the authorisation should continue and on receipt of a [cres](#cres) value, the flow will perform full authorisation processing. Please note that the CRes returned to us is purely a mechanism of acknowledging that transactions should be committed for authorisation. The ACS by this point will have sent us the verification value (CAVV) to perform a liability shift. The CRes value will be validated for receipt of the CAVV and subsequently may return back response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"creq\" value=\"{{CReq Packet from Response}}\" /> </form> </body> </html> ``` We are currently working on an integration test suite for 3DSv2 which will mock the ACS challenge process.
23
- # @param auth_request [AuthRequest]
24
- # @param [Hash] opts the optional parameters
25
- # @return [Decision]
26
- def authorisation_request(auth_request, opts = {})
27
- data, _status_code, _headers = authorisation_request_with_http_info(auth_request, opts)
28
- data
29
- end
30
-
31
- # Authorisation
32
- # An authorisation process performs a standard transaction authorisation based on the provided parameters of its request. The CityPay gateway will route your transaction via an Acquiring bank for subsequent authorisation to the appropriate card schemes such as Visa or MasterCard. The authorisation API should be used for server environments to process transactions on demand and in realtime. The authorisation API can be used for multiple types of transactions including E-commerce, mail order, telephone order, customer present (keyed), continuous authority, pre-authorisation and others. CityPay will configure your account for the appropriate coding and this will perform transparently by the gateway. Data properties that are required, may depend on the environment you are conducting payment for. Our API aims to be flexible enough to cater for these structures. Our integration team will aid you in providing the necessary data to transact. ### E-commerce workflows For E-commerce transactions requiring 3DSv1 and 3DSv2 transactions, the API contains a fully accredited in built mechanism to handle authentication. The gateway has been accredited extensively with both Acquirers and Card Schemes and simplifies the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditation with Visa and MasterCard. 3D-secure has been around for a number of years and aims to shift the liability of a transaction away from a merchant back to the card holder. A *liability shift* determines whether a card holder can charge back a transaction as unknown. Effectively the process asks for a card holder to authenticate the transaction prior to authorisation producing a Cardholder verification value (CAVV) as evidence of authorisation. #### 3DSv1 &#x60;&#x60;&#x60;json { \&quot;AuthenticationRequired\&quot;: { \&quot;acsurl\&quot;: \&quot;https://bank.com/3DS/ACS\&quot;, \&quot;pareq\&quot;: \&quot;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\&quot;, \&quot;md\&quot;: \&quot;WQgZXZlcnl0aGluZyBiZW\&quot; } } &#x60;&#x60;&#x60; &#x60;&#x60;&#x60;xml &lt;AuthenticationRequired&gt; &lt;acsurl&gt;https://bank.com/3DS/ACS&lt;/acsurl&gt; &lt;pareq&gt;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...&lt;/pareq&gt; &lt;md&gt;WQgZXZlcnl0aGluZyBiZW&lt;/md&gt; &lt;/AuthenticationRequired&gt; &#x60;&#x60;&#x60; For E-commerce transactions requiring 3DSv1, the API contains a built in MPI which will be called to check whether the card is participating in 3DSv1 with Verified by Visa or MasterCard SecureCode. We only support Amex SafeKey with 3DSv2. Should the card be enrolled, a payer request (PAReq) value will be created and returned back as an [authentication required](#authenticationrequired) response object. Your system will need to process this authentication packet and forward the user&#39;s browser to an authentication server (ACS) to gain the user&#39;s authentication. Once complete, the ACS will produce a HTTP &#x60;POST&#x60; call back to the URL supplied in the authentication request as &#x60;merchant_termurl&#x60;. This URL should behave as a controller and handle the post data from the ACS and on a forked server to server HTTP request, forward this data to the [pares authentication url](#pares) for subsequent authorisation processing. You may prefer to provide a processing page whilst this is being processed. Processing with our systems should be relatively quick and be between 500ms - 3000ms however it is desirable to let the user see that something is happening rather than a pending browser. The main reason for ensuring that this controller is two fold: 1. We are never in control of the user&#39;s browser in a server API call 2. The controller is actioned on your site to ensure that any post actions from authorisation can be executed in real time To forward the user to the ACS, we recommend a simple auto submit HTML form. &#x60;&#x60;&#x60;html &lt;html lang&#x3D;\&quot;en\&quot;&gt; &lt;head&gt; &lt;title&gt;Forward to ACS&lt;/title&gt; &lt;script type&#x3D;\&quot;text/javascript\&quot;&gt; function onLoadEvent() { document.acs.submit(); } &lt;/script&gt; &lt;noscript&gt;You will require JavaScript to be enabled to complete this transaction&lt;/noscript&gt; &lt;/head&gt; &lt;body onload&#x3D;\&quot;onLoadEvent();\&quot;&gt; &lt;form name&#x3D;\&quot;acs\&quot; action&#x3D;\&quot;{{ACSURL from Response}}\&quot; method&#x3D;\&quot;POST\&quot;&gt; &lt;input type&#x3D;\&quot;hidden\&quot; name&#x3D;\&quot;PaReq\&quot; value&#x3D;\&quot;{{PaReq Packet from Response}}\&quot; /&gt; &lt;input type&#x3D;\&quot;hidden\&quot; name&#x3D;\&quot;TermUrl\&quot; value&#x3D;\&quot;{{Your Controller}}\&quot; /&gt; &lt;input type&#x3D;\&quot;hidden\&quot; name&#x3D;\&quot;MD\&quot; value&#x3D;\&quot;{{MD From Response}}\&quot; /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &#x60;&#x60;&#x60; Please note that 3DSv1 is being phased out due to changes to strong customer authentication mechanisms. 3DSv2 addresses this and will solidify the authorisation and confirmation process. We provide a Test ACS for full 3DSv1 integration testing that simulates an ACS. #### 3DSv2 &#x60;&#x60;&#x60;json { \&quot;RequestChallenged\&quot;: { \&quot;acsurl\&quot;: \&quot;https://bank.com/3DS/ACS\&quot;, \&quot;creq\&quot;: \&quot;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\&quot; } } &#x60;&#x60;&#x60; &#x60;&#x60;&#x60;xml &lt;RequestChallenged&gt; &lt;acsurl&gt;https://bank.com/3DS/ACS&lt;/acsurl&gt; &lt;creq&gt;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...&lt;/creq&gt; &lt;/RequestChallenged&gt; &#x60;&#x60;&#x60; All merchants in the EEC will require to migrate their E-commerce transactions to a secure customer authentication model (SCA) throughout 2020. This has been adopted by the payment&#39;s industry as a progressive move alongside the European Unions payments service directive. CityPay support 3DSv2 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.0 and will be rolling out acquirers on the new platform from Q2 2020. The new enhancement to 3DSv2 will allow for CityPay to seamlessly authenticate transactions in a \&quot;frictionless\&quot; flowed method which will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of the merchant and cardholder. For these transactions you will not be required to change anything. However, should a transaction be \&quot;challenged\&quot; the API will return a [request challenge](#requestchallenged) which will require your integration to forward the cardholder&#39;s browser to the given [ACS url](#acsurl) by posting the [creq](#creq) value. Once complete, the ACS will have already been in touch with our servers by sending us a result of the authentication known as &#x60;RReq&#x60;. Our servers however will await confirmation that the authorisation should continue and on receipt of a [cres](#cres) value, the flow will perform full authorisation processing. Please note that the CRes returned to us is purely a mechanism of acknowledging that transactions should be committed for authorisation. The ACS by this point will have sent us the verification value (CAVV) to perform a liability shift. The CRes value will be validated for receipt of the CAVV and subsequently may return back response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. &#x60;&#x60;&#x60;html &lt;html lang&#x3D;\&quot;en\&quot;&gt; &lt;head&gt; &lt;title&gt;Forward to ACS&lt;/title&gt; &lt;script type&#x3D;\&quot;text/javascript\&quot;&gt; function onLoadEvent() { document.acs.submit(); } &lt;/script&gt; &lt;noscript&gt;You will require JavaScript to be enabled to complete this transaction&lt;/noscript&gt; &lt;/head&gt; &lt;body onload&#x3D;\&quot;onLoadEvent();\&quot;&gt; &lt;form name&#x3D;\&quot;acs\&quot; action&#x3D;\&quot;{{ACSURL from Response}}\&quot; method&#x3D;\&quot;POST\&quot;&gt; &lt;input type&#x3D;\&quot;hidden\&quot; name&#x3D;\&quot;creq\&quot; value&#x3D;\&quot;{{CReq Packet from Response}}\&quot; /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &#x60;&#x60;&#x60; We are currently working on an integration test suite for 3DSv2 which will mock the ACS challenge process.
33
- # @param auth_request [AuthRequest]
34
- # @param [Hash] opts the optional parameters
35
- # @return [Array<(Decision, Integer, Hash)>] Decision data, response status code and response headers
36
- def authorisation_request_with_http_info(auth_request, opts = {})
37
- if @api_client.config.debugging
38
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.authorisation_request ...'
39
- end
40
- # verify the required parameter 'auth_request' is set
41
- if @api_client.config.client_side_validation && auth_request.nil?
42
- fail ArgumentError, "Missing the required parameter 'auth_request' when calling PaymentProcessingApi.authorisation_request"
43
- end
44
- # resource path
45
- local_var_path = '/authorise'
46
-
47
- # query parameters
48
- query_params = opts[:query_params] || {}
49
-
50
- # header parameters
51
- header_params = opts[:header_params] || {}
52
- # HTTP header 'Accept' (if needed)
53
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
54
- # HTTP header 'Content-Type'
55
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
56
-
57
- # form parameters
58
- form_params = opts[:form_params] || {}
59
-
60
- # http body (model)
61
- post_body = opts[:body] || @api_client.object_to_http_body(auth_request)
62
-
63
- # return_type
64
- return_type = opts[:return_type] || 'Decision'
65
-
66
- # auth_names
67
- auth_names = opts[:auth_names] || ['cp-api-key']
68
-
69
- new_options = opts.merge(
70
- :header_params => header_params,
71
- :query_params => query_params,
72
- :form_params => form_params,
73
- :body => post_body,
74
- :auth_names => auth_names,
75
- :return_type => return_type
76
- )
77
-
78
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
79
- if @api_client.config.debugging
80
- @api_client.config.logger.debug "API called: PaymentProcessingApi#authorisation_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
- end
82
- return data, status_code, headers
83
- end
84
-
85
- # CRes
86
- # The CRes request performs authorisation processing once a challenge request has been completed with an Authentication Server (ACS). This challenge response contains confirmation that will allow the API systems to return an authorisation response based on the result. Our systems will know out of band via an `RReq` call by the ACS to notify us if the liability shift has been issued. Any call to the CRes operation will require a previous authorisation request and cannot be called on its own without a previous [request challenge](#requestchallenged) being obtained.
87
- # @param c_res_auth_request [CResAuthRequest]
88
- # @param [Hash] opts the optional parameters
89
- # @return [AuthResponse]
90
- def c_res_request(c_res_auth_request, opts = {})
91
- data, _status_code, _headers = c_res_request_with_http_info(c_res_auth_request, opts)
92
- data
93
- end
94
-
95
- # CRes
96
- # The CRes request performs authorisation processing once a challenge request has been completed with an Authentication Server (ACS). This challenge response contains confirmation that will allow the API systems to return an authorisation response based on the result. Our systems will know out of band via an &#x60;RReq&#x60; call by the ACS to notify us if the liability shift has been issued. Any call to the CRes operation will require a previous authorisation request and cannot be called on its own without a previous [request challenge](#requestchallenged) being obtained.
97
- # @param c_res_auth_request [CResAuthRequest]
98
- # @param [Hash] opts the optional parameters
99
- # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
100
- def c_res_request_with_http_info(c_res_auth_request, opts = {})
101
- if @api_client.config.debugging
102
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.c_res_request ...'
103
- end
104
- # verify the required parameter 'c_res_auth_request' is set
105
- if @api_client.config.client_side_validation && c_res_auth_request.nil?
106
- fail ArgumentError, "Missing the required parameter 'c_res_auth_request' when calling PaymentProcessingApi.c_res_request"
107
- end
108
- # resource path
109
- local_var_path = '/cres'
110
-
111
- # query parameters
112
- query_params = opts[:query_params] || {}
113
-
114
- # header parameters
115
- header_params = opts[:header_params] || {}
116
- # HTTP header 'Accept' (if needed)
117
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
118
- # HTTP header 'Content-Type'
119
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
120
-
121
- # form parameters
122
- form_params = opts[:form_params] || {}
123
-
124
- # http body (model)
125
- post_body = opts[:body] || @api_client.object_to_http_body(c_res_auth_request)
126
-
127
- # return_type
128
- return_type = opts[:return_type] || 'AuthResponse'
129
-
130
- # auth_names
131
- auth_names = opts[:auth_names] || ['cp-api-key']
132
-
133
- new_options = opts.merge(
134
- :header_params => header_params,
135
- :query_params => query_params,
136
- :form_params => form_params,
137
- :body => post_body,
138
- :auth_names => auth_names,
139
- :return_type => return_type
140
- )
141
-
142
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
143
- if @api_client.config.debugging
144
- @api_client.config.logger.debug "API called: PaymentProcessingApi#c_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
145
- end
146
- return data, status_code, headers
147
- end
148
-
149
- # Capture
150
- # _The capture process only applies to transactions which have been pre-authorised only._ The capture process will ensure that a transaction will now settle. It is expected that a capture call will be provided within 3 days or a maximum of 7 days. A capture request is provided to confirm that you wish the transaction to be settled. This request can contain a final amount for the transaction which is different to the original authorisation amount. This may be useful in a delayed system process such as waiting for stock to be ordered, confirmed, or services provided before the final cost is known. When a transaction is completed, a new authorisation code may be created and a new confirmation can be sent online to the acquiring bank. Once the transaction has been processed. A standard [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction. On a successful completion process, the transaction will be available for the settlement and completed at the end of the day.
151
- # @param capture_request [CaptureRequest]
152
- # @param [Hash] opts the optional parameters
153
- # @return [Acknowledgement]
154
- def capture_request(capture_request, opts = {})
155
- data, _status_code, _headers = capture_request_with_http_info(capture_request, opts)
156
- data
157
- end
158
-
159
- # Capture
160
- # _The capture process only applies to transactions which have been pre-authorised only._ The capture process will ensure that a transaction will now settle. It is expected that a capture call will be provided within 3 days or a maximum of 7 days. A capture request is provided to confirm that you wish the transaction to be settled. This request can contain a final amount for the transaction which is different to the original authorisation amount. This may be useful in a delayed system process such as waiting for stock to be ordered, confirmed, or services provided before the final cost is known. When a transaction is completed, a new authorisation code may be created and a new confirmation can be sent online to the acquiring bank. Once the transaction has been processed. A standard [&#x60;Acknowledgement&#x60;](#acknowledgement) will be returned, outlining the result of the transaction. On a successful completion process, the transaction will be available for the settlement and completed at the end of the day.
161
- # @param capture_request [CaptureRequest]
162
- # @param [Hash] opts the optional parameters
163
- # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
164
- def capture_request_with_http_info(capture_request, opts = {})
165
- if @api_client.config.debugging
166
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.capture_request ...'
167
- end
168
- # verify the required parameter 'capture_request' is set
169
- if @api_client.config.client_side_validation && capture_request.nil?
170
- fail ArgumentError, "Missing the required parameter 'capture_request' when calling PaymentProcessingApi.capture_request"
171
- end
172
- # resource path
173
- local_var_path = '/capture'
174
-
175
- # query parameters
176
- query_params = opts[:query_params] || {}
177
-
178
- # header parameters
179
- header_params = opts[:header_params] || {}
180
- # HTTP header 'Accept' (if needed)
181
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
182
- # HTTP header 'Content-Type'
183
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
184
-
185
- # form parameters
186
- form_params = opts[:form_params] || {}
187
-
188
- # http body (model)
189
- post_body = opts[:body] || @api_client.object_to_http_body(capture_request)
190
-
191
- # return_type
192
- return_type = opts[:return_type] || 'Acknowledgement'
193
-
194
- # auth_names
195
- auth_names = opts[:auth_names] || ['cp-api-key']
196
-
197
- new_options = opts.merge(
198
- :header_params => header_params,
199
- :query_params => query_params,
200
- :form_params => form_params,
201
- :body => post_body,
202
- :auth_names => auth_names,
203
- :return_type => return_type
204
- )
205
-
206
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
207
- if @api_client.config.debugging
208
- @api_client.config.logger.debug "API called: PaymentProcessingApi#capture_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
- end
210
- return data, status_code, headers
211
- end
212
-
213
- # PaRes
214
- # The Payer Authentication Response (PaRes) is an operation after the result of authentication being performed. The request uses an encoded packet of authentication data to notify us of the completion of the liability shift. Once this value has been unpacked and its signature is checked, our systems will proceed to authorisation processing. Any call to the PaRes operation will require a previous authorisation request and cannot be called on its own without a previous [authentication required](#authenticationrequired) being obtained.
215
- # @param pa_res_auth_request [PaResAuthRequest]
216
- # @param [Hash] opts the optional parameters
217
- # @return [AuthResponse]
218
- def pa_res_request(pa_res_auth_request, opts = {})
219
- data, _status_code, _headers = pa_res_request_with_http_info(pa_res_auth_request, opts)
220
- data
221
- end
222
-
223
- # PaRes
224
- # The Payer Authentication Response (PaRes) is an operation after the result of authentication being performed. The request uses an encoded packet of authentication data to notify us of the completion of the liability shift. Once this value has been unpacked and its signature is checked, our systems will proceed to authorisation processing. Any call to the PaRes operation will require a previous authorisation request and cannot be called on its own without a previous [authentication required](#authenticationrequired) being obtained.
225
- # @param pa_res_auth_request [PaResAuthRequest]
226
- # @param [Hash] opts the optional parameters
227
- # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
228
- def pa_res_request_with_http_info(pa_res_auth_request, opts = {})
229
- if @api_client.config.debugging
230
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.pa_res_request ...'
231
- end
232
- # verify the required parameter 'pa_res_auth_request' is set
233
- if @api_client.config.client_side_validation && pa_res_auth_request.nil?
234
- fail ArgumentError, "Missing the required parameter 'pa_res_auth_request' when calling PaymentProcessingApi.pa_res_request"
235
- end
236
- # resource path
237
- local_var_path = '/pares'
238
-
239
- # query parameters
240
- query_params = opts[:query_params] || {}
241
-
242
- # header parameters
243
- header_params = opts[:header_params] || {}
244
- # HTTP header 'Accept' (if needed)
245
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
246
- # HTTP header 'Content-Type'
247
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
248
-
249
- # form parameters
250
- form_params = opts[:form_params] || {}
251
-
252
- # http body (model)
253
- post_body = opts[:body] || @api_client.object_to_http_body(pa_res_auth_request)
254
-
255
- # return_type
256
- return_type = opts[:return_type] || 'AuthResponse'
257
-
258
- # auth_names
259
- auth_names = opts[:auth_names] || ['cp-api-key']
260
-
261
- new_options = opts.merge(
262
- :header_params => header_params,
263
- :query_params => query_params,
264
- :form_params => form_params,
265
- :body => post_body,
266
- :auth_names => auth_names,
267
- :return_type => return_type
268
- )
269
-
270
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
271
- if @api_client.config.debugging
272
- @api_client.config.logger.debug "API called: PaymentProcessingApi#pa_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
273
- end
274
- return data, status_code, headers
275
- end
276
-
277
- # Retrieval
278
- # A retrieval request which allows an integration to obtain the result of a transaction processed in the last 90 days. The request allows for retrieval based on the identifier or transaction number. The process may return multiple results in particular where a transaction was processed multiple times against the same identifier. This can happen if errors were first received. The API therefore returns up to the first 5 transactions in the latest date time order. It is not intended for this operation to be a replacement for reporting and only allows for base transaction information to be returned.
279
- # @param retrieve_request [RetrieveRequest]
280
- # @param [Hash] opts the optional parameters
281
- # @return [AuthReferences]
282
- def retrieval_request(retrieve_request, opts = {})
283
- data, _status_code, _headers = retrieval_request_with_http_info(retrieve_request, opts)
284
- data
285
- end
286
-
287
- # Retrieval
288
- # A retrieval request which allows an integration to obtain the result of a transaction processed in the last 90 days. The request allows for retrieval based on the identifier or transaction number. The process may return multiple results in particular where a transaction was processed multiple times against the same identifier. This can happen if errors were first received. The API therefore returns up to the first 5 transactions in the latest date time order. It is not intended for this operation to be a replacement for reporting and only allows for base transaction information to be returned.
289
- # @param retrieve_request [RetrieveRequest]
290
- # @param [Hash] opts the optional parameters
291
- # @return [Array<(AuthReferences, Integer, Hash)>] AuthReferences data, response status code and response headers
292
- def retrieval_request_with_http_info(retrieve_request, opts = {})
293
- if @api_client.config.debugging
294
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.retrieval_request ...'
295
- end
296
- # verify the required parameter 'retrieve_request' is set
297
- if @api_client.config.client_side_validation && retrieve_request.nil?
298
- fail ArgumentError, "Missing the required parameter 'retrieve_request' when calling PaymentProcessingApi.retrieval_request"
299
- end
300
- # resource path
301
- local_var_path = '/retrieve'
302
-
303
- # query parameters
304
- query_params = opts[:query_params] || {}
305
-
306
- # header parameters
307
- header_params = opts[:header_params] || {}
308
- # HTTP header 'Accept' (if needed)
309
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
310
- # HTTP header 'Content-Type'
311
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
312
-
313
- # form parameters
314
- form_params = opts[:form_params] || {}
315
-
316
- # http body (model)
317
- post_body = opts[:body] || @api_client.object_to_http_body(retrieve_request)
318
-
319
- # return_type
320
- return_type = opts[:return_type] || 'AuthReferences'
321
-
322
- # auth_names
323
- auth_names = opts[:auth_names] || ['cp-api-key']
324
-
325
- new_options = opts.merge(
326
- :header_params => header_params,
327
- :query_params => query_params,
328
- :form_params => form_params,
329
- :body => post_body,
330
- :auth_names => auth_names,
331
- :return_type => return_type
332
- )
333
-
334
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
335
- if @api_client.config.debugging
336
- @api_client.config.logger.debug "API called: PaymentProcessingApi#retrieval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
337
- end
338
- return data, status_code, headers
339
- end
340
-
341
- # Void
342
- # _The void process generally applies to transactions which have been pre-authorised only however voids can occur on the same day if performed before batching and settlement._ The void process will ensure that a transaction will now settle. It is expected that a void call will be provided on the same day before batching and settlement or within 3 days or within a maximum of 7 days. Once the transaction has been processed as a void, an [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction.
343
- # @param void_request [VoidRequest]
344
- # @param [Hash] opts the optional parameters
345
- # @return [Acknowledgement]
346
- def void_request(void_request, opts = {})
347
- data, _status_code, _headers = void_request_with_http_info(void_request, opts)
348
- data
349
- end
350
-
351
- # Void
352
- # _The void process generally applies to transactions which have been pre-authorised only however voids can occur on the same day if performed before batching and settlement._ The void process will ensure that a transaction will now settle. It is expected that a void call will be provided on the same day before batching and settlement or within 3 days or within a maximum of 7 days. Once the transaction has been processed as a void, an [&#x60;Acknowledgement&#x60;](#acknowledgement) will be returned, outlining the result of the transaction.
353
- # @param void_request [VoidRequest]
354
- # @param [Hash] opts the optional parameters
355
- # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
356
- def void_request_with_http_info(void_request, opts = {})
357
- if @api_client.config.debugging
358
- @api_client.config.logger.debug 'Calling API: PaymentProcessingApi.void_request ...'
359
- end
360
- # verify the required parameter 'void_request' is set
361
- if @api_client.config.client_side_validation && void_request.nil?
362
- fail ArgumentError, "Missing the required parameter 'void_request' when calling PaymentProcessingApi.void_request"
363
- end
364
- # resource path
365
- local_var_path = '/void'
366
-
367
- # query parameters
368
- query_params = opts[:query_params] || {}
369
-
370
- # header parameters
371
- header_params = opts[:header_params] || {}
372
- # HTTP header 'Accept' (if needed)
373
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
374
- # HTTP header 'Content-Type'
375
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
376
-
377
- # form parameters
378
- form_params = opts[:form_params] || {}
379
-
380
- # http body (model)
381
- post_body = opts[:body] || @api_client.object_to_http_body(void_request)
382
-
383
- # return_type
384
- return_type = opts[:return_type] || 'Acknowledgement'
385
-
386
- # auth_names
387
- auth_names = opts[:auth_names] || ['cp-api-key']
388
-
389
- new_options = opts.merge(
390
- :header_params => header_params,
391
- :query_params => query_params,
392
- :form_params => form_params,
393
- :body => post_body,
394
- :auth_names => auth_names,
395
- :return_type => return_type
396
- )
397
-
398
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
399
- if @api_client.config.debugging
400
- @api_client.config.logger.debug "API called: PaymentProcessingApi#void_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
401
- end
402
- return data, status_code, headers
403
- end
404
- end
405
- end
@@ -1,20 +0,0 @@
1
-
2
- require 'citypay_api_client'
3
-
4
- # Setup authorization
5
- CityPayApiClient.configure do |config|
6
- config.api_key['cp-api-key'] = CityPayApiClient::ApiKey.new(client_id: "PC874200", licence_key: "MT8NIRSTN9BHGJI8").generate
7
- config.debugging = true
8
- end
9
-
10
-
11
-
12
- begin
13
- card_holder_instance = CityPayApiClient::CardHolderAccountApi.new
14
- resp = card_holder_instance.account_retrieve_request("b8219879-28fb-4be4-bcb9-6966c8da6559")
15
- p resp
16
- p resp.account_id
17
- p resp.date_created
18
- rescue CityPayApiClient::ApiError => e
19
- puts "Exception when calling CardHolderAccountApi->account_card_delete_request: #{e}"
20
- end