citypay_api_client 1.0.3 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +111 -39
  3. data/citypay_api_client.gemspec +5 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +52 -49
  14. data/docs/AuthResponse.md +64 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +850 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +218 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +44 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +387 -111
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +38 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +389 -0
  37. data/docs/DirectPostRequest.md +60 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalFunctionsApi.md +375 -0
  50. data/docs/PaResAuthRequest.md +10 -9
  51. data/docs/PaylinkAddress.md +30 -0
  52. data/docs/PaylinkAdjustmentRequest.md +22 -0
  53. data/docs/PaylinkApi.md +806 -0
  54. data/docs/PaylinkAttachmentRequest.md +26 -0
  55. data/docs/PaylinkAttachmentResult.md +22 -0
  56. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  57. data/docs/PaylinkCardHolder.md +36 -0
  58. data/docs/PaylinkCart.md +30 -0
  59. data/docs/PaylinkCartItemModel.md +32 -0
  60. data/docs/PaylinkConfig.md +60 -0
  61. data/docs/PaylinkCustomParam.md +38 -0
  62. data/docs/PaylinkEmailNotificationPath.md +26 -0
  63. data/docs/PaylinkErrorCode.md +20 -0
  64. data/docs/PaylinkFieldGuardModel.md +30 -0
  65. data/docs/PaylinkPartPayments.md +28 -0
  66. data/docs/PaylinkSMSNotificationPath.md +20 -0
  67. data/docs/PaylinkStateEvent.md +22 -0
  68. data/docs/PaylinkTokenCreated.md +44 -0
  69. data/docs/PaylinkTokenRequestModel.md +42 -0
  70. data/docs/PaylinkTokenStatus.md +72 -0
  71. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  72. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  73. data/docs/PaylinkUI.md +24 -0
  74. data/docs/Ping.md +8 -7
  75. data/docs/ProcessBatchRequest.md +24 -0
  76. data/docs/ProcessBatchResponse.md +20 -0
  77. data/docs/RefundRequest.md +26 -0
  78. data/docs/RegisterCard.md +16 -13
  79. data/docs/RequestChallenged.md +16 -15
  80. data/docs/RetrieveRequest.md +12 -11
  81. data/docs/ThreeDSecure.md +32 -15
  82. data/docs/TokenisationResponseModel.md +36 -0
  83. data/docs/VoidRequest.md +12 -13
  84. data/docs/images/3dsv1-challenge.png +0 -0
  85. data/docs/images/3dsv2-challenge.png +0 -0
  86. data/docs/images/3dsv2-frictionless.png +0 -0
  87. data/docs/images/3dsv2-method-challenge.png +0 -0
  88. data/docs/images/3dsv2-method-frictionless.png +0 -0
  89. data/docs/images/3dsv2-no3d.png +0 -0
  90. data/docs/images/citypay-logo.svg +1 -0
  91. data/docs/images/direct-post-flow.png +0 -0
  92. data/docs/images/favicon.ico +0 -0
  93. data/docs/images/header.png +0 -0
  94. data/docs/images/logo.ai +1913 -4
  95. data/docs/images/logo.png +0 -0
  96. data/docs/images/logo.svg +1 -0
  97. data/docs/images/merchant-BPS-workflow.png +0 -0
  98. data/docs/images/paylink-field-guards.png +0 -0
  99. data/lib/.DS_Store +0 -0
  100. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  101. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  102. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  103. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  104. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  105. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  106. data/lib/citypay_api_client/api_client.rb +72 -70
  107. data/lib/citypay_api_client/api_error.rb +3 -2
  108. data/lib/citypay_api_client/configuration.rb +74 -17
  109. data/lib/citypay_api_client/models/account_create.rb +33 -23
  110. data/lib/citypay_api_client/models/account_status.rb +31 -23
  111. data/lib/citypay_api_client/models/acknowledgement.rb +43 -27
  112. data/lib/citypay_api_client/models/acl_check_request.rb +221 -0
  113. data/lib/citypay_api_client/models/acl_check_response_model.rb +244 -0
  114. data/lib/citypay_api_client/models/airline_advice.rb +63 -34
  115. data/lib/citypay_api_client/models/airline_segment.rb +51 -25
  116. data/lib/citypay_api_client/models/auth_reference.rb +80 -31
  117. data/lib/citypay_api_client/models/auth_references.rb +31 -23
  118. data/lib/citypay_api_client/models/auth_request.rb +137 -56
  119. data/lib/citypay_api_client/models/auth_response.rb +83 -123
  120. data/lib/citypay_api_client/models/authen_required.rb +31 -23
  121. data/lib/citypay_api_client/models/batch.rb +267 -0
  122. data/lib/citypay_api_client/models/batch_report_request.rb +278 -0
  123. data/lib/citypay_api_client/models/batch_report_response_model.rb +364 -0
  124. data/lib/citypay_api_client/models/batch_transaction.rb +324 -0
  125. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +452 -0
  126. data/lib/citypay_api_client/models/bin.rb +294 -0
  127. data/lib/citypay_api_client/models/bin_lookup.rb +231 -0
  128. data/lib/citypay_api_client/models/c_res_auth_request.rb +31 -23
  129. data/lib/citypay_api_client/models/capture_request.rb +59 -38
  130. data/lib/citypay_api_client/models/card.rb +93 -29
  131. data/lib/citypay_api_client/models/card_holder_account.rb +49 -27
  132. data/lib/citypay_api_client/models/card_status.rb +31 -23
  133. data/lib/citypay_api_client/models/charge_request.rb +154 -47
  134. data/lib/citypay_api_client/models/check_batch_status.rb +260 -0
  135. data/lib/citypay_api_client/models/check_batch_status_response.rb +215 -0
  136. data/lib/citypay_api_client/models/contact_details.rb +130 -52
  137. data/lib/citypay_api_client/models/decision.rb +31 -23
  138. data/lib/citypay_api_client/models/direct_post_request.rb +707 -0
  139. data/lib/citypay_api_client/models/direct_token_auth_request.rb +244 -0
  140. data/lib/citypay_api_client/models/domain_key_check_request.rb +249 -0
  141. data/lib/citypay_api_client/models/domain_key_request.rb +249 -0
  142. data/lib/citypay_api_client/models/domain_key_response.rb +297 -0
  143. data/lib/citypay_api_client/models/error.rb +57 -31
  144. data/lib/citypay_api_client/models/event_data_model.rb +254 -0
  145. data/lib/citypay_api_client/models/exists.rb +241 -0
  146. data/lib/citypay_api_client/models/external_mpi.rb +61 -27
  147. data/lib/citypay_api_client/models/list_merchants_response.rb +37 -25
  148. data/lib/citypay_api_client/models/mcc6012.rb +31 -23
  149. data/lib/citypay_api_client/models/merchant.rb +31 -23
  150. data/lib/citypay_api_client/models/pa_res_auth_request.rb +36 -24
  151. data/lib/citypay_api_client/models/paylink_address.rb +425 -0
  152. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +272 -0
  153. data/lib/citypay_api_client/models/paylink_attachment_request.rb +268 -0
  154. data/lib/citypay_api_client/models/paylink_attachment_result.rb +248 -0
  155. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +289 -0
  156. data/lib/citypay_api_client/models/paylink_card_holder.rb +360 -0
  157. data/lib/citypay_api_client/models/paylink_cart.rb +275 -0
  158. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +284 -0
  159. data/lib/citypay_api_client/models/paylink_config.rb +428 -0
  160. data/lib/citypay_api_client/models/paylink_custom_param.rb +321 -0
  161. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +265 -0
  162. data/lib/citypay_api_client/models/paylink_error_code.rb +238 -0
  163. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +274 -0
  164. data/lib/citypay_api_client/models/paylink_part_payments.rb +264 -0
  165. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +231 -0
  166. data/lib/citypay_api_client/models/paylink_state_event.rb +234 -0
  167. data/lib/citypay_api_client/models/paylink_token_created.rb +365 -0
  168. data/lib/citypay_api_client/models/paylink_token_request_model.rb +427 -0
  169. data/lib/citypay_api_client/models/paylink_token_status.rb +485 -0
  170. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +269 -0
  171. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +232 -0
  172. data/lib/citypay_api_client/models/paylink_ui.rb +244 -0
  173. data/lib/citypay_api_client/models/ping.rb +37 -25
  174. data/lib/citypay_api_client/models/process_batch_request.rb +313 -0
  175. data/lib/citypay_api_client/models/process_batch_response.rb +231 -0
  176. data/lib/citypay_api_client/models/refund_request.rb +339 -0
  177. data/lib/citypay_api_client/models/register_card.rb +79 -27
  178. data/lib/citypay_api_client/models/request_challenged.rb +39 -31
  179. data/lib/citypay_api_client/models/retrieve_request.rb +39 -25
  180. data/lib/citypay_api_client/models/three_d_secure.rb +116 -28
  181. data/lib/citypay_api_client/models/tokenisation_response_model.rb +332 -0
  182. data/lib/citypay_api_client/models/void_request.rb +39 -37
  183. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  184. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  185. data/lib/citypay_api_client/version.rb +3 -4
  186. data/lib/citypay_api_client.rb +53 -6
  187. data/spec/.DS_Store +0 -0
  188. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  189. data/spec/api/batch_processing_api___spec.rb +70 -0
  190. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  191. data/spec/api/direct_post_api___spec.rb +98 -0
  192. data/spec/api/operational_functions_api___spec.rb +94 -0
  193. data/spec/api/paylink_api___spec.rb +131 -0
  194. data/spec/api_client_spec.rb +4 -4
  195. data/spec/configuration_spec.rb +5 -5
  196. data/spec/it_api_sandbox_spec.rb +117 -55
  197. data/spec/models/account_create_spec.rb +1 -2
  198. data/spec/models/account_status_spec.rb +2 -2
  199. data/spec/models/acknowledgement_spec.rb +7 -22
  200. data/spec/models/acl_check_request_spec.rb +33 -0
  201. data/spec/models/acl_check_response_model_spec.rb +51 -0
  202. data/spec/models/airline_advice_spec.rb +0 -2
  203. data/spec/models/airline_segment_spec.rb +0 -2
  204. data/spec/models/auth_references_spec.rb +7 -8
  205. data/spec/models/auth_request_spec.rb +0 -2
  206. data/spec/models/auth_response_spec.rb +77 -33
  207. data/spec/models/batch_report_request_spec.rb +37 -0
  208. data/spec/models/batch_report_response_model_spec.rb +61 -0
  209. data/spec/models/batch_spec.rb +43 -0
  210. data/spec/models/batch_transaction_result_model_spec.rb +85 -0
  211. data/spec/models/batch_transaction_spec.rb +49 -0
  212. data/spec/models/bin_lookup_spec.rb +31 -0
  213. data/spec/models/bin_spec.rb +81 -0
  214. data/spec/models/capture_request_spec.rb +0 -2
  215. data/spec/models/card_holder_account_spec.rb +8 -7
  216. data/spec/models/charge_request_spec.rb +0 -2
  217. data/spec/models/check_batch_status_response_spec.rb +45 -0
  218. data/spec/models/check_batch_status_spec.rb +39 -0
  219. data/spec/models/decision_spec.rb +1 -1
  220. data/spec/models/direct_post_request_spec.rb +151 -0
  221. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  222. data/spec/models/domain_key_check_request_spec.rb +31 -0
  223. data/spec/models/domain_key_request_spec.rb +45 -0
  224. data/spec/models/domain_key_response_spec.rb +57 -0
  225. data/spec/models/event_data_model_spec.rb +57 -0
  226. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  227. data/spec/models/list_merchants_response_spec.rb +2 -2
  228. data/spec/models/paylink_address_spec.rb +69 -0
  229. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  230. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  231. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  232. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  233. data/spec/models/paylink_card_holder_spec.rb +87 -0
  234. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  235. data/spec/models/paylink_cart_spec.rb +69 -0
  236. data/spec/models/paylink_config_spec.rb +159 -0
  237. data/spec/models/paylink_custom_param_spec.rb +87 -0
  238. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  239. data/spec/models/paylink_error_code_spec.rb +39 -0
  240. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  241. data/spec/models/paylink_part_payments_spec.rb +63 -0
  242. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  243. data/spec/models/paylink_state_event_spec.rb +45 -0
  244. data/spec/models/paylink_token_created_spec.rb +111 -0
  245. data/spec/models/paylink_token_request_model_spec.rb +91 -0
  246. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  247. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  248. data/spec/models/paylink_token_status_spec.rb +195 -0
  249. data/spec/models/paylink_ui_spec.rb +51 -0
  250. data/spec/models/process_batch_request_spec.rb +49 -0
  251. data/spec/models/process_batch_response_spec.rb +39 -0
  252. data/spec/models/refund_request_spec.rb +62 -0
  253. data/spec/models/register_card_spec.rb +0 -2
  254. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  255. data/spec/spec_helper.rb +2 -2
  256. data/spec/utils/direct_post_mac_spec.rb +13 -0
  257. metadata +230 -44
  258. data/Gemfile.lock +0 -70
  259. data/docs/OperationalApi.md +0 -112
  260. data/docs/PaymentProcessingApi.md +0 -320
  261. data/git_push.sh +0 -58
  262. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  263. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  264. data/lib/citypay_api_client/test.rb +0 -20
  265. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,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'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 <img src=\"../images/merchant-BPS-workflow.png\" alt=\"Paylink BPSv2 Overview\" width=\"50%\"/> ### 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 `https://checkout.citypay.com/PL1234/s348yb8yna4a48n2f8nq2f3msgyng-psn348ynaw8ynaw/en` becomes `citypay.com/Za48na3x`. 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 `notification-path` property to the request. ```json { \"notification-path\": [ { \"channel\": \"sms\", \"to\": \"+441534884000\" }, { \"channel\": \"email\", \"to\": [\"help-desk@citypay.com\"], \"cc\": [\"third-party@citypay.com\"], \"reply\": [\"help@my-company.com\"] } ] } ``` Notification paths trigger a number of events which are stored as part of the timeline of events of a Paylink token - `BillPaymentSmsNotificationQueued` - identifies when an SMS notification has been queued for delivery - `BillPaymentSmsNotificationSent` - identifies when an SMS notification has been sent to the upstream network - `BillPaymentSmsNotificationDelivered` - identifies when an SMS notification has been delivered as notified by the upstream network - `BillPaymentSmsNotificationUndelivered` - identifies when an SMS notification has undelivered notification is provided by the upstream network - `BillPaymentSmsNotificationFailure` - identifies when an SMS notification has failed - `BillPaymentEmailNotificationQueued` - identifies when an email notification has been queued for delivery - `BillPaymentEmailNotificationSent` - identifies when an email notification has been accepted by our SMS forwarder - `BillPaymentEmailNotificationFailure` - 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 `Health Surgery Ltd` the SMS may be sent to originate from `Health Surgery`. SMS is also configured for a \"polite mode\". This mode ensures that SMSs aren'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. <img src=\"../images/paylink-field-guards.png\" alt=\"Paylink Field Guards\" width=\"50%\"/> 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. ```json [{ \"filename\": \"invoice1.pdf\", \"mime-type\": \"application/pdf\" },{ \"filename\": \"invoice2.pdf\", \"data\": \"b4sE64Enc0dEd...=\", \"mime-type\": \"application/pdf\" }] ``` | 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 `application/pdf` 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 | `OK` should the file have uploaded or `UPLOAD` 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'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 `Closed` 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
