citypay_api_client 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/api_key.rb +16 -0
  104. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  105. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  106. data/lib/citypay_api_client/models/auth_request.rb +79 -33
  107. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  108. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  109. data/lib/citypay_api_client/models/batch.rb +264 -0
  110. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  111. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  112. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  113. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  114. data/lib/citypay_api_client/models/bin.rb +299 -0
  115. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  116. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  117. data/lib/citypay_api_client/models/capture_request.rb +38 -20
  118. data/lib/citypay_api_client/models/card.rb +67 -10
  119. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  120. data/lib/citypay_api_client/models/card_status.rb +21 -8
  121. data/lib/citypay_api_client/models/charge_request.rb +96 -24
  122. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  123. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  124. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  125. data/lib/citypay_api_client/models/decision.rb +21 -8
  126. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  127. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  128. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  129. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  130. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  131. data/lib/citypay_api_client/models/error.rb +35 -12
  132. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  133. data/lib/citypay_api_client/models/exists.rb +244 -0
  134. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  135. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  136. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  137. data/lib/citypay_api_client/models/merchant.rb +21 -8
  138. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  139. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  140. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  142. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  143. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  144. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  145. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  146. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  147. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  148. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  149. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  150. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  151. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  152. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  153. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  154. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  155. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  156. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  157. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  159. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  160. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  161. data/lib/citypay_api_client/models/ping.rb +21 -8
  162. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  163. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  164. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  165. data/lib/citypay_api_client/models/register_card.rb +59 -12
  166. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  167. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  168. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  169. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  170. data/lib/citypay_api_client/models/void_request.rb +22 -19
  171. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  172. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  173. data/lib/citypay_api_client/version.rb +3 -3
  174. data/lib/citypay_api_client.rb +53 -6
  175. data/spec/.DS_Store +0 -0
  176. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  177. data/spec/api/batch_processing_api___spec.rb +70 -0
  178. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  179. data/spec/api/direct_post_api___spec.rb +98 -0
  180. data/spec/api/operational_functions_api___spec.rb +94 -0
  181. data/spec/api/paylink_api___spec.rb +131 -0
  182. data/spec/api_client_spec.rb +4 -4
  183. data/spec/configuration_spec.rb +5 -5
  184. data/spec/it_api_sandbox_spec.rb +222 -0
  185. data/spec/models/acknowledgement_spec.rb +6 -8
  186. data/spec/models/acl_check_request_spec.rb +33 -0
  187. data/spec/models/acl_check_response_model_spec.rb +51 -0
  188. data/spec/models/auth_references_spec.rb +7 -8
  189. data/spec/models/auth_response_spec.rb +29 -30
  190. data/spec/models/batch_report_request_spec.rb +39 -0
  191. data/spec/models/batch_report_response_model_spec.rb +63 -0
  192. data/spec/models/batch_spec.rb +45 -0
  193. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  194. data/spec/models/batch_transaction_spec.rb +51 -0
  195. data/spec/models/bin_lookup_spec.rb +33 -0
  196. data/spec/models/bin_spec.rb +81 -0
  197. data/spec/models/card_holder_account_spec.rb +8 -5
  198. data/spec/models/check_batch_status_response_spec.rb +45 -0
  199. data/spec/models/check_batch_status_spec.rb +39 -0
  200. data/spec/models/decision_spec.rb +1 -1
  201. data/spec/models/direct_post_request_spec.rb +153 -0
  202. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  203. data/spec/models/domain_key_check_request_spec.rb +33 -0
  204. data/spec/models/domain_key_request_spec.rb +45 -0
  205. data/spec/models/domain_key_response_spec.rb +57 -0
  206. data/spec/models/event_data_model_spec.rb +57 -0
  207. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  208. data/spec/models/list_merchants_response_spec.rb +2 -2
  209. data/spec/models/paylink_address_spec.rb +69 -0
  210. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  212. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  213. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  214. data/spec/models/paylink_card_holder_spec.rb +87 -0
  215. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  216. data/spec/models/paylink_cart_spec.rb +69 -0
  217. data/spec/models/paylink_config_spec.rb +159 -0
  218. data/spec/models/paylink_custom_param_spec.rb +87 -0
  219. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  220. data/spec/models/paylink_error_code_spec.rb +39 -0
  221. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  222. data/spec/models/paylink_part_payments_spec.rb +63 -0
  223. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  224. data/spec/models/paylink_state_event_spec.rb +45 -0
  225. data/spec/models/paylink_token_created_spec.rb +111 -0
  226. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  227. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  228. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  229. data/spec/models/paylink_token_status_spec.rb +195 -0
  230. data/spec/models/paylink_ui_spec.rb +51 -0
  231. data/spec/models/process_batch_request_spec.rb +51 -0
  232. data/spec/models/process_batch_response_spec.rb +39 -0
  233. data/spec/models/refund_request_spec.rb +64 -0
  234. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  235. data/spec/spec_helper.rb +2 -2
  236. data/spec/utils/direct_post_mac_spec.rb +13 -0
  237. metadata +212 -37
  238. data/Gemfile.lock +0 -70
  239. data/git_push.sh +0 -58
  240. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  241. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  242. data/lib/citypay_api_client/test.rb +0 -20
  243. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,130 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for CityPayApiClient::AuthorisationAndPaymentApi
