citypay_api_client 1.0.3 → 1.1.2

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 (265) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +111 -39
  3. data/citypay_api_client.gemspec +5 -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 +52 -49
  14. data/docs/AuthResponse.md +64 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +850 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +218 -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 +44 -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 +387 -111
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +38 -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 +389 -0
  37. data/docs/DirectPostRequest.md +60 -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/OperationalFunctionsApi.md +375 -0
  50. data/docs/PaResAuthRequest.md +10 -9
  51. data/docs/PaylinkAddress.md +30 -0
  52. data/docs/PaylinkAdjustmentRequest.md +22 -0
  53. data/docs/PaylinkApi.md +806 -0
  54. data/docs/PaylinkAttachmentRequest.md +26 -0
  55. data/docs/PaylinkAttachmentResult.md +22 -0
  56. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  57. data/docs/PaylinkCardHolder.md +36 -0
  58. data/docs/PaylinkCart.md +30 -0
  59. data/docs/PaylinkCartItemModel.md +32 -0
  60. data/docs/PaylinkConfig.md +60 -0
  61. data/docs/PaylinkCustomParam.md +38 -0
  62. data/docs/PaylinkEmailNotificationPath.md +26 -0
  63. data/docs/PaylinkErrorCode.md +20 -0
  64. data/docs/PaylinkFieldGuardModel.md +30 -0
  65. data/docs/PaylinkPartPayments.md +28 -0
  66. data/docs/PaylinkSMSNotificationPath.md +20 -0
  67. data/docs/PaylinkStateEvent.md +22 -0
  68. data/docs/PaylinkTokenCreated.md +44 -0
  69. data/docs/PaylinkTokenRequestModel.md +42 -0
  70. data/docs/PaylinkTokenStatus.md +72 -0
  71. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  72. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  73. data/docs/PaylinkUI.md +24 -0
  74. data/docs/Ping.md +8 -7
  75. data/docs/ProcessBatchRequest.md +24 -0
  76. data/docs/ProcessBatchResponse.md +20 -0
  77. data/docs/RefundRequest.md +26 -0
  78. data/docs/RegisterCard.md +16 -13
  79. data/docs/RequestChallenged.md +16 -15
  80. data/docs/RetrieveRequest.md +12 -11
  81. data/docs/ThreeDSecure.md +32 -15
  82. data/docs/TokenisationResponseModel.md +36 -0
  83. data/docs/VoidRequest.md +12 -13
  84. data/docs/images/3dsv1-challenge.png +0 -0
  85. data/docs/images/3dsv2-challenge.png +0 -0
  86. data/docs/images/3dsv2-frictionless.png +0 -0
  87. data/docs/images/3dsv2-method-challenge.png +0 -0
  88. data/docs/images/3dsv2-method-frictionless.png +0 -0
  89. data/docs/images/3dsv2-no3d.png +0 -0
  90. data/docs/images/citypay-logo.svg +1 -0
  91. data/docs/images/direct-post-flow.png +0 -0
  92. data/docs/images/favicon.ico +0 -0
  93. data/docs/images/header.png +0 -0
  94. data/docs/images/logo.ai +1913 -4
  95. data/docs/images/logo.png +0 -0
  96. data/docs/images/logo.svg +1 -0
  97. data/docs/images/merchant-BPS-workflow.png +0 -0
  98. data/docs/images/paylink-field-guards.png +0 -0
  99. data/lib/.DS_Store +0 -0
  100. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  101. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  102. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  103. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  104. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  105. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  106. data/lib/citypay_api_client/api_client.rb +72 -70
  107. data/lib/citypay_api_client/api_error.rb +3 -2
  108. data/lib/citypay_api_client/configuration.rb +74 -17
  109. data/lib/citypay_api_client/models/account_create.rb +33 -23
  110. data/lib/citypay_api_client/models/account_status.rb +31 -23
  111. data/lib/citypay_api_client/models/acknowledgement.rb +43 -27
  112. data/lib/citypay_api_client/models/acl_check_request.rb +221 -0
  113. data/lib/citypay_api_client/models/acl_check_response_model.rb +244 -0
  114. data/lib/citypay_api_client/models/airline_advice.rb +63 -34
  115. data/lib/citypay_api_client/models/airline_segment.rb +51 -25
  116. data/lib/citypay_api_client/models/auth_reference.rb +80 -31
  117. data/lib/citypay_api_client/models/auth_references.rb +31 -23
  118. data/lib/citypay_api_client/models/auth_request.rb +137 -56
  119. data/lib/citypay_api_client/models/auth_response.rb +83 -123
  120. data/lib/citypay_api_client/models/authen_required.rb +31 -23
  121. data/lib/citypay_api_client/models/batch.rb +267 -0
  122. data/lib/citypay_api_client/models/batch_report_request.rb +278 -0
  123. data/lib/citypay_api_client/models/batch_report_response_model.rb +364 -0
  124. data/lib/citypay_api_client/models/batch_transaction.rb +324 -0
  125. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +452 -0
  126. data/lib/citypay_api_client/models/bin.rb +294 -0
  127. data/lib/citypay_api_client/models/bin_lookup.rb +231 -0
  128. data/lib/citypay_api_client/models/c_res_auth_request.rb +31 -23
  129. data/lib/citypay_api_client/models/capture_request.rb +59 -38
  130. data/lib/citypay_api_client/models/card.rb +93 -29
  131. data/lib/citypay_api_client/models/card_holder_account.rb +49 -27
  132. data/lib/citypay_api_client/models/card_status.rb +31 -23
  133. data/lib/citypay_api_client/models/charge_request.rb +154 -47
  134. data/lib/citypay_api_client/models/check_batch_status.rb +260 -0
  135. data/lib/citypay_api_client/models/check_batch_status_response.rb +215 -0
  136. data/lib/citypay_api_client/models/contact_details.rb +130 -52
  137. data/lib/citypay_api_client/models/decision.rb +31 -23
  138. data/lib/citypay_api_client/models/direct_post_request.rb +707 -0
  139. data/lib/citypay_api_client/models/direct_token_auth_request.rb +244 -0
  140. data/lib/citypay_api_client/models/domain_key_check_request.rb +249 -0
  141. data/lib/citypay_api_client/models/domain_key_request.rb +249 -0
  142. data/lib/citypay_api_client/models/domain_key_response.rb +297 -0
  143. data/lib/citypay_api_client/models/error.rb +57 -31
  144. data/lib/citypay_api_client/models/event_data_model.rb +254 -0
  145. data/lib/citypay_api_client/models/exists.rb +241 -0
  146. data/lib/citypay_api_client/models/external_mpi.rb +61 -27
  147. data/lib/citypay_api_client/models/list_merchants_response.rb +37 -25
  148. data/lib/citypay_api_client/models/mcc6012.rb +31 -23
  149. data/lib/citypay_api_client/models/merchant.rb +31 -23
  150. data/lib/citypay_api_client/models/pa_res_auth_request.rb +36 -24
  151. data/lib/citypay_api_client/models/paylink_address.rb +425 -0
  152. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +272 -0
  153. data/lib/citypay_api_client/models/paylink_attachment_request.rb +268 -0
  154. data/lib/citypay_api_client/models/paylink_attachment_result.rb +248 -0
  155. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +289 -0
  156. data/lib/citypay_api_client/models/paylink_card_holder.rb +360 -0
  157. data/lib/citypay_api_client/models/paylink_cart.rb +275 -0
  158. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +284 -0
  159. data/lib/citypay_api_client/models/paylink_config.rb +428 -0
  160. data/lib/citypay_api_client/models/paylink_custom_param.rb +321 -0
  161. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +265 -0
  162. data/lib/citypay_api_client/models/paylink_error_code.rb +238 -0
  163. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +274 -0
  164. data/lib/citypay_api_client/models/paylink_part_payments.rb +264 -0
  165. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +231 -0
  166. data/lib/citypay_api_client/models/paylink_state_event.rb +234 -0
  167. data/lib/citypay_api_client/models/paylink_token_created.rb +365 -0
  168. data/lib/citypay_api_client/models/paylink_token_request_model.rb +427 -0
  169. data/lib/citypay_api_client/models/paylink_token_status.rb +485 -0
  170. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +269 -0
  171. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +232 -0
  172. data/lib/citypay_api_client/models/paylink_ui.rb +244 -0
  173. data/lib/citypay_api_client/models/ping.rb +37 -25
  174. data/lib/citypay_api_client/models/process_batch_request.rb +313 -0
  175. data/lib/citypay_api_client/models/process_batch_response.rb +231 -0
  176. data/lib/citypay_api_client/models/refund_request.rb +339 -0
  177. data/lib/citypay_api_client/models/register_card.rb +79 -27
  178. data/lib/citypay_api_client/models/request_challenged.rb +39 -31
  179. data/lib/citypay_api_client/models/retrieve_request.rb +39 -25
  180. data/lib/citypay_api_client/models/three_d_secure.rb +116 -28
  181. data/lib/citypay_api_client/models/tokenisation_response_model.rb +332 -0
  182. data/lib/citypay_api_client/models/void_request.rb +39 -37
  183. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  184. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  185. data/lib/citypay_api_client/version.rb +3 -4
  186. data/lib/citypay_api_client.rb +53 -6
  187. data/spec/.DS_Store +0 -0
  188. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  189. data/spec/api/batch_processing_api___spec.rb +70 -0
  190. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  191. data/spec/api/direct_post_api___spec.rb +98 -0
  192. data/spec/api/operational_functions_api___spec.rb +94 -0
  193. data/spec/api/paylink_api___spec.rb +131 -0
  194. data/spec/api_client_spec.rb +4 -4
  195. data/spec/configuration_spec.rb +5 -5
  196. data/spec/it_api_sandbox_spec.rb +117 -55
  197. data/spec/models/account_create_spec.rb +1 -2
  198. data/spec/models/account_status_spec.rb +2 -2
  199. data/spec/models/acknowledgement_spec.rb +7 -22
  200. data/spec/models/acl_check_request_spec.rb +33 -0
  201. data/spec/models/acl_check_response_model_spec.rb +51 -0
  202. data/spec/models/airline_advice_spec.rb +0 -2
  203. data/spec/models/airline_segment_spec.rb +0 -2
  204. data/spec/models/auth_references_spec.rb +7 -8
  205. data/spec/models/auth_request_spec.rb +0 -2
  206. data/spec/models/auth_response_spec.rb +77 -33
  207. data/spec/models/batch_report_request_spec.rb +37 -0
  208. data/spec/models/batch_report_response_model_spec.rb +61 -0
  209. data/spec/models/batch_spec.rb +43 -0
  210. data/spec/models/batch_transaction_result_model_spec.rb +85 -0
  211. data/spec/models/batch_transaction_spec.rb +49 -0
  212. data/spec/models/bin_lookup_spec.rb +31 -0
  213. data/spec/models/bin_spec.rb +81 -0
  214. data/spec/models/capture_request_spec.rb +0 -2
  215. data/spec/models/card_holder_account_spec.rb +8 -7
  216. data/spec/models/charge_request_spec.rb +0 -2
  217. data/spec/models/check_batch_status_response_spec.rb +45 -0
  218. data/spec/models/check_batch_status_spec.rb +39 -0
  219. data/spec/models/decision_spec.rb +1 -1
  220. data/spec/models/direct_post_request_spec.rb +151 -0
  221. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  222. data/spec/models/domain_key_check_request_spec.rb +31 -0
  223. data/spec/models/domain_key_request_spec.rb +45 -0
  224. data/spec/models/domain_key_response_spec.rb +57 -0
  225. data/spec/models/event_data_model_spec.rb +57 -0
  226. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  227. data/spec/models/list_merchants_response_spec.rb +2 -2
  228. data/spec/models/paylink_address_spec.rb +69 -0
  229. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  230. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  231. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  232. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  233. data/spec/models/paylink_card_holder_spec.rb +87 -0
  234. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  235. data/spec/models/paylink_cart_spec.rb +69 -0
  236. data/spec/models/paylink_config_spec.rb +159 -0
  237. data/spec/models/paylink_custom_param_spec.rb +87 -0
  238. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  239. data/spec/models/paylink_error_code_spec.rb +39 -0
  240. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  241. data/spec/models/paylink_part_payments_spec.rb +63 -0
  242. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  243. data/spec/models/paylink_state_event_spec.rb +45 -0
  244. data/spec/models/paylink_token_created_spec.rb +111 -0
  245. data/spec/models/paylink_token_request_model_spec.rb +91 -0
  246. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  247. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  248. data/spec/models/paylink_token_status_spec.rb +195 -0
  249. data/spec/models/paylink_ui_spec.rb +51 -0
  250. data/spec/models/process_batch_request_spec.rb +49 -0
  251. data/spec/models/process_batch_response_spec.rb +39 -0
  252. data/spec/models/refund_request_spec.rb +62 -0
  253. data/spec/models/register_card_spec.rb +0 -2
  254. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  255. data/spec/spec_helper.rb +2 -2
  256. data/spec/utils/direct_post_mac_spec.rb +13 -0
  257. metadata +230 -44
  258. data/Gemfile.lock +0 -70
  259. data/docs/OperationalApi.md +0 -112
  260. data/docs/PaymentProcessingApi.md +0 -320
  261. data/git_push.sh +0 -58
  262. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  263. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  264. data/lib/citypay_api_client/test.rb +0 -20
  265. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,565 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is an 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 tokenized payments using cardholder Accounts. ## Compliance and Security 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. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#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 cardholder 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: 7.2.0