@@ -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: 6.2.1
9
9
 
10
10
  =end
11
11
 
@@ -196,8 +196,8 @@ describe CityPayApiClient::ApiClient do
196
196
  let(:api_client) { CityPayApiClient::ApiClient.new }
197
197
 
198
198
  it 'works' do
199
- expect(api_client.select_header_content_type(nil)).to eq('application/json')
200
- expect(api_client.select_header_content_type([])).to eq('application/json')
199
+ expect(api_client.select_header_content_type(nil)).to be_nil
200
+ expect(api_client.select_header_content_type([])).to be_nil
201
201
 
202
202
  expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
203
203
  expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
@@ -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: 6.2.1
9
9
 
10
10
  =end
11
11
 
@@ -17,7 +17,7 @@ describe CityPayApiClient::Configuration do
17
17
  before(:each) do
18
18
  # uncomment below to setup host and base_path
19
19
  # require 'URI'
20
- # uri = URI.parse("https://api.citypay.com/v6")
20
+ # uri = URI.parse("https://api.citypay.com")
21
21
  # CityPayApiClient.configure do |c|
22
22
  # c.host = uri.host
23
23
  # c.base_path = uri.path
@@ -27,14 +27,14 @@ describe CityPayApiClient::Configuration do
27
27
  describe '#base_url' do
