citypay_api_client 1.0.3 → 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 (242) 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/auth_reference.rb +45 -11
  104. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  105. data/lib/citypay_api_client/models/auth_request.rb +79 -35
  106. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  107. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  108. data/lib/citypay_api_client/models/batch.rb +264 -0
  109. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  110. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  111. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  112. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  113. data/lib/citypay_api_client/models/bin.rb +299 -0
  114. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  115. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  116. data/lib/citypay_api_client/models/capture_request.rb +38 -22
  117. data/lib/citypay_api_client/models/card.rb +67 -10
  118. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  119. data/lib/citypay_api_client/models/card_status.rb +21 -8
  120. data/lib/citypay_api_client/models/charge_request.rb +96 -26
  121. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  122. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  123. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  124. data/lib/citypay_api_client/models/decision.rb +21 -8
  125. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  126. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  127. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  128. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  129. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  130. data/lib/citypay_api_client/models/error.rb +35 -12
  131. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  132. data/lib/citypay_api_client/models/exists.rb +244 -0
  133. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  134. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  135. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  136. data/lib/citypay_api_client/models/merchant.rb +21 -8
  137. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  138. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  139. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  140. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  142. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  143. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  144. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  145. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  146. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  147. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  148. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  149. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  150. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  151. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  152. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  153. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  154. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  155. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  156. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  157. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  159. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  160. data/lib/citypay_api_client/models/ping.rb +21 -8
  161. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  162. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  163. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  164. data/lib/citypay_api_client/models/register_card.rb +59 -12
  165. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  166. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  167. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  168. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  169. data/lib/citypay_api_client/models/void_request.rb +22 -21
  170. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  171. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  172. data/lib/citypay_api_client/version.rb +3 -4
  173. data/lib/citypay_api_client.rb +53 -6
  174. data/spec/.DS_Store +0 -0
  175. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  176. data/spec/api/batch_processing_api___spec.rb +70 -0
  177. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  178. data/spec/api/direct_post_api___spec.rb +98 -0
  179. data/spec/api/operational_functions_api___spec.rb +94 -0
  180. data/spec/api/paylink_api___spec.rb +131 -0
  181. data/spec/api_client_spec.rb +4 -4
  182. data/spec/configuration_spec.rb +5 -5
  183. data/spec/it_api_sandbox_spec.rb +126 -58
  184. data/spec/models/acknowledgement_spec.rb +7 -22
  185. data/spec/models/acl_check_request_spec.rb +33 -0
  186. data/spec/models/acl_check_response_model_spec.rb +51 -0
  187. data/spec/models/auth_references_spec.rb +7 -8
  188. data/spec/models/auth_response_spec.rb +29 -30
  189. data/spec/models/batch_report_request_spec.rb +39 -0
  190. data/spec/models/batch_report_response_model_spec.rb +63 -0
  191. data/spec/models/batch_spec.rb +45 -0
  192. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  193. data/spec/models/batch_transaction_spec.rb +51 -0
  194. data/spec/models/bin_lookup_spec.rb +33 -0
  195. data/spec/models/bin_spec.rb +81 -0
  196. data/spec/models/card_holder_account_spec.rb +8 -5
  197. data/spec/models/check_batch_status_response_spec.rb +45 -0
  198. data/spec/models/check_batch_status_spec.rb +39 -0
  199. data/spec/models/decision_spec.rb +1 -1
  200. data/spec/models/direct_post_request_spec.rb +153 -0
  201. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  202. data/spec/models/domain_key_check_request_spec.rb +33 -0
  203. data/spec/models/domain_key_request_spec.rb +45 -0
  204. data/spec/models/domain_key_response_spec.rb +57 -0
  205. data/spec/models/event_data_model_spec.rb +57 -0
  206. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  207. data/spec/models/list_merchants_response_spec.rb +2 -2
  208. data/spec/models/paylink_address_spec.rb +69 -0
  209. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  210. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  212. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  213. data/spec/models/paylink_card_holder_spec.rb +87 -0
  214. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  215. data/spec/models/paylink_cart_spec.rb +69 -0
  216. data/spec/models/paylink_config_spec.rb +159 -0
  217. data/spec/models/paylink_custom_param_spec.rb +87 -0
  218. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  219. data/spec/models/paylink_error_code_spec.rb +39 -0
  220. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  221. data/spec/models/paylink_part_payments_spec.rb +63 -0
  222. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  223. data/spec/models/paylink_state_event_spec.rb +45 -0
  224. data/spec/models/paylink_token_created_spec.rb +111 -0
  225. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  226. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  227. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  228. data/spec/models/paylink_token_status_spec.rb +195 -0
  229. data/spec/models/paylink_ui_spec.rb +51 -0
  230. data/spec/models/process_batch_request_spec.rb +51 -0
  231. data/spec/models/process_batch_response_spec.rb +39 -0
  232. data/spec/models/refund_request_spec.rb +64 -0
  233. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  234. data/spec/spec_helper.rb +2 -2
  235. data/spec/utils/direct_post_mac_spec.rb +13 -0
  236. metadata +210 -37
  237. data/Gemfile.lock +0 -70
  238. data/git_push.sh +0 -58
  239. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  240. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  241. data/lib/citypay_api_client/test.rb +0 -20
  242. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -2,29 +2,30 @@