9
+
10
+ =end
11
+
12
+ require 'cgi'
13
+
14
+ module CityPayApiClient
15
+ class AuthorisationAndPaymentApi
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. ```json { \"RequestChallenged\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"creq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\", \"merchantid\": 12345, \"transno\": 1, \"threedserver_trans_id\": \"d652d8d2-d74a-4264-a051-a7862b10d5d6\" } } ``` ## E-commerce workflows For E-commerce transactions requiring 3DS, the API contains a fully accredited in built mechanism to handle authentication. The Api and gateway has been accredited extensively with both Acquirers and Card Schemes to simplify the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditations 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 cardholder. 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) and ecommerce indicator (ECI) as evidence of authorisation. 3DS version 1 has now been replaced by 3DS version 2 to provide secure customer authentication (SCA) in line with EU regulation. 3DSv2 is being phased out and any accounts using version 1 of the protocol is expected to be migrated by March 2022. Any new integrations should only consider 3DSv2 flows. ### 3DSv2 ```json { \"RequestChallenged\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"creq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\", \"merchantid\": 12345, \"transno\": 1, \"threedserver_trans_id\": \"d652d8d2-d74a-4264-a051-a7862b10d5d6\" } } ``` ```xml <RequestChallenged> <acsurl>https://bank.com/3DS/ACS</acsurl> <creq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</creq> <merchantid>12345</merchantid> <transno>1</transno> <threedserver_trans_id>d652d8d2-d74a-4264-a051-a7862b10d5d6</threedserver_trans_id> </RequestChallenged> ``` CityPay support 3DS version 2.1 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.1. Version 2.2 is currently in development however this will be a seamless upgrade for all integrations. #### 3-D Secure - None ![3DSv2 Frctionless Flow](images/3dsv2-no3d.png) A basic flow may involve no 3-D secure processing. This could happen if there is no ability to perform authentication. An enrollment check may apply an \"attempted\" resolution to processing. In this instance a transaction may not meet any liability shift. A transaction may result in a decline due to this. We are also able to prevent from transactions being presented for authorisation if this occurs. #### 3-D Secure - Frictionless ![3DSv2 Frctionless Flow](images/3dsv2-frictionless.png) E-commerce transactions supporting 3DSv2 can benefit from seamlessly authenticated transactions which may perform a \"frictionless\" flow. This method will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of you the developer, the merchant and cardholder. No redirection occurs and hence the flow is called frictionless and will appear as though a simple transaction authorisation has occurred. #### 3-D Secure - Challenge ![3DSv2 Frctionless Flow](images/3dsv2-challenge.png) A transaction that is deemed as higher risk my be \"challenged\". In this instance, 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). This should be performed by posting the [creq](#creq) value (the challenge request 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`. To maintain session state, a parameter `threeDSSessionData` can be posted to the ACS url and will be returned alongside the `CRes` value. This will ensure that any controller code will be able to isolate state between calls. This field is to be used by your own systems rather than ours and may be any value which can uniquely identify your cardholder's session. As an option, we do provide a `threedserver_trans_id` value in the `RequestChallenged` packet which can be used for the `threeDSSessionData` value as it is used to uniquely identify the 3D-Secure session. A common method of maintaining state is to provide a session related query string value in the `merchant_termurl` value (also known as the `notificationUrl`). For example providing a url of `https://mystore.com/checkout?token=asny2348w4561..` could return the user directly back to their session with your environment. Once you have received a `cres` post from the ACS authentication service, this should be POSTed to the [cres](#cres) endpoint to 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 response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. > 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}}\" /> <input type=\"hidden\" name=\"threeDSSessionData\" value=\"{{session-identifier}}\" /> </form> </body> </html> ``` A full ACS test suite is available for 3DSv2 testing. ### Testing 3DSv2 Integrations The API provides a mock 3dsV2 handler which performs a number of scenarios based on the value of the CSC in the request. | CSC Value | Behaviour | |-----------|-----------| | 731 | Frictionless processing - Not authenticated | | 732 | Frictionless processing - Account verification count not be performed | | 733 | Frictionless processing - Verification Rejected | | 741 | Frictionless processing - Attempts Processing | | 750 | Frictionless processing - Authenticated | | 761 | Triggers an error message | | Any | Challenge Request | #### 3DSv1 **Please note that 3DSv1 should now be considered as deprecated.** ```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. > 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.
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. &#x60;&#x60;&#x60;json { \&quot;RequestChallenged\&quot;: { \&quot;acsurl\&quot;: \&quot;https://bank.com/3DS/ACS\&quot;, \&quot;creq\&quot;: \&quot;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\&quot;, \&quot;merchantid\&quot;: 12345, \&quot;transno\&quot;: 1, \&quot;threedserver_trans_id\&quot;: \&quot;d652d8d2-d74a-4264-a051-a7862b10d5d6\&quot; } } &#x60;&#x60;&#x60; ## E-commerce workflows For E-commerce transactions requiring 3DS, the API contains a fully accredited in built mechanism to handle authentication. The Api and gateway has been accredited extensively with both Acquirers and Card Schemes to simplify the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditations 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 cardholder. 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) and ecommerce indicator (ECI) as evidence of authorisation. 3DS version 1 has now been replaced by 3DS version 2 to provide secure customer authentication (SCA) in line with EU regulation. 3DSv2 is being phased out and any accounts using version 1 of the protocol is expected to be migrated by March 2022. Any new integrations should only consider 3DSv2 flows. ### 3DSv2 &#x60;&#x60;&#x60;json { \&quot;RequestChallenged\&quot;: { \&quot;acsurl\&quot;: \&quot;https://bank.com/3DS/ACS\&quot;, \&quot;creq\&quot;: \&quot;SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\&quot;, \&quot;merchantid\&quot;: 12345, \&quot;transno\&quot;: 1, \&quot;threedserver_trans_id\&quot;: \&quot;d652d8d2-d74a-4264-a051-a7862b10d5d6\&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;merchantid&gt;12345&lt;/merchantid&gt; &lt;transno&gt;1&lt;/transno&gt; &lt;threedserver_trans_id&gt;d652d8d2-d74a-4264-a051-a7862b10d5d6&lt;/threedserver_trans_id&gt; &lt;/RequestChallenged&gt; &#x60;&#x60;&#x60; CityPay support 3DS version 2.1 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.1. Version 2.2 is currently in development however this will be a seamless upgrade for all integrations. #### 3-D Secure - None ![3DSv2 Frctionless Flow](images/3dsv2-no3d.png) A basic flow may involve no 3-D secure processing. This could happen if there is no ability to perform authentication. An enrollment check may apply an \&quot;attempted\&quot; resolution to processing. In this instance a transaction may not meet any liability shift. A transaction may result in a decline due to this. We are also able to prevent from transactions being presented for authorisation if this occurs. #### 3-D Secure - Frictionless ![3DSv2 Frctionless Flow](images/3dsv2-frictionless.png) E-commerce transactions supporting 3DSv2 can benefit from seamlessly authenticated transactions which may perform a \&quot;frictionless\&quot; flow. This method will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of you the developer, the merchant and cardholder. No redirection occurs and hence the flow is called frictionless and will appear as though a simple transaction authorisation has occurred. #### 3-D Secure - Challenge ![3DSv2 Frctionless Flow](images/3dsv2-challenge.png) A transaction that is deemed as higher risk my be \&quot;challenged\&quot;. In this instance, 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). This should be performed by posting the [creq](#creq) value (the challenge request 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;. To maintain session state, a parameter &#x60;threeDSSessionData&#x60; can be posted to the ACS url and will be returned alongside the &#x60;CRes&#x60; value. This will ensure that any controller code will be able to isolate state between calls. This field is to be used by your own systems rather than ours and may be any value which can uniquely identify your cardholder&#39;s session. As an option, we do provide a &#x60;threedserver_trans_id&#x60; value in the &#x60;RequestChallenged&#x60; packet which can be used for the &#x60;threeDSSessionData&#x60; value as it is used to uniquely identify the 3D-Secure session. A common method of maintaining state is to provide a session related query string value in the &#x60;merchant_termurl&#x60; value (also known as the &#x60;notificationUrl&#x60;). For example providing a url of &#x60;https://mystore.com/checkout?token&#x3D;asny2348w4561..&#x60; could return the user directly back to their session with your environment. Once you have received a &#x60;cres&#x60; post from the ACS authentication service, this should be POSTed to the [cres](#cres) endpoint to 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 response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. &gt; 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;input type&#x3D;\&quot;hidden\&quot; name&#x3D;\&quot;threeDSSessionData\&quot; value&#x3D;\&quot;{{session-identifier}}\&quot; /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &#x60;&#x60;&#x60; A full ACS test suite is available for 3DSv2 testing. ### Testing 3DSv2 Integrations The API provides a mock 3dsV2 handler which performs a number of scenarios based on the value of the CSC in the request. | CSC Value | Behaviour | |-----------|-----------| | 731 | Frictionless processing - Not authenticated | | 732 | Frictionless processing - Account verification count not be performed | | 733 | Frictionless processing - Verification Rejected | | 741 | Frictionless processing - Attempts Processing | | 750 | Frictionless processing - Authenticated | | 761 | Triggers an error message | | Any | Challenge Request | #### 3DSv1 **Please note that 3DSv1 should now be considered as deprecated.** &#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. &gt; 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.
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: AuthorisationAndPaymentApi.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 AuthorisationAndPaymentApi.authorisation_request"
43
+ end
44
+ # resource path
45
+ local_var_path = '/v6/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
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
56
+ if !content_type.nil?
57
+ header_params['Content-Type'] = content_type
58
+ end
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(auth_request)
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'Decision'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"AuthorisationAndPaymentApi.authorisation_request",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#authorisation_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Bin Lookup
90
+ # A bin range lookup service can be used to check what a card is, as seen by the gateway. Each card number's leading digits help to identify who 0. the card scheme is such as Visa, MasterCard or American Express 1. the issuer of the card, such as the bank 2. it's country of origin 3. it's currency of origin Our gateway has 450 thousand possible bin ranges and uses a number of algorithms to determine the likelihood of the bin data. The request requires a bin value of between 6 and 12 digits. The more digits provided may ensure a more accurate result.
91
+ # @param bin_lookup [BinLookup]
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [Bin]
94
+ def bin_range_lookup_request(bin_lookup, opts = {})
95
+ data, _status_code, _headers = bin_range_lookup_request_with_http_info(bin_lookup, opts)
96
+ data
97
+ end
98
+
99
+ # Bin Lookup
100
+ # A bin range lookup service can be used to check what a card is, as seen by the gateway. Each card number&#39;s leading digits help to identify who 0. the card scheme is such as Visa, MasterCard or American Express 1. the issuer of the card, such as the bank 2. it&#39;s country of origin 3. it&#39;s currency of origin Our gateway has 450 thousand possible bin ranges and uses a number of algorithms to determine the likelihood of the bin data. The request requires a bin value of between 6 and 12 digits. The more digits provided may ensure a more accurate result.
101
+ # @param bin_lookup [BinLookup]
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [Array<(Bin, Integer, Hash)>] Bin data, response status code and response headers
104
+ def bin_range_lookup_request_with_http_info(bin_lookup, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.bin_range_lookup_request ...'
107
+ end
108
+ # verify the required parameter 'bin_lookup' is set
109
+ if @api_client.config.client_side_validation && bin_lookup.nil?
110
+ fail ArgumentError, "Missing the required parameter 'bin_lookup' when calling AuthorisationAndPaymentApi.bin_range_lookup_request"
111
+ end
112
+ # resource path
113
+ local_var_path = '/v6/bin'
114
+
115
+ # query parameters
116
+ query_params = opts[:query_params] || {}
117
+
118
+ # header parameters
119
+ header_params = opts[:header_params] || {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
122
+ # HTTP header 'Content-Type'
123
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
124
+ if !content_type.nil?
125
+ header_params['Content-Type'] = content_type
126
+ end
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(bin_lookup)
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type] || 'Bin'
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
139
+
140
+ new_options = opts.merge(
141
+ :operation => :"AuthorisationAndPaymentApi.bin_range_lookup_request",
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type
148
+ )
149
+
150
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#bin_range_lookup_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers
155
+ end
156
+
157
+ # CRes
158
+ # 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.
159
+ # @param c_res_auth_request [CResAuthRequest]
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [AuthResponse]
162
+ def c_res_request(c_res_auth_request, opts = {})
163
+ data, _status_code, _headers = c_res_request_with_http_info(c_res_auth_request, opts)
164
+ data
165
+ end
166
+
167
+ # CRes
168
+ # 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.
169
+ # @param c_res_auth_request [CResAuthRequest]
170
+ # @param [Hash] opts the optional parameters
171
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
172
+ def c_res_request_with_http_info(c_res_auth_request, opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.c_res_request ...'
175
+ end
176
+ # verify the required parameter 'c_res_auth_request' is set
177
+ if @api_client.config.client_side_validation && c_res_auth_request.nil?
178
+ fail ArgumentError, "Missing the required parameter 'c_res_auth_request' when calling AuthorisationAndPaymentApi.c_res_request"
179
+ end
180
+ # resource path
181
+ local_var_path = '/v6/cres'
182
+
183
+ # query parameters
184
+ query_params = opts[:query_params] || {}
185
+
186
+ # header parameters
187
+ header_params = opts[:header_params] || {}
188
+ # HTTP header 'Accept' (if needed)
189
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
190
+ # HTTP header 'Content-Type'
191
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
192
+ if !content_type.nil?
193
+ header_params['Content-Type'] = content_type
194
+ end
195
+
196
+ # form parameters
197
+ form_params = opts[:form_params] || {}
198
+
199
+ # http body (model)
200
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(c_res_auth_request)
201
+
202
+ # return_type
203
+ return_type = opts[:debug_return_type] || 'AuthResponse'
204
+
205
+ # auth_names
206
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
207
+
208
+ new_options = opts.merge(
209
+ :operation => :"AuthorisationAndPaymentApi.c_res_request",
210
+ :header_params => header_params,
211
+ :query_params => query_params,
212
+ :form_params => form_params,
213
+ :body => post_body,
214
+ :auth_names => auth_names,
215
+ :return_type => return_type
216
+ )
217
+
218
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#c_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+
225
+ # Capture
226
+ # _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.
227
+ # @param capture_request [CaptureRequest]
228
+ # @param [Hash] opts the optional parameters
229
+ # @return [Acknowledgement]
230
+ def capture_request(capture_request, opts = {})
231
+ data, _status_code, _headers = capture_request_with_http_info(capture_request, opts)
232
+ data
233
+ end
234
+
235
+ # Capture
236
+ # _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.
237
+ # @param capture_request [CaptureRequest]
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
240
+ def capture_request_with_http_info(capture_request, opts = {})
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.capture_request ...'
243
+ end
244
+ # verify the required parameter 'capture_request' is set
245
+ if @api_client.config.client_side_validation && capture_request.nil?
246
+ fail ArgumentError, "Missing the required parameter 'capture_request' when calling AuthorisationAndPaymentApi.capture_request"
247
+ end
248
+ # resource path
249
+ local_var_path = '/v6/capture'
250
+
251
+ # query parameters
252
+ query_params = opts[:query_params] || {}
253
+
254
+ # header parameters
255
+ header_params = opts[:header_params] || {}
256
+ # HTTP header 'Accept' (if needed)
257
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
258
+ # HTTP header 'Content-Type'
259
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
260
+ if !content_type.nil?
261
+ header_params['Content-Type'] = content_type
262
+ end
263
+
264
+ # form parameters
265
+ form_params = opts[:form_params] || {}
266
+
267
+ # http body (model)
268
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(capture_request)
269
+
270
+ # return_type
271
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
272
+
273
+ # auth_names
274
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
275
+
276
+ new_options = opts.merge(
277
+ :operation => :"AuthorisationAndPaymentApi.capture_request",
278
+ :header_params => header_params,
279
+ :query_params => query_params,
280
+ :form_params => form_params,
281
+ :body => post_body,
282
+ :auth_names => auth_names,
283
+ :return_type => return_type
284
+ )
285
+
286
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#capture_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+
293
+ # PaRes
294
+ # 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.
295
+ # @param pa_res_auth_request [PaResAuthRequest]
296
+ # @param [Hash] opts the optional parameters
297
+ # @return [AuthResponse]
298
+ def pa_res_request(pa_res_auth_request, opts = {})
299
+ data, _status_code, _headers = pa_res_request_with_http_info(pa_res_auth_request, opts)
300
+ data
301
+ end
302
+
303
+ # PaRes
304
+ # 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.
305
+ # @param pa_res_auth_request [PaResAuthRequest]
306
+ # @param [Hash] opts the optional parameters
307
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
308
+ def pa_res_request_with_http_info(pa_res_auth_request, opts = {})
309
+ if @api_client.config.debugging
310
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.pa_res_request ...'
311
+ end
312
+ # verify the required parameter 'pa_res_auth_request' is set
313
+ if @api_client.config.client_side_validation && pa_res_auth_request.nil?
314
+ fail ArgumentError, "Missing the required parameter 'pa_res_auth_request' when calling AuthorisationAndPaymentApi.pa_res_request"
315
+ end
316
+ # resource path
317
+ local_var_path = '/v6/pares'
318
+
319
+ # query parameters
320
+ query_params = opts[:query_params] || {}
321
+
322
+ # header parameters
323
+ header_params = opts[:header_params] || {}
324
+ # HTTP header 'Accept' (if needed)
325
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
326
+ # HTTP header 'Content-Type'
327
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
328
+ if !content_type.nil?
329
+ header_params['Content-Type'] = content_type
330
+ end
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pa_res_auth_request)
337
+
338
+ # return_type
339
+ return_type = opts[:debug_return_type] || 'AuthResponse'
340
+
341
+ # auth_names
342
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
343
+
344
+ new_options = opts.merge(
345
+ :operation => :"AuthorisationAndPaymentApi.pa_res_request",
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type
352
+ )
353
+
354
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#pa_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
357
+ end
358
+ return data, status_code, headers
359
+ end
360
+
361
+ # Refund
362
+ # A refund request which allows for the refunding of a previous transaction up and to the amount of the original sale. A refund will be performed against the original card used to process the transaction.
363
+ # @param refund_request [RefundRequest]
364
+ # @param [Hash] opts the optional parameters
365
+ # @return [AuthResponse]
366
+ def refund_request(refund_request, opts = {})
367
+ data, _status_code, _headers = refund_request_with_http_info(refund_request, opts)
368
+ data
369
+ end
370
+
371
+ # Refund
372
+ # A refund request which allows for the refunding of a previous transaction up and to the amount of the original sale. A refund will be performed against the original card used to process the transaction.
373
+ # @param refund_request [RefundRequest]
374
+ # @param [Hash] opts the optional parameters
375
+ # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
376
+ def refund_request_with_http_info(refund_request, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.refund_request ...'
379
+ end
380
+ # verify the required parameter 'refund_request' is set
381
+ if @api_client.config.client_side_validation && refund_request.nil?
382
+ fail ArgumentError, "Missing the required parameter 'refund_request' when calling AuthorisationAndPaymentApi.refund_request"
383
+ end
384
+ # resource path
385
+ local_var_path = '/v6/refund'
386
+
387
+ # query parameters
388
+ query_params = opts[:query_params] || {}
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
394
+ # HTTP header 'Content-Type'
395
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
396
+ if !content_type.nil?
397
+ header_params['Content-Type'] = content_type
398
+ end
399
+
400
+ # form parameters
401
+ form_params = opts[:form_params] || {}
402
+
403
+ # http body (model)
404
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(refund_request)
405
+
406
+ # return_type
407
+ return_type = opts[:debug_return_type] || 'AuthResponse'
408
+
409
+ # auth_names
410
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
411
+
412
+ new_options = opts.merge(
413
+ :operation => :"AuthorisationAndPaymentApi.refund_request",
414
+ :header_params => header_params,
415
+ :query_params => query_params,
416
+ :form_params => form_params,
417
+ :body => post_body,
418
+ :auth_names => auth_names,
419
+ :return_type => return_type
420
+ )
421
+
422
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
423
+ if @api_client.config.debugging
424
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#refund_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
425
+ end
426
+ return data, status_code, headers
427
+ end
428
+
429
+ # Retrieval
430
+ # 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.
431
+ # @param retrieve_request [RetrieveRequest]
432
+ # @param [Hash] opts the optional parameters
433
+ # @return [AuthReferences]
434
+ def retrieval_request(retrieve_request, opts = {})
435
+ data, _status_code, _headers = retrieval_request_with_http_info(retrieve_request, opts)
436
+ data
437
+ end
438
+
439
+ # Retrieval
440
+ # 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.
441
+ # @param retrieve_request [RetrieveRequest]
442
+ # @param [Hash] opts the optional parameters
443
+ # @return [Array<(AuthReferences, Integer, Hash)>] AuthReferences data, response status code and response headers
444
+ def retrieval_request_with_http_info(retrieve_request, opts = {})
445
+ if @api_client.config.debugging
446
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.retrieval_request ...'
447
+ end
448
+ # verify the required parameter 'retrieve_request' is set
449
+ if @api_client.config.client_side_validation && retrieve_request.nil?
450
+ fail ArgumentError, "Missing the required parameter 'retrieve_request' when calling AuthorisationAndPaymentApi.retrieval_request"
451
+ end
452
+ # resource path
453
+ local_var_path = '/v6/retrieve'
454
+
455
+ # query parameters
456
+ query_params = opts[:query_params] || {}
457
+
458
+ # header parameters
459
+ header_params = opts[:header_params] || {}
460
+ # HTTP header 'Accept' (if needed)
461
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
462
+ # HTTP header 'Content-Type'
463
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
464
+ if !content_type.nil?
465
+ header_params['Content-Type'] = content_type
466
+ end
467
+
468
+ # form parameters
469
+ form_params = opts[:form_params] || {}
470
+
471
+ # http body (model)
472
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(retrieve_request)
473
+
474
+ # return_type
475
+ return_type = opts[:debug_return_type] || 'AuthReferences'
476
+
477
+ # auth_names
478
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
479
+
480
+ new_options = opts.merge(
481
+ :operation => :"AuthorisationAndPaymentApi.retrieval_request",
482
+ :header_params => header_params,
483
+ :query_params => query_params,
484
+ :form_params => form_params,
485
+ :body => post_body,
486
+ :auth_names => auth_names,
487
+ :return_type => return_type
488
+ )
489
+
490
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
491
+ if @api_client.config.debugging
492
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#retrieval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
493
+ end
494
+ return data, status_code, headers
495
+ end
496
+
497
+ # Void
498
+ # _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.
499
+ # @param void_request [VoidRequest]
500
+ # @param [Hash] opts the optional parameters
501
+ # @return [Acknowledgement]
502
+ def void_request(void_request, opts = {})
503
+ data, _status_code, _headers = void_request_with_http_info(void_request, opts)
504
+ data
505
+ end
506
+
507
+ # Void
508
+ # _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.
509
+ # @param void_request [VoidRequest]
510
+ # @param [Hash] opts the optional parameters
511
+ # @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
512
+ def void_request_with_http_info(void_request, opts = {})
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug 'Calling API: AuthorisationAndPaymentApi.void_request ...'
515
+ end
516
+ # verify the required parameter 'void_request' is set
517
+ if @api_client.config.client_side_validation && void_request.nil?
518
+ fail ArgumentError, "Missing the required parameter 'void_request' when calling AuthorisationAndPaymentApi.void_request"
519
+ end
520
+ # resource path
521
+ local_var_path = '/v6/void'
522
+
523
+ # query parameters
524
+ query_params = opts[:query_params] || {}
525
+
526
+ # header parameters
527
+ header_params = opts[:header_params] || {}
528
+ # HTTP header 'Accept' (if needed)
529
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
530
+ # HTTP header 'Content-Type'
531
+ content_type = @api_client.select_header_content_type(['application/json', 'text/xml'])
532
+ if !content_type.nil?
533
+ header_params['Content-Type'] = content_type
534
+ end
535
+
536
+ # form parameters
537
+ form_params = opts[:form_params] || {}
538
+
539
+ # http body (model)
540
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(void_request)
541
+
542
+ # return_type
543
+ return_type = opts[:debug_return_type] || 'Acknowledgement'
544
+
545
+ # auth_names
546
+ auth_names = opts[:debug_auth_names] || ['cp-api-key']
547
+
548
+ new_options = opts.merge(
549
+ :operation => :"AuthorisationAndPaymentApi.void_request",
550
+ :header_params => header_params,
551
+ :query_params => query_params,
552
+ :form_params => form_params,
553
+ :body => post_body,
554
+ :auth_names => auth_names,
555
+ :return_type => return_type
556
+ )
557
+
558
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
559
+ if @api_client.config.debugging
560
+ @api_client.config.logger.debug "API called: AuthorisationAndPaymentApi#void_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
561
+ end
562
+ return data, status_code, headers
563
+ end
564
+ end
565
+ end