28
28
  it 'should have the default value' do
29
29
  # uncomment below to test default value of the base path
30
- # expect(config.base_url).to eq("https://api.citypay.com/v6")
30
+ # expect(config.base_url).to eq("https://api.citypay.com")
31
31
  end
32
32
 
33
33
  it 'should remove trailing slashes' do
34
34
  [nil, '', '/', '//'].each do |base_path|
35
35
  config.base_path = base_path
36
36
  # uncomment below to test trailing slashes
37
- # expect(config.base_url).to eq("https://api.citypay.com/v6")
37
+ # expect(config.base_url).to eq("https://api.citypay.com")
38
38
  end
39
39
  end
40
40
  end
@@ -2,7 +2,9 @@ require 'spec_helper'
2
2
  require 'json'
3
3
  require 'date'
4
4
  require 'securerandom'
5
-
5
+ require 'typhoeus'
6
+ require 'base64'
7
+ require_relative '../lib/citypay_api_client/utils/digest_utils'
6
8
 
7
9
  describe 'IntegrationTests' do
8
10
 
@@ -17,6 +19,7 @@ describe 'IntegrationTests' do
17
19
  config.api_key['cp-api-key'] = CityPayApiClient::ApiKey.new(client_id: client_id, licence_key: licence_key).generate