2
2
 
3
3
  All URIs are relative to *https://api.citypay.com/v6*
4
4
 
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**authorisation_request**](PaymentProcessingApi.md#authorisation_request) | **POST** /authorise | Authorisation
8
- [**c_res_request**](PaymentProcessingApi.md#c_res_request) | **POST** /cres | CRes
9
- [**capture_request**](PaymentProcessingApi.md#capture_request) | **POST** /capture | Capture
10
- [**pa_res_request**](PaymentProcessingApi.md#pa_res_request) | **POST** /pares | PaRes
11
- [**retrieval_request**](PaymentProcessingApi.md#retrieval_request) | **POST** /retrieve | Retrieval
12
- [**void_request**](PaymentProcessingApi.md#void_request) | **POST** /void | Void
13
-
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**authorisation_request**](PaymentProcessingApi.md#authorisation_request) | **POST** /authorise | Authorisation |
8
+ | [**bin_range_lookup_request**](PaymentProcessingApi.md#bin_range_lookup_request) | **POST** /bin | Bin Lookup |
9
+ | [**c_res_request**](PaymentProcessingApi.md#c_res_request) | **POST** /cres | CRes |
10
+ | [**capture_request**](PaymentProcessingApi.md#capture_request) | **POST** /capture | Capture |
11
+ | [**pa_res_request**](PaymentProcessingApi.md#pa_res_request) | **POST** /pares | PaRes |
12
+ | [**refund_request**](PaymentProcessingApi.md#refund_request) | **POST** /refund | Refund |
13
+ | [**retrieval_request**](PaymentProcessingApi.md#retrieval_request) | **POST** /retrieve | Retrieval |
14
+ | [**void_request**](PaymentProcessingApi.md#void_request) | **POST** /void | Void |
14
15
 
15
16
 
16
17
  ## authorisation_request
17
18
 
18
- > Decision authorisation_request(auth_request)
19
+ > <Decision> authorisation_request(auth_request)
19
20
 
20
21
  Authorisation
21
22
 
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
+ 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 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 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) 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
24
 
24
- ### Example
25
+ ### Examples
25
26
 
26
27
  ```ruby
27
- # load the gem
28
+ require 'time'
28
29
  require 'citypay_api_client'
29
30
  # setup authorization
30
31
  CityPayApiClient.configure do |config|
@@ -32,23 +33,40 @@ CityPayApiClient.configure do |config|
32
33
  end
33
34
 
34
35
  api_instance = CityPayApiClient::PaymentProcessingApi.new
35
- auth_request = CityPayApiClient::AuthRequest.new # AuthRequest |
36
+ auth_request = CityPayApiClient::AuthRequest.new({amount: 3600, cardnumber: '4000 0000 0000 0002', expmonth: 9, expyear: 2025, identifier: '95b857a1-5955-4b86-963c-5a6dbfc4fb95', merchantid: 11223344}) # AuthRequest |
36
37
 
37
38
  begin
38
- #Authorisation
39
+ # Authorisation
39
40
  result = api_instance.authorisation_request(auth_request)
40
41
  p result
41
42
  rescue CityPayApiClient::ApiError => e
42
- puts "Exception when calling PaymentProcessingApi->authorisation_request: #{e}"
43
+ puts "Error when calling PaymentProcessingApi->authorisation_request: #{e}"
43
44
  end
44
45
  ```
45
46
 
46
- ### Parameters
47
+ #### Using the authorisation_request_with_http_info variant
48
+
49
+ This returns an Array which contains the response data, status code and headers.
47
50
 
51
+ > <Array(<Decision>, Integer, Hash)> authorisation_request_with_http_info(auth_request)
52
+
53
+ ```ruby
54
+ begin
55
+ # Authorisation
56
+ data, status_code, headers = api_instance.authorisation_request_with_http_info(auth_request)
57
+ p status_code # => 2xx
58
+ p headers # => { ... }
59
+ p data # => <Decision>
60
+ rescue CityPayApiClient::ApiError => e
61
+ puts "Error when calling PaymentProcessingApi->authorisation_request_with_http_info: #{e}"
62
+ end
63
+ ```
48
64
 
49
- Name | Type | Description | Notes
50
- ------------- | ------------- | ------------- | -------------
51
- **auth_request** | [**AuthRequest**](AuthRequest.md)| |
65
+ ### Parameters
66
+
67
+ | Name | Type | Description | Notes |
68
+ | ---- | ---- | ----------- | ----- |
69
+ | **auth_request** | [**AuthRequest**](AuthRequest.md) | | |
52
70
 
53
71
  ### Return type
54
72
 
@@ -64,18 +82,86 @@ Name | Type | Description | Notes
64
82
  - **Accept**: application/json, text/xml
65
83
 
66
84
 
85
+ ## bin_range_lookup_request
86
+
87
+ > <Bin> bin_range_lookup_request(bin_lookup)
88
+
89
+ Bin Lookup
90
+
91
+ 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.
92
+
93
+ ### Examples
94
+
95
+ ```ruby
96
+ require 'time'
97
+ require 'citypay_api_client'
98
+ # setup authorization
99
+ CityPayApiClient.configure do |config|
100
+ config.api_key['cp-api-key'] = CityPayApiClient::ApiKey.new(client_id: 'YourClientId', licence_key: 'YourLicenceKey').generate
101
+ end
102
+
103
+ api_instance = CityPayApiClient::PaymentProcessingApi.new
104
+ bin_lookup = CityPayApiClient::BinLookup.new({bin: 543712}) # BinLookup |
105
+
106
+ begin
107
+ # Bin Lookup
108
+ result = api_instance.bin_range_lookup_request(bin_lookup)
109
+ p result
110
+ rescue CityPayApiClient::ApiError => e
111
+ puts "Error when calling PaymentProcessingApi->bin_range_lookup_request: #{e}"
112
+ end
113
+ ```
114
+
115
+ #### Using the bin_range_lookup_request_with_http_info variant
116
+
117
+ This returns an Array which contains the response data, status code and headers.
118
+
119
+ > <Array(<Bin>, Integer, Hash)> bin_range_lookup_request_with_http_info(bin_lookup)
120
+
121
+ ```ruby
122
+ begin
123
+ # Bin Lookup
124
+ data, status_code, headers = api_instance.bin_range_lookup_request_with_http_info(bin_lookup)
125
+ p status_code # => 2xx
126
+ p headers # => { ... }
127
+ p data # => <Bin>
128
+ rescue CityPayApiClient::ApiError => e
129
+ puts "Error when calling PaymentProcessingApi->bin_range_lookup_request_with_http_info: #{e}"
130
+ end
131
+ ```
132
+
133
+ ### Parameters
134
+
135
+ | Name | Type | Description | Notes |
136
+ | ---- | ---- | ----------- | ----- |
137
+ | **bin_lookup** | [**BinLookup**](BinLookup.md) | | |
138
+
139
+ ### Return type
140
+
141
+ [**Bin**](Bin.md)
142
+
143
+ ### Authorization
144
+
145
+ [cp-api-key](../README.md#cp-api-key)
146
+
147
+ ### HTTP request headers
148
+
149
+ - **Content-Type**: application/json, text/xml
150
+ - **Accept**: application/json, text/xml
151
+
152
+
67
153
  ## c_res_request
68
154
 
69
- > AuthResponse c_res_request(c_res_auth_request)
155
+ > <AuthResponse> c_res_request(c_res_auth_request)
70
156
 
71
157
  CRes
72
158
 
73
159
  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.
74
160
 
75
- ### Example
161
+ ### Examples
76
162
 
77
163
  ```ruby
78
- # load the gem
164
+ require 'time'
79
165
  require 'citypay_api_client'
80
166
  # setup authorization
81
167
  CityPayApiClient.configure do |config|
@@ -86,20 +172,37 @@ api_instance = CityPayApiClient::PaymentProcessingApi.new
86
172
  c_res_auth_request = CityPayApiClient::CResAuthRequest.new # CResAuthRequest |
87
173
 
88
174
  begin
89
- #CRes
175
+ # CRes
90
176
  result = api_instance.c_res_request(c_res_auth_request)
91
177
  p result
92
178
  rescue CityPayApiClient::ApiError => e
93
- puts "Exception when calling PaymentProcessingApi->c_res_request: #{e}"
179
+ puts "Error when calling PaymentProcessingApi->c_res_request: #{e}"
94
180
  end
95
181
  ```
96
182
 
97
- ### Parameters
183
+ #### Using the c_res_request_with_http_info variant
98
184
 
185
+ This returns an Array which contains the response data, status code and headers.
99
186
 
100
- Name | Type | Description | Notes
101
- ------------- | ------------- | ------------- | -------------
102
- **c_res_auth_request** | [**CResAuthRequest**](CResAuthRequest.md)| |
187
+ > <Array(<AuthResponse>, Integer, Hash)> c_res_request_with_http_info(c_res_auth_request)
188
+
189
+ ```ruby
190
+ begin
191
+ # CRes
192
+ data, status_code, headers = api_instance.c_res_request_with_http_info(c_res_auth_request)
193
+ p status_code # => 2xx
194
+ p headers # => { ... }
195
+ p data # => <AuthResponse>
196
+ rescue CityPayApiClient::ApiError => e
197
+ puts "Error when calling PaymentProcessingApi->c_res_request_with_http_info: #{e}"
198
+ end
199
+ ```
200
+
201
+ ### Parameters
202
+
203
+ | Name | Type | Description | Notes |
204
+ | ---- | ---- | ----------- | ----- |
205
+ | **c_res_auth_request** | [**CResAuthRequest**](CResAuthRequest.md) | | |
103
206
 
104
207
  ### Return type
105
208
 
@@ -117,16 +220,16 @@ Name | Type | Description | Notes
117
220
 
118
221
  ## capture_request
119
222
 
120
- > Acknowledgement capture_request(capture_request)
223
+ > <Acknowledgement> capture_request(capture_request)
121
224
 
122
225
  Capture
123
226
 
124
227
  _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.
125
228
 
126
- ### Example
229
+ ### Examples
127
230
 
128
231
  ```ruby
129
- # load the gem
232
+ require 'time'
130
233
  require 'citypay_api_client'
131
234
  # setup authorization
132
235
  CityPayApiClient.configure do |config|
@@ -134,23 +237,40 @@ CityPayApiClient.configure do |config|
134
237
  end
135
238
 
136
239
  api_instance = CityPayApiClient::PaymentProcessingApi.new
137
- capture_request = CityPayApiClient::CaptureRequest.new # CaptureRequest |
240
+ capture_request = CityPayApiClient::CaptureRequest.new({merchantid: 11223344}) # CaptureRequest |
138
241
 
139
242
  begin
140
- #Capture
243
+ # Capture
141
244
  result = api_instance.capture_request(capture_request)
142
245
  p result
143
246
  rescue CityPayApiClient::ApiError => e
144
- puts "Exception when calling PaymentProcessingApi->capture_request: #{e}"
247
+ puts "Error when calling PaymentProcessingApi->capture_request: #{e}"
145
248
  end
146
249
  ```
147
250
 
148
- ### Parameters
251
+ #### Using the capture_request_with_http_info variant
252
+
253
+ This returns an Array which contains the response data, status code and headers.
254
+
255
+ > <Array(<Acknowledgement>, Integer, Hash)> capture_request_with_http_info(capture_request)
256
+
257
+ ```ruby
258
+ begin
259
+ # Capture
260
+ data, status_code, headers = api_instance.capture_request_with_http_info(capture_request)
261
+ p status_code # => 2xx
262
+ p headers # => { ... }
263
+ p data # => <Acknowledgement>
264
+ rescue CityPayApiClient::ApiError => e
265
+ puts "Error when calling PaymentProcessingApi->capture_request_with_http_info: #{e}"
266
+ end
267
+ ```
149
268
 
269
+ ### Parameters
150
270
 
151
- Name | Type | Description | Notes
152
- ------------- | ------------- | ------------- | -------------
153
- **capture_request** | [**CaptureRequest**](CaptureRequest.md)| |
271
+ | Name | Type | Description | Notes |
272
+ | ---- | ---- | ----------- | ----- |
273
+ | **capture_request** | [**CaptureRequest**](CaptureRequest.md) | | |
154
274
 
155
275
  ### Return type
156
276
 
@@ -168,16 +288,16 @@ Name | Type | Description | Notes
168
288
 
169
289
  ## pa_res_request
170
290
 
171
- > AuthResponse pa_res_request(pa_res_auth_request)
291
+ > <AuthResponse> pa_res_request(pa_res_auth_request)
172
292
 
173
293
  PaRes
174
294
 
175
295
  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.
176
296
 
177
- ### Example
297
+ ### Examples
178
298
 
179
299
  ```ruby
180
- # load the gem
300
+ require 'time'
181
301
  require 'citypay_api_client'
182
302
  # setup authorization
183
303
  CityPayApiClient.configure do |config|
@@ -185,23 +305,108 @@ CityPayApiClient.configure do |config|
185
305
  end
186
306
 
187
307
  api_instance = CityPayApiClient::PaymentProcessingApi.new
188
- pa_res_auth_request = CityPayApiClient::PaResAuthRequest.new # PaResAuthRequest |
308
+ pa_res_auth_request = CityPayApiClient::PaResAuthRequest.new({md: 'md_example', pares: 'v66ycfSp8jNlvy7PkHbx44NEt3vox90+vZ/7Ll05Vid/jPfQn8adw+4D/vRDUGT19kndW97Hfirb...'}) # PaResAuthRequest |
189
309
 
190
310
  begin
191
- #PaRes
311
+ # PaRes
192
312
  result = api_instance.pa_res_request(pa_res_auth_request)
193
313
  p result
194
314
  rescue CityPayApiClient::ApiError => e
195
- puts "Exception when calling PaymentProcessingApi->pa_res_request: #{e}"
315
+ puts "Error when calling PaymentProcessingApi->pa_res_request: #{e}"
316
+ end
317
+ ```
318
+
319
+ #### Using the pa_res_request_with_http_info variant
320
+
321
+ This returns an Array which contains the response data, status code and headers.
322
+
323
+ > <Array(<AuthResponse>, Integer, Hash)> pa_res_request_with_http_info(pa_res_auth_request)
324
+
325
+ ```ruby
326
+ begin
327
+ # PaRes
328
+ data, status_code, headers = api_instance.pa_res_request_with_http_info(pa_res_auth_request)
329
+ p status_code # => 2xx
330
+ p headers # => { ... }
331
+ p data # => <AuthResponse>
332
+ rescue CityPayApiClient::ApiError => e
333
+ puts "Error when calling PaymentProcessingApi->pa_res_request_with_http_info: #{e}"
196
334
  end
197
335
  ```
198
336
 
199
337
  ### Parameters
200
338
 
339
+ | Name | Type | Description | Notes |
340
+ | ---- | ---- | ----------- | ----- |
341
+ | **pa_res_auth_request** | [**PaResAuthRequest**](PaResAuthRequest.md) | | |
342
+
343
+ ### Return type
344
+
345
+ [**AuthResponse**](AuthResponse.md)
346
+
347
+ ### Authorization
348
+
349
+ [cp-api-key](../README.md#cp-api-key)
350
+
351
+ ### HTTP request headers
352
+
353
+ - **Content-Type**: application/json, text/xml
354
+ - **Accept**: application/json, text/xml
355
+
201
356
 
202
- Name | Type | Description | Notes
203
- ------------- | ------------- | ------------- | -------------
204
- **pa_res_auth_request** | [**PaResAuthRequest**](PaResAuthRequest.md)| |
357
+ ## refund_request
358
+
359
+ > <AuthResponse> refund_request(refund_request)
360
+
361
+ Refund
362
+
363
+ 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.
364
+
365
+ ### Examples
366
+
367
+ ```ruby
368
+ require 'time'
369
+ require 'citypay_api_client'
370
+ # setup authorization
371
+ CityPayApiClient.configure do |config|
372
+ config.api_key['cp-api-key'] = CityPayApiClient::ApiKey.new(client_id: 'YourClientId', licence_key: 'YourLicenceKey').generate
373
+ end
374
+
375
+ api_instance = CityPayApiClient::PaymentProcessingApi.new
376
+ refund_request = CityPayApiClient::RefundRequest.new({amount: 3600, identifier: '95b857a1-5955-4b86-963c-5a6dbfc4fb95', merchantid: 11223344, refund_ref: 8322}) # RefundRequest |
377
+
378
+ begin
379
+ # Refund
380
+ result = api_instance.refund_request(refund_request)
381
+ p result
382
+ rescue CityPayApiClient::ApiError => e
383
+ puts "Error when calling PaymentProcessingApi->refund_request: #{e}"
384
+ end
385
+ ```
386
+
387
+ #### Using the refund_request_with_http_info variant
388
+
389
+ This returns an Array which contains the response data, status code and headers.
390
+
391
+ > <Array(<AuthResponse>, Integer, Hash)> refund_request_with_http_info(refund_request)
392
+
393
+ ```ruby
394
+ begin
395
+ # Refund
396
+ data, status_code, headers = api_instance.refund_request_with_http_info(refund_request)
397
+ p status_code # => 2xx
398
+ p headers # => { ... }
399
+ p data # => <AuthResponse>
400
+ rescue CityPayApiClient::ApiError => e
401
+ puts "Error when calling PaymentProcessingApi->refund_request_with_http_info: #{e}"
402
+ end
403
+ ```
404
+
405
+ ### Parameters
406
+
407
+ | Name | Type | Description | Notes |
408
+ | ---- | ---- | ----------- | ----- |
409
+ | **refund_request** | [**RefundRequest**](RefundRequest.md) | | |
205
410
 
206
411
  ### Return type
207
412
 
@@ -219,16 +424,16 @@ Name | Type | Description | Notes
219
424
 
220
425
  ## retrieval_request
221
426
 
222
- > AuthReferences retrieval_request(retrieve_request)
427
+ > <AuthReferences> retrieval_request(retrieve_request)
223
428
 
224
429
  Retrieval
225
430
 
226
431
  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.
227
432
 
228
- ### Example
433
+ ### Examples
229
434
 
230
435
  ```ruby
231
- # load the gem
436
+ require 'time'
232
437
  require 'citypay_api_client'
233
438
  # setup authorization
234
439
  CityPayApiClient.configure do |config|
@@ -236,23 +441,40 @@ CityPayApiClient.configure do |config|
236
441
  end
237
442
 
238
443
  api_instance = CityPayApiClient::PaymentProcessingApi.new
239
- retrieve_request = CityPayApiClient::RetrieveRequest.new # RetrieveRequest |
444
+ retrieve_request = CityPayApiClient::RetrieveRequest.new({merchantid: 11223344}) # RetrieveRequest |
240
445
 
241
446
  begin
242
- #Retrieval
447
+ # Retrieval
243
448
  result = api_instance.retrieval_request(retrieve_request)
244
449
  p result
245
450
  rescue CityPayApiClient::ApiError => e
246
- puts "Exception when calling PaymentProcessingApi->retrieval_request: #{e}"
451
+ puts "Error when calling PaymentProcessingApi->retrieval_request: #{e}"
247
452
  end
248
453
  ```
249
454
 
250
- ### Parameters
455
+ #### Using the retrieval_request_with_http_info variant
251
456
 
457
+ This returns an Array which contains the response data, status code and headers.
252
458
 
253
- Name | Type | Description | Notes
254
- ------------- | ------------- | ------------- | -------------
255
- **retrieve_request** | [**RetrieveRequest**](RetrieveRequest.md)| |
459
+ > <Array(<AuthReferences>, Integer, Hash)> retrieval_request_with_http_info(retrieve_request)
460
+
461
+ ```ruby
462
+ begin
463
+ # Retrieval
464
+ data, status_code, headers = api_instance.retrieval_request_with_http_info(retrieve_request)
465
+ p status_code # => 2xx
466
+ p headers # => { ... }
467
+ p data # => <AuthReferences>
468
+ rescue CityPayApiClient::ApiError => e
469
+ puts "Error when calling PaymentProcessingApi->retrieval_request_with_http_info: #{e}"
470
+ end
471
+ ```
472
+
473
+ ### Parameters
474
+
475
+ | Name | Type | Description | Notes |
476
+ | ---- | ---- | ----------- | ----- |
477
+ | **retrieve_request** | [**RetrieveRequest**](RetrieveRequest.md) | | |
256
478
 
257
479
  ### Return type
258
480
 
@@ -270,16 +492,16 @@ Name | Type | Description | Notes
270
492
 
271
493
  ## void_request
272
494
 
273
- > Acknowledgement void_request(void_request)
495
+ > <Acknowledgement> void_request(void_request)
274
496
 
275
497
  Void
276
498
 
277
499
  _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.
278
500
 
279
- ### Example
501
+ ### Examples
280
502
 
281
503
  ```ruby
282
- # load the gem
504
+ require 'time'
283
505
  require 'citypay_api_client'
284
506
  # setup authorization
285
507
  CityPayApiClient.configure do |config|
@@ -287,23 +509,40 @@ CityPayApiClient.configure do |config|
287
509
  end
288
510
 
289
511
  api_instance = CityPayApiClient::PaymentProcessingApi.new
290
- void_request = CityPayApiClient::VoidRequest.new # VoidRequest |
512
+ void_request = CityPayApiClient::VoidRequest.new({merchantid: 11223344}) # VoidRequest |
291
513
 
292
514
  begin
293
- #Void
515
+ # Void
294
516
  result = api_instance.void_request(void_request)
295
517
  p result
296
518
  rescue CityPayApiClient::ApiError => e
297
- puts "Exception when calling PaymentProcessingApi->void_request: #{e}"
519
+ puts "Error when calling PaymentProcessingApi->void_request: #{e}"
298
520
  end
299
521
  ```
300
522
 
301
- ### Parameters
523
+ #### Using the void_request_with_http_info variant
302
524
 
525
+ This returns an Array which contains the response data, status code and headers.
526
+
527
+ > <Array(<Acknowledgement>, Integer, Hash)> void_request_with_http_info(void_request)
528
+
529
+ ```ruby
530
+ begin
531
+ # Void
532
+ data, status_code, headers = api_instance.void_request_with_http_info(void_request)
533
+ p status_code # => 2xx
534
+ p headers # => { ... }
535
+ p data # => <Acknowledgement>
536
+ rescue CityPayApiClient::ApiError => e
537
+ puts "Error when calling PaymentProcessingApi->void_request_with_http_info: #{e}"
538
+ end
539
+ ```
540
+
541
+ ### Parameters
303
542
 
304
- Name | Type | Description | Notes
305
- ------------- | ------------- | ------------- | -------------
306
- **void_request** | [**VoidRequest**](VoidRequest.md)| |
543
+ | Name | Type | Description | Notes |
544
+ | ---- | ---- | ----------- | ----- |
545
+ | **void_request** | [**VoidRequest**](VoidRequest.md) | | |
307
546
 
308
547
  ### Return type
309
548
 
data/docs/Ping.md CHANGED
@@ -2,16 +2,17 @@
2
2
 
3
3
  ## Properties
4
4
 
5
- Name | Type | Description | Notes
6
- ------------ | ------------- | ------------- | -------------
7
- **identifier** | **String** | An identifier of the ping request which will be returned in the response. | [optional]
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **identifier** | **String** | An identifier of the ping request which will be returned in the response. | [optional] |
8
8
 
9
- ## Code Sample
9
+ ## Example
10
10
 
11
11
  ```ruby
12
- require 'CityPayApiClient'
12
+ require 'citypay_api_client'
13
13
 
14
- instance = CityPayApiClient::Ping.new(identifier: 95b857a1-5955-4b86-963c-5a6dbfc4fb95)
14
+ instance = CityPayApiClient::Ping.new(
15
+ identifier: 95b857a1-5955-4b86-963c-5a6dbfc4fb95
16
+ )
15
17
  ```
16
18
 
17
-
@@ -0,0 +1,24 @@
1
+ # CityPayApiClient::ProcessBatchRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **batch_date** | **Date** | The date and time that the file was created in ISO-8601 format. | |
8
+ | **batch_id** | **Integer** | The id is a referencable id for the batch that should be generated by your integration. Its recommended to use an incremental id to help determine if a batch has been skipped or missed. The id is used by reporting systems to reference the unique batch alongside your client id. | |
9
+ | **client_account_id** | **String** | The batch account id to process the batch for. Defaults to your client id if not provided. | [optional] |
10
+ | **transactions** | [**Array&lt;BatchTransaction&gt;**](BatchTransaction.md) | | |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'citypay_api_client'
16
+
17
+ instance = CityPayApiClient::ProcessBatchRequest.new(
18
+ batch_date: Thu Jan 02 00:00:00 UTC 2020,
19
+ batch_id: 35,
20
+ client_account_id: AC1,
21
+ transactions: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,20 @@
1
+ # CityPayApiClient::ProcessBatchResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **message** | **String** | Information regarding the processing request. | [optional] |
8
+ | **valid** | **Boolean** | true if the request has been accepted for processing and is valid. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'citypay_api_client'
14
+
15
+ instance = CityPayApiClient::ProcessBatchResponse.new(
16
+ message: Approved 044332,
17
+ valid: true
18
+ )
19
+ ```
20
+