16
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
17
+ # Please update as you see appropriate
18
+ describe 'AuthorisationAndPaymentApi' do
19
+ before do
20
+ # run before each test
21
+ @api_instance = CityPayApiClient::AuthorisationAndPaymentApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of AuthorisationAndPaymentApi' do
29
+ it 'should create an instance of AuthorisationAndPaymentApi' do
30
+ expect(@api_instance).to be_instance_of(CityPayApiClient::AuthorisationAndPaymentApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for authorisation_request
35
+ # Authorisation
36
+ # 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.
37
+ # @param auth_request
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Decision]
40
+ describe 'authorisation_request test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for bin_range_lookup_request
47
+ # Bin Lookup
48
+ # 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.
49
+ # @param bin_lookup
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [Bin]
52
+ describe 'bin_range_lookup_request test' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ # unit tests for c_res_request
59
+ # CRes
60
+ # 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.
61
+ # @param c_res_auth_request
62
+ # @param [Hash] opts the optional parameters
63
+ # @return [AuthResponse]
64
+ describe 'c_res_request test' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ # unit tests for capture_request
71
+ # Capture
72
+ # _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.
73
+ # @param capture_request
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [Acknowledgement]
76
+ describe 'capture_request test' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for pa_res_request
83
+ # PaRes
84
+ # 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.
85
+ # @param pa_res_auth_request
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [AuthResponse]
88
+ describe 'pa_res_request test' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ # unit tests for refund_request
95
+ # Refund
96
+ # 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.
97
+ # @param refund_request
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [AuthResponse]
100
+ describe 'refund_request test' do
101
+ it 'should work' do
102
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
103
+ end
104
+ end
105
+
106
+ # unit tests for retrieval_request
107
+ # Retrieval
108
+ # 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.
109
+ # @param retrieve_request
110
+ # @param [Hash] opts the optional parameters
111
+ # @return [AuthReferences]
112
+ describe 'retrieval_request test' do
113
+ it 'should work' do
114
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
+ end
116
+ end
117
+
118
+ # unit tests for void_request
119
+ # Void
120
+ # _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.
121
+ # @param void_request
122
+ # @param [Hash] opts the optional parameters
123
+ # @return [Acknowledgement]
124
+ describe 'void_request test' do
125
+ it 'should work' do
126
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
127
+ end
128
+ end
129
+
130
+ end
@@ -0,0 +1,70 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for CityPayApiClient::BatchProcessingApi
16
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
17
+ # Please update as you see appropriate
18
+ describe 'BatchProcessingApi' do
19
+ before do
20
+ # run before each test
21
+ @api_instance = CityPayApiClient::BatchProcessingApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of BatchProcessingApi' do
29
+ it 'should create an instance of BatchProcessingApi' do
30
+ expect(@api_instance).to be_instance_of(CityPayApiClient::BatchProcessingApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for batch_process_request
35
+ # Batch Process Request
36
+ # A batch process request is used to start the batch process workflow by uploading batch data and initialising a new batch for processing. Once validated the batch will be queued for processing and further updates can be received by a subsequent call to retrieve the batch status.
37
+ # @param process_batch_request
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [ProcessBatchResponse]
40
+ describe 'batch_process_request test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for batch_report_request
47
+ # BatchReportRequest
48
+ # The operation is used to retrieve a report of the result of a batch process.
49
+ # @param batch_report_request
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [BatchReportResponseModel]
52
+ describe 'batch_report_request test' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ # unit tests for check_batch_status_request
59
+ # CheckBatchStatus
60
+ # The operation is used to retrieve the status of a batch process.
61
+ # @param check_batch_status
62
+ # @param [Hash] opts the optional parameters
63
+ # @return [CheckBatchStatusResponse]
64
+ describe 'check_batch_status_request test' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ end
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security <aside class=\"notice\"> Before we begin a reminder that your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council including: </aside> * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 5.0.0-SNAPSHOT
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
9
 
10
10
  =end
11
11
 
@@ -108,6 +108,18 @@ describe 'CardHolderAccountApi' do
108
108
  end
109
109
  end
110
110
 
111
+ # unit tests for account_exists_request
112
+ # Account Exists
113
+ # Checks that an account exists and is active by providing the account id as a url parameter.
114
+ # @param accountid The account id that refers to the customer&#39;s account no. This value will have been provided when setting up the card holder account.
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Exists]
117
+ describe 'account_exists_request test' do
118
+ it 'should work' do
119
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
120
+ end
121
+ end
122
+
111
123
  # unit tests for account_retrieve_request