18
20
  config.debugging = true
19
21
  config.host = "sandbox.citypay.com"
22
+ config.server_index = 1
20
23
  end
21
24
  cha_api = CityPayApiClient::CardHolderAccountApi.new
22
25
  end
@@ -26,35 +29,36 @@ describe 'IntegrationTests' do
26
29
  end
27
30
 
28
31
  describe 'Can run operational tests' do
29
- api_instance = CityPayApiClient::OperationalApi.new
32
+ api_instance = CityPayApiClient::OperationalFunctionsApi.new
30
33
 
31
34
  it 'should ping and ack' do
32
35
  uuid = SecureRandom.uuid
33
36
  result = api_instance.ping_request(CityPayApiClient::Ping.new(identifier: uuid))
34
- expect(result.code == "044")
35
- expect(result.identifier == uuid)
37
+ expect(result.code).to eq("044")
38
+ expect(result.identifier).to eq(uuid)
36
39
  end
37
40
 
38
41
  it 'should list merchants' do
39
42
  result = api_instance.list_merchants_request("default")
40
- expect(result.clientid == client_id)
43
+ expect(result.clientid ).to eq(client_id)
41
44
  end
42
45
 
43
46
  end
44
47
 
45
48
  describe 'Run payment processing tests' do
46
- api_instance = CityPayApiClient::PaymentProcessingApi.new
49
+ api_instance = CityPayApiClient::AuthorisationAndPaymentApi.new
47
50
 
48
51
  it 'should authorise' do
49
52
  uuid = SecureRandom.uuid
50
53
  result = api_instance.authorisation_request(CityPayApiClient::AuthRequest.new(
51
- merchantid: merchant_id,
52
- cardnumber: "4000000000000002",
53
- csc: "012",
54
- expmonth: 12,
55
- expyear: 2030,
56
- amount: 1395,
57
- identifier: uuid
54
+ merchantid: merchant_id,
55
+ cardnumber: "4000000000000002",
56
+ csc: "012",
57
+ expmonth: 12,
58
+ expyear: 2030,
59
+ amount: 1395,
60
+ identifier: uuid,
61
+ threedsecure: CityPayApiClient::ThreeDSecure.new(tds_policy: "2")
58
62
  ))
59
63
 
60
64
  expect(result.auth_response).to_not be_nil
@@ -63,10 +67,68 @@ describe 'IntegrationTests' do
63
67
 
64
68
  response = result.auth_response
65
69
 
66
- expect(response.identifier == uuid.to_str)
67
- expect(response.authcode == "A12345")
68
- expect(response.amount == 1395)
69
- expect(response.result_code == "001")
70
+ expect(response.identifier).to eq(uuid.to_str)
71
+ expect(response.authcode).to eq("A12345")
72
+ expect(response.amount).to eq(1395)
73
+ expect(response.result_code).to eq("001")
74
+
75
+ expect(DigestUtils.validate_digest(response, licence_key)).to eq(true)
76
+ end
77
+
78
+ end
79
+
80
+ describe 'Run payment processing tests 3DSv2' do
81
+ api_instance = CityPayApiClient::AuthorisationAndPaymentApi.new
82
+
83
+ it 'should authorise 3DSv2' do
84
+ uuid = SecureRandom.uuid
85
+ result = api_instance.authorisation_request(CityPayApiClient::AuthRequest.new(
86
+ merchantid: merchant_id,
87
+ cardnumber: "4000000000000002",
88
+ csc: "123",
89
+ expmonth: 12,
90
+ expyear: 2030,
91
+ amount: 1396,
92
+ identifier: uuid,
93
+ trans_type: "A",
94
+ threedsecure: CityPayApiClient::ThreeDSecure.new(
95
+ cp_bx: "eyJhIjoiRkFwSCIsImMiOjI0LCJpIjoid3dIOTExTlBKSkdBRVhVZCIsImoiOmZhbHNlLCJsIjoiZW4tVVMiLCJoIjoxNDQwLCJ3IjoyNTYwLCJ0IjowLCJ1IjoiTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTFfMl8zKSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODkuMC40Mzg5LjgyIFNhZmFyaS81MzcuMzYiLCJ2IjoiMS4wLjAifQ",
96
+ merchant_termurl: "https://citypay.com/acs/return"
97
+ )
98
+ ))
99
+
100
+ expect(result.auth_response).to be_nil
101
+ expect(result.authen_required).to be_nil
102
+ expect(result.request_challenged).to_not be_nil
103
+
104
+ response = result.request_challenged
105
+
106
+ expect(response.acs_url).to_not be_nil
107
+ expect(response.creq).to_not be_nil
108
+ expect(response.threedserver_trans_id).to_not be_nil
109
+
110
+ content = {
111
+ :threeDSSessionData => response.threedserver_trans_id,
112
+ :creq => response.creq
113
+ }
114
+
115
+ request = Typhoeus::Request.new("https://sandbox.citypay.com/3dsv2/acs",
116
+ method: :post,
117
+ headers: {
118
+ "Content-Type" => "application/json"
119
+ },
120
+ body: content.to_json)
121
+ res = request.run
122
+ c_res = res.response_body
123
+ object = JSON.parse(c_res)
124
+ c_res_auth_request = CityPayApiClient::CResAuthRequest.new({:cres => object['cres']})
125
+
126
+ c_res_request_response = api_instance.c_res_request(c_res_auth_request)
127
+
128
+ expect(c_res_request_response.amount).to eq(1396)
129
+ expect(c_res_request_response.authcode).to eq("A12345")
130
+ expect(c_res_request_response.authen_result).to eq("Y")
131
+ expect(c_res_request_response.authorised).to eq(true)
70
132
  end