112
124
  # Account Retrieval
113
125
  # Allows for the retrieval of a card holder account for the given &#x60;id&#x60;. Should duplicate accounts exist for the same &#x60;id&#x60;, the first account created with that &#x60;id&#x60; will be returned. The account can be used for tokenisation processing by listing all cards assigned to the account. The returned cards will include all &#x60;active&#x60;, &#x60;inactive&#x60; and &#x60;expired&#x60; cards. This can be used to enable a card holder to view their wallet and make constructive choices on which card to use.
@@ -135,7 +147,7 @@ describe 'CardHolderAccountApi' do
135
147
 
136
148
  # unit tests for charge_request
137
149
  # Charge
138
- # A charge process obtains an authorisation using a tokenised value which represents a stored card on a card holder account. A card must previously be registered by calling &#x60;/account-register-card&#x60; with the card details or retrieved using &#x60;/account-retrieve&#x60; Tokens are generated whenever a previously registered list of cards are retrieved. Each token has, by design a relatively short time to live of 30 minutes. This is both to safe guard the merchant and card holder from replay attacks. Tokens are also restricted to your account, preventing malicious actors from stealing details for use elsewhere. If a token is reused after it has expired it will be rejected and a new token will be required. Tokenisation can be used for - repeat authorisations on a previously stored card - easy authorisations just requiring CSC values to be entered - can be used for credential on file style payments - can require full 3-D Secure authentication to retain the liability shift - wallet style usage.
150
+ # A charge process obtains an authorisation using a tokenised value which represents a stored card on a card holder account. A card must previously be registered by calling &#x60;/account-register-card&#x60; with the card details or retrieved using &#x60;/account-retrieve&#x60; Tokens are generated whenever a previously registered list of cards are retrieved. Each token has, by design a relatively short time to live of 30 minutes. This is both to safe guard the merchant and card holder from replay attacks. Tokens are also restricted to your account, preventing malicious actors from stealing details for use elsewhere. If a token is reused after it has expired it will be rejected and a new token will be required. Tokenisation can be used for - repeat authorisations on a previously stored card - easy authorisations just requiring CSC values to be entered - can be used for credential on file style payments - can require full 3-D Secure authentication to retain the liability shift - wallet style usage _Should an account be used with 3DSv2, the card holder name should also be stored alongside the card as this is a required field with both Visa and MasterCard for risk analysis._.
139
151
  # @param charge_request
140
152
  # @param [Hash] opts the optional parameters
141
153
  # @return [Decision]