71
133
 
72
134
  end
@@ -79,52 +141,53 @@ describe 'IntegrationTests' do
79
141
  it 'should create a new cha' do
80
142
 
81
143
  result = api_instance.account_create(CityPayApiClient::AccountCreate.new(
82
- account_id: cha_id,
83
- contact: CityPayApiClient::ContactDetails.new(
84
- address1: "7 Esplanade",
85
- area: "St Helier",
86
- company: "CityPay Limited",
87
- country: "JE",
88
- email: "dev@citypay.com",
89
- firstname: "Integration",
90
- lastname: "Test",
91
- postcode: "JE2 3QA"
92
- )
144
+ account_id: cha_id,
145
+ contact: CityPayApiClient::ContactDetails.new(
146
+ address1: "7 Esplanade",
147
+ area: "St Helier",
148
+ company: "CityPay Limited",
149
+ country: "JE",
150
+ email: "dev@citypay.com",
151
+ firstname: "Integration",
152
+ lastname: "Test",
153
+ postcode: "JE2 3QA"
154
+ )
93
155
  ))
94
156
 
95
- expect(result.account_id == cha_id)
96
- expect(result.contact.address1 == "7 Esplanade")
157
+ expect(result.account_id).to eq(cha_id)
158
+ expect(result.contact.address1).to eq("7 Esplanade")
97
159
 
98
160
  end
99
161
 
100
162
  it 'should add a card to the account' do
101
163
  result = api_instance.account_card_register_request(cha_id, CityPayApiClient::RegisterCard.new(
102
- cardnumber: "4000000000000002",
103
- expmonth: 12,
104
- expyear: 2030,
105
- ))
106
- expect(result.account_id == cha_id)
107
- expect(result.cards.length == 1)
108
- expect(result.cards[0].expmonth == 12)
109
- expect(result.cards[0].expyear == 2030)
164
+ cardnumber: "4000000000000002",
165
+ expmonth: 12,
166
+ expyear: 2030,
167
+ ))
168
+ expect(result.account_id).to eq(cha_id)
169
+ expect(result.cards.length).to eq(1)
170
+ expect(result.cards[0].expmonth).to eq(12)
171
+ expect(result.cards[0].expyear).to eq(2030)
110
172
 
111
173
  end
112
174
 
113
175
  it 'should retrieve the account and charge against it' do
114
176
  result = api_instance.account_retrieve_request(cha_id)
115
- expect(result.account_id == cha_id)
116
- expect(result.contact.address1 == "7 Esplanade")
117
- expect(result.cards.length == 1)
118
- expect(result.cards[0].expmonth == 12)
119
- expect(result.cards[0].expyear == 2030)
177
+ expect(result.account_id).to eq(cha_id)
178
+ expect(result.contact.address1).to eq("7 Esplanade")
179
+ expect(result.cards.length).to eq(1)
180
+ expect(result.cards[0].expmonth).to eq(12)
181
+ expect(result.cards[0].expyear).to eq(2030)
120
182
 
121
183
  uuid = SecureRandom.uuid
122
184
  result2 = api_instance.charge_request(CityPayApiClient::ChargeRequest.new(
123
- amount: 7801,
124
- csc: "012",
125
- merchantid: merchant_id,
126
- identifier: uuid,
127
- token: result.cards[0].token
185
+ amount: 7801,
186
+ csc: "012",
187
+ merchantid: merchant_id,
188
+ identifier: uuid,
189
+ threedsecure: CityPayApiClient::ThreeDSecure.new(tds_policy: "2"),
190
+ token: result.cards[0].token
128
191
  ))
129
192
 
130
193
  # decision object returned
@@ -134,10 +197,10 @@ describe 'IntegrationTests' do
134
197
 
135
198
  response = result2.auth_response
136
199
 
137
- expect(response.identifier == uuid.to_str)
138
- expect(response.authcode == "A12345")
139
- expect(response.amount == 1395)
140
- expect(response.result_code == "001")
200
+ expect(response.identifier).to eq(uuid.to_str)
201
+ expect(response.authcode).to eq("A12345")
202
+ expect(response.amount).to eq(7801)
203
+ expect(response.result_code).to eq("001")
141
204
 
142
205
  end
143
206
 
@@ -145,10 +208,9 @@ describe 'IntegrationTests' do
145
208
  it 'should delete the cha' do
146
209
 
147
210
  result = api_instance.account_delete_request(cha_id)
148
-
211
+ expect(result.code).to eq("001")
149
212
  end
150
213
 
151
214
  end
152
215
 
153
-
154
- end
216
+ end
@@ -19,7 +19,6 @@ require 'date'
19
19
  describe 'AccountCreate' do
20
20
  before do
21
21
  # run before each test
22
- @instance = CityPayApiClient::AccountCreate.new
23
22
  end
24
23
 
25
24
  after do
@@ -28,7 +27,7 @@ describe 'AccountCreate' do
28
27
 
29
28
  describe 'test an instance of AccountCreate' do
30
29
  it 'should create an instance of AccountCreate' do
31
- expect(@instance).to be_instance_of(CityPayApiClient::AccountCreate)
30
+
32
31
  end
33
32
  end
34
33
  describe 'test attribute "account_id"' do
@@ -19,7 +19,7 @@ require 'date'
19
19
  describe 'AccountStatus' do
20
20
  before do
21
21
  # run before each test
22
- @instance = CityPayApiClient::AccountStatus.new
22
+
23
23
  end