@@ -0,0 +1,98 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for CityPayApiClient::DirectPostApi
16
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
17
+ # Please update as you see appropriate
18
+ describe 'DirectPostApi' do
19
+ before do
20
+ # run before each test
21
+ @api_instance = CityPayApiClient::DirectPostApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of DirectPostApi' do
29
+ it 'should create an instance of DirectPostApi' do
30
+ expect(@api_instance).to be_instance_of(CityPayApiClient::DirectPostApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for direct_c_res_auth_request
35
+ # Handles a CRes response from ACS, returning back the result of authorisation
36
+ # Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid &#x60;threeDSSessionData&#x60; value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a &#x60;Direct Post&#x60; integration who wish to handle the challenge flow themselves.
37
+ # @param uuid An identifier used to track the CReq/CRes cycle.
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :cres The CRES from the ACS.
40
+ # @option opts [String] :three_ds_session_data The session data from the ACS.
41
+ # @return [AuthResponse]
42
+ describe 'direct_c_res_auth_request test' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
48
+ # unit tests for direct_c_res_tokenise_request
49
+ # Handles a CRes response from ACS, returning back a token for future authorisation
50
+ # Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid &#x60;threeDSSessionData&#x60; value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a &#x60;Direct Post&#x60; integration who wish to handle the challenge flow themselves.
51
+ # @param uuid An identifier used to track the CReq/CRes cycle.
52
+ # @param [Hash] opts the optional parameters
53
+ # @option opts [String] :cres The CRES from the ACS.
54
+ # @option opts [String] :three_ds_session_data The session data from the ACS.
55
+ # @return [TokenisationResponseModel]
56
+ describe 'direct_c_res_tokenise_request test' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ # unit tests for direct_post_auth_request
63
+ # Direct Post Auth Request
64
+ # Used to initiate a direct post request transaction flow. &lt;pre class&#x3D;\&quot;inline-code language-bash\&quot;&gt; &lt;code&gt; curl https://api.citypay.com/direct/auth?cp-domain-key&#x3D;n834ytqp84y... \\ -d \&quot;amount&#x3D;7500&amp;identifier&#x3D;example_trans&amp;cardnumber&#x3D;4000000000000002&amp;expmonth&#x3D;9&amp;expyear&#x3D;2028&amp;bill_to_postcode&#x3D;L1+7ZW &lt;/code&gt; &lt;/pre&gt;.
65
+ # @param direct_post_request
66
+ # @param [Hash] opts the optional parameters
67
+ # @return [AuthResponse]
68
+ describe 'direct_post_auth_request test' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
+ end
72
+ end
73
+
74
+ # unit tests for direct_post_tokenise_request
75
+ # Direct Post Tokenise Request
76
+ # Used to initiate a direct post request transaction flow. &lt;pre class&#x3D;\&quot;inline-code language-bash\&quot;&gt; &lt;code&gt; curl https://api.citypay.com/v6/direct?cp-domain-key&#x3D;n834ytqp84y... \\ -d \&quot;amount&#x3D;7500&amp;identifier&#x3D;example_trans&amp;cardnumber&#x3D;4000000000000002&amp;expmonth&#x3D;9&amp;expyear&#x3D;2028&amp;bill_to_postcode&#x3D;L1+7ZW &lt;/code&gt; &lt;/pre&gt;.
77
+ # @param direct_post_request
78
+ # @param [Hash] opts the optional parameters
79
+ # @return [AuthResponse]
80
+ describe 'direct_post_tokenise_request test' do
81
+ it 'should work' do
82
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
+ end
84
+ end
85
+
86
+ # unit tests for token_request
87
+ # Direct Post Token Request
88
+ # Perform a request for authorisation for a previously generated token. This flow will return an authorisation response stating that the transaction was approved or declined.
89
+ # @param direct_token_auth_request
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [AuthResponse]
92
+ describe 'token_request test' do
93
+ it 'should work' do
94
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
95
+ end
96
+ end
97
+
98
+ end
@@ -0,0 +1,94 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for CityPayApiClient::OperationalFunctionsApi
16
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
17
+ # Please update as you see appropriate
18
+ describe 'OperationalFunctionsApi' do
19
+ before do
20
+ # run before each test
21
+ @api_instance = CityPayApiClient::OperationalFunctionsApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of OperationalFunctionsApi' do
29
+ it 'should create an instance of OperationalFunctionsApi' do
30
+ expect(@api_instance).to be_instance_of(CityPayApiClient::OperationalFunctionsApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for acl_check_request
35
+ # ACL Check Request
36
+ # Allows the checking of IP addresses against configured ACLs. Requests can perform a lookup of addresses in subnets and services such as AWS or Azure to check that those addresses are listed in the ACLs.
37
+ # @param acl_check_request
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [AclCheckResponseModel]
40
+ describe 'acl_check_request test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for domain_key_check_request
47
+ # Domain Key Check Request
48
+ # Checks the contents of a &#x60;domain key&#x60;. Can be used for operational processes to ensure that the properties of a domain key meet their expectations.
49
+ # @param domain_key_check_request
50
+ # @param [Hash] opts the optional parameters
51
+ # @return [DomainKeyResponse]
52
+ describe 'domain_key_check_request test' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ # unit tests for domain_key_gen_request
59
+ # Domain Key Generation Request
60
+ # Generates a domain key based on the permissions of the calling &#x60;api-key&#x60;. Domain keys can be used in _Direct Post_ and &#x60;XHR&#x60; calls to the API services.
61
+ # @param domain_key_request
62
+ # @param [Hash] opts the optional parameters
63
+ # @return [DomainKeyResponse]
64
+ describe 'domain_key_gen_request test' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ end
68
+ end
69
+
70
+ # unit tests for list_merchants_request
71
+ # List Merchants Request
72
+ # An operational request to list current merchants for a client. ### Sorting Sorting can be performed by include a query parameter i.e. &#x60;/merchants/?sort&#x3D;merchantid&#x60; Fields that can be sorted are &#x60;merchantid&#x60; or &#x60;name&#x60;.
73
+ # @param clientid The client id to return merchants for, specifying \&quot;default\&quot; will use the value in your api key.
74
+ # @param [Hash] opts the optional parameters
75
+ # @return [ListMerchantsResponse]
76
+ describe 'list_merchants_request test' do
77
+ it 'should work' do
78
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
+ end
80
+ end
81
+
82
+ # unit tests for ping_request
83
+ # Ping Request
84
+ # A ping request which performs a connection and authentication test to the CityPay API server. The request will return a standard Acknowledgement with a response code &#x60;044&#x60; to signify a successful ping. The ping call is useful to confirm that you will be able to access the API from behind any firewalls and that the permission model is granting access from your source.
85
+ # @param ping
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [Acknowledgement]
88
+ describe 'ping_request test' do
89
+ it 'should work' do
90
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
91
+ end
92
+ end
93
+
94
+ end
@@ -0,0 +1,131 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security 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](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.4.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for CityPayApiClient::PaylinkApi
16
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
17
+ # Please update as you see appropriate
18
+ describe 'PaylinkApi' do
19
+ before do
20
+ # run before each test
21
+ @api_instance = CityPayApiClient::PaylinkApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of PaylinkApi' do
29
+ it 'should create an instance of PaylinkApi' do
30
+ expect(@api_instance).to be_instance_of(CityPayApiClient::PaylinkApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for token_adjustment_request
35
+ # Paylink Token Adjustment
36
+ # Adjusts a TokenRequest&#39;s amount value when for instance 1. a Token is created and the shopping cart is updated 2. an invoice is adjusted either due to part payment or due to increased incurred costs.
37
+ # @param token The token returned by the create token process.
38
+ # @param paylink_adjustment_request
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Acknowledgement]
41
+ describe 'token_adjustment_request test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for token_close_request
48
+ # Close Paylink Token
49
+ # Marks a Paylink Token as closed. This closes the Token for any future action and the Token will not appear in any status request calls.
50
+ # @param token The token returned by the create token process.
51
+ # @param [Hash] opts the optional parameters
52
+ # @return [Acknowledgement]
53
+ describe 'token_close_request test' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ # unit tests for token_create_bill_payment_request
60
+ # Create Bill Payment Paylink Token
61
+ # CityPay Paylink supports invoice and bill payment services by allowing merchants to raise an invoice in their systems and associate the invoice with a Paylink checkout token. CityPay will co-ordinate the checkout flow in relationship with your customer. Our bill payment solution may be used to streamline the payment flow with cardholders to allow your invoice to be paid promptly and via multiple payment channels such as Card Payment, Apple Pay or Google Pay. The bill payment service allows 1. setting up notification paths to an end customer, such as SMS or Email 2. enabling attachments to be included with Paylink tokens 3. produce chaser notifications for unpaid invoices 4. provide callbacks for notification of the payment of an invoice 5. support part payments against an invoice 6. support of field guards to protect the payment screen 7. support of status reporting on tokens 8. URL short codes for SMS notifications &lt;img src&#x3D;\&quot;../images/merchant-BPS-workflow.png\&quot; alt&#x3D;\&quot;Paylink BPSv2 Overview\&quot; width&#x3D;\&quot;50%\&quot;/&gt; ### Notification Paths Notification paths can be provided which identify the channels for communication of the invoice availability. Up to 3 notification paths may be provided per request. Each notification uses a template to generate the body of the message. This allows for variable text to be sent out and customised for each call. SMS messages use URL Short Codes (USC) as a payment link to the invoice payment page. This allows for a standard payment URL to be shortened for optimised usage in SMS. For instance a URL of &#x60;https://checkout.citypay.com/PL1234/s348yb8yna4a48n2f8nq2f3msgyng-psn348ynaw8ynaw/en&#x60; becomes &#x60;citypay.com/Za48na3x&#x60;. Each USC is unique however it is a requirement that each USC generated is protected with Field Guards to ensure that sensitive data (such as customer contact details and GDPR) is protected. To send a notification path, append a &#x60;notification-path&#x60; property to the request. &#x60;&#x60;&#x60;json { \&quot;notification-path\&quot;: [ { \&quot;channel\&quot;: \&quot;sms\&quot;, \&quot;to\&quot;: \&quot;+441534884000\&quot; }, { \&quot;channel\&quot;: \&quot;email\&quot;, \&quot;to\&quot;: [\&quot;help-desk@citypay.com\&quot;], \&quot;cc\&quot;: [\&quot;third-party@citypay.com\&quot;], \&quot;reply\&quot;: [\&quot;help@my-company.com\&quot;] } ] } &#x60;&#x60;&#x60; Notification paths trigger a number of events which are stored as part of the timeline of events of a Paylink token - &#x60;BillPaymentSmsNotificationQueued&#x60; - identifies when an SMS notification has been queued for delivery - &#x60;BillPaymentSmsNotificationSent&#x60; - identifies when an SMS notification has been sent to the upstream network - &#x60;BillPaymentSmsNotificationDelivered&#x60; - identifies when an SMS notification has been delivered as notified by the upstream network - &#x60;BillPaymentSmsNotificationUndelivered&#x60; - identifies when an SMS notification has undelivered notification is provided by the upstream network - &#x60;BillPaymentSmsNotificationFailure&#x60; - identifies when an SMS notification has failed - &#x60;BillPaymentEmailNotificationQueued&#x60; - identifies when an email notification has been queued for delivery - &#x60;BillPaymentEmailNotificationSent&#x60; - identifies when an email notification has been accepted by our SMS forwarder - &#x60;BillPaymentEmailNotificationFailure&#x60; - identifies when an email notification has failed delivery #### SMS Notification Path SMS originated from a CityPay pool of numbers and by default only sends to country codes where the service is registered. SMSs may contain a From field which is configured as part of you onboarding and have a name associated to identify the service origin. For example if your business is titled &#x60;Health Surgery Ltd&#x60; the SMS may be sent to originate from &#x60;Health Surgery&#x60;. SMS is also configured for a \&quot;polite mode\&quot;. This mode ensures that SMSs aren&#39;t sent in the middle of the night when backend services ordinarily run. SMSs will be queued until the time range is deemed as polite. Normally this is between 8am and 9pm. | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string | Reserved | The phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format to send the message to. | #### Email Notification Paths | Field | Type | Usage | Description | |----------|----------|----------|-------------------------------------------------------------------------------------------------| | template | string | Reserved | An optional template name to use a template other than the default. | | to | string[] | Required | An array of email addresses to be used for delivery. A maximum of 5 addresses can be added. | | cc | string[] | Required | An array of email addresses to be used for cc delivery. A maximum of 5 addresses can be added. | | bcc | string[] | Required | An array of email addresses to be used for bcc delivery. A maximum of 5 addresses can be added. | | reply_to | string[] | Required | An array of email addresses to be used for the Reply-To header of an email. | ### Field Guards To ensure that invoices are paid by the intended recipient, Paylink supports the addition of Field Guards. A Field Guard is an intended field which is to be used as a form of guarded authentication. More than 1 field can be requested. &lt;img src&#x3D;\&quot;../images/paylink-field-guards.png\&quot; alt&#x3D;\&quot;Paylink Field Guards\&quot; width&#x3D;\&quot;50%\&quot;/&gt; To determine the source value of the field, each field name is searched in the order of - identifier - cardholder data such as name - custom parameters - pass through data If no field values are found, the token request returns a D041 validation error. #### Authentication and Validation When values are entered by the user, resultant comparisons are performed by 1. Transliteration of both the source value and entered value. For example, names with accents (e.g. é will become e) 2. Only Alphanumeric values are retained any whitespace or special characters are ignored 3. Case is ignored Should all values match, the user is authenticated and can continue to the payment form rendered by the Paylink server. On successful login, an event will be added to include that the access guard validated access. #### Access-Key To ensure that a user does not need to re-enter these values multiple times, a cookie is pushed to the user’s browser with an access-key digest value. This value will be presented to the server on each refresh therefore allowing the guard to accept the call. Each value is uniquely stored per merchant account and cannot be shared cross merchant. The lifetime of the cookie is set to 24 hours. #### Brute Force Prevention To prevent multiple calls hitting the server, attempting a brute force attack, the login process 1. is fronted by a contemporary web application firewall 2. creates an event for each token when access was denied 3. should the number of failed events breach more than 5 in 30 minutes, the token is locked for an hour 4. should the number of events breach more than 20 the token is fully locked ### Attachments Attachments can be included in the request in 2 ways 1. Via a data element direct in the request 2. Via a URL upload to a provided pre-signed URL The decision of which option is dependent on the size of the attachments. Should the attachment size be greater than 32kb a URL upload is required. Small attachments can be included in the JSON request. This is to prevent our web firewall from blocking your request and to also ensure efficiency of larger file uploads. There is a maximum of 3 attachments that can be added to a request. &#x60;&#x60;&#x60;json [{ \&quot;filename\&quot;: \&quot;invoice1.pdf\&quot;, \&quot;mime-type\&quot;: \&quot;application/pdf\&quot; },{ \&quot;filename\&quot;: \&quot;invoice2.pdf\&quot;, \&quot;data\&quot;: \&quot;b4sE64Enc0dEd...&#x3D;\&quot;, \&quot;mime-type\&quot;: \&quot;application/pdf\&quot; }] &#x60;&#x60;&#x60; | Field | Type | Usage | Description | |-----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------| | filename | string | Required | The name of the attachment normally taken from the filename. You should not include the filename path as appropriate | | data | string | Optional | base64 encoding of the file if less than 32kb in size | | mime-type | string | Required | The mime type of the attachment as defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html). Currently only &#x60;application/pdf&#x60; is supported | #### Attachment Result A result of an attachment specifies whether the attachment was successfully added or whether a further upload is requried | Field | Type | Usage | Description | |--------|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------| | result | string | Required | &#x60;OK&#x60; should the file have uploaded or &#x60;UPLOAD&#x60; if the file is required to be uploaded. | | name | string | Required | The filename that was specified in the upload process | | url | string | Optional | Should an upload be required, this URL is available for an upload to be issued. The URL is only available for uploads for 24 hours from creation. |
62
+ # @param paylink_bill_payment_token_request
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [PaylinkTokenCreated]
65
+ describe 'token_create_bill_payment_request test' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ # unit tests for token_create_request
72
+ # Create Paylink Token
73
+ # Creates a Paylink token from the CityPay API.
74
+ # @param paylink_token_request_model
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [PaylinkTokenCreated]
77
+ describe 'token_create_request test' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ # unit tests for token_reconciled_request
84
+ # Reconcile Paylink Token
85
+ # Marks a Paylink Token as reconciled when reconcilation is performed on the merchant&#39;s side.
86
+ # @param token The token returned by the create token process.
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [Acknowledgement]
89
+ describe 'token_reconciled_request test' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ end
93
+ end
94
+
95
+ # unit tests for token_reopen_request
96
+ # Reopen Paylink Token
97
+ # Allows for a Paylink Token to be reopened if a Token has been previously closed and payment has not yet been made.
98
+ # @param token The token returned by the create token process.
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Acknowledgement]
101
+ describe 'token_reopen_request test' do
102
+ it 'should work' do
103
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104
+ end
105
+ end
106
+
107
+ # unit tests for token_status_changes_request
108
+ # Paylink Token Audit
109
+ # Obtains any changes on Paylink Tokens since a given date and time. This allows for a merchant to regularly check on activity over a collection of Paylink Tokens and to check on any events that may have occurred. If a Token is &#x60;Closed&#x60; it is not considered. Only statuses that have been appended since the given date and time is returned.
110
+ # @param paylink_token_status_change_request
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [PaylinkTokenStatusChangeResponse]
113
+ describe 'token_status_changes_request test' do
114
+ it 'should work' do
115
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
116
+ end
117
+ end
118
+
119
+ # unit tests for token_status_request
120
+ # Paylink Token Status
121
+ # Obtains the full status of a given Paylink Token.
122
+ # @param token The token returned by the create token process.
123
+ # @param [Hash] opts the optional parameters
124
+ # @return [PaylinkTokenStatus]
125
+ describe 'token_status_request test' do
126
+ it 'should work' do
127
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
128
+ end
129
+ end
130
+
131
+ end