24
24
 
25
25
  after do
@@ -28,7 +28,7 @@ describe 'AccountStatus' do
28
28
 
29
29
  describe 'test an instance of AccountStatus' do
30
30
  it 'should create an instance of AccountStatus' do
31
- expect(@instance).to be_instance_of(CityPayApiClient::AccountStatus)
31
+
32
32
  end
33
33
  end
34
34
  describe 'test attribute "status"' do
@@ -19,7 +19,7 @@ require 'date'
19
19
  describe 'Acknowledgement' do
20
20
  before do
21
21
  # run before each test
22
- json1 = '
22
+ json = '
23
23
  {
24
24
  "code": "000",
25
25
  "context": "1B12WmDZB3EYSbb",
@@ -28,17 +28,7 @@ describe 'Acknowledgement' do
28
28
  }
29
29
  '
30
30
 
31
- json2 = '
32
- { "Acknowledgement": {
33
- "code": "000",
34
- "context": "1B12WmDZB3EYSbb",
35
- "identifier": "testIdentifier",
36
- "message": "System: Accepted Transaction"
37
- }}
38
- '
39
-
40
- @instance1 = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json1, :symbolize_names => true), "Acknowledgement")
41
- @instance2 = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json2, :symbolize_names => true), "Acknowledgement")
31
+ @instance = CityPayApiClient::ApiClient.new.convert_to_type(JSON.parse(json, :symbolize_names => true), "Acknowledgement")
42
32
  end
43
33
 
44
34
  after do
@@ -47,35 +37,30 @@ describe 'Acknowledgement' do
47
37
 
48
38
  describe 'test an instance of Acknowledgement' do
49
39
  it 'should create an instance of Acknowledgement' do
50
- expect(@instance1).to be_instance_of(CityPayApiClient::Acknowledgement)
51
- expect(@instance2).to be_instance_of(CityPayApiClient::Acknowledgement)
40
+ expect(@instance).to be_instance_of(CityPayApiClient::Acknowledgement)
52
41
  end
53
42
  end
54
43
  describe 'test attribute "code"' do
55
44
  it 'should work' do
56
- expect(@instance1.code).to eq("000")
57
- expect(@instance2.code).to eq("000")
45
+ expect(@instance.code).to eq("000")
58
46
  end
59
47
  end
60
48
 
61
49
  describe 'test attribute "context"' do
62
50
  it 'should work' do
63
- expect(@instance1.context).to eq("1B12WmDZB3EYSbb")
64
- expect(@instance2.context).to eq("1B12WmDZB3EYSbb")
51
+ expect(@instance.context).to eq("1B12WmDZB3EYSbb")
65
52
  end
66
53
  end
67
54
 
68
55
  describe 'test attribute "identifier"' do
69
56
  it 'should work' do
70
- expect(@instance1.identifier).to eq("testIdentifier")
71
- expect(@instance2.identifier).to eq("testIdentifier")
57
+ expect(@instance.identifier).to eq("testIdentifier")
72
58
  end
73
59
  end
74
60
 
75
61
  describe 'test attribute "message"' do
76
62
  it 'should work' do
77
- expect(@instance1.message).to eq("System: Accepted Transaction")
78
- expect(@instance2.message).to eq("System: Accepted Transaction")
63
+ expect(@instance.message).to eq("System: Accepted Transaction")
79
64
  end
80
65
  end
81
66
 
@@ -0,0 +1,33 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security <aside class=\"notice\"> Before we begin a reminder that your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council including: </aside> * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 5.3.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'spec_helper'
13
+ require 'json'
14
+ require 'date'
15
+
16
+ # Unit tests for CityPayApiClient::AclCheckRequest
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe CityPayApiClient::AclCheckRequest do
20
+ let(:instance) { CityPayApiClient::AclCheckRequest.new }
21
+
22
+ describe 'test an instance of AclCheckRequest' do
23
+ it 'should create an instance of AclCheckRequest' do
24
+ expect(instance).to be_instance_of(CityPayApiClient::AclCheckRequest)
25
+ end
26
+ end
27
+ describe 'test attribute "ip"' do
28
+ it 'should work' do
29
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ end
31
+ end
32
+
33
+ end