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
@@ -1,49 +1,58 @@
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 an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
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: 7.2.0
9
9
 
10
10
  =end
11
11
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class ChargeRequest
16
- # The amount to authorise in the lowest unit of currency with a variable length to a maximum of 12 digits. No decimal points are to be included and no divisional characters such as 1,024. The amount should be the total amount required for the transaction. For example with GBP £1,021.95 the amount value is 102195.
17
+ # The amount to authorise in the lowest unit of currency with a variable length to a maximum of 12 digits. No decimal points are to be included and no divisional characters such as 1,024. The amount should be the total amount required for the transaction. For example with GBP £1,021.95 the amount value is 102195.
17
18
  attr_accessor :amount
18
19
 
19
- # A policy value which determines whether an AVS postcode policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS postcode numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the postcode did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send postcode details for authorisation.
20
+ # A policy value which determines whether an AVS postcode policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS postcode numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the postcode did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send postcode details for authorisation.
20
21
  attr_accessor :avs_postcode_policy
21
22
 
22
- # The Card Security Code (CSC) (also known as CV2/CVV2) is normally found on the back of the card (American Express has it on the front). The value helps to identify posession of the card as it is not available within the chip or magnetic swipe. When forwarding the CSC, please ensure the value is a string as some values start with 0 and this will be stripped out by any integer parsing. The CSC number aids fraud prevention in Mail Order and Internet payments. Business rules are available on your account to identify whether to accept or decline transactions based on mismatched results of the CSC. The Payment Card Industry (PCI) requires that at no stage of a transaction should the CSC be stored. This applies to all entities handling card data. It should also not be used in any hashing process. CityPay do not store the value and have no method of retrieving the value once the transaction has been processed. For this reason, duplicate checking is unable to determine the CSC in its duplication check algorithm.
23
+ # Merchant-initiated transactions (MITs) are payments you trigger, where the cardholder has previously consented to you carrying out such payments. These may be scheduled (such as recurring payments and installments) or unscheduled (like account top-ups triggered by balance thresholds and no-show charges). Scheduled --- These are regular payments using stored card details, like installments or a monthly subscription fee. - `I` Instalment - A single purchase of goods or services billed to a cardholder in multiple transactions, over a period of time agreed by the cardholder and you. - `R` Recurring - Transactions processed at fixed, regular intervals not to exceed one year between transactions, representing an agreement between a cardholder and you to purchase goods or services provided over a period of time. Unscheduled --- These are payments using stored card details that do not occur on a regular schedule, like top-ups for a digital wallet triggered by the balance falling below a certain threshold. - `A` Reauthorisation - a purchase made after the original purchase. A common scenario is delayed/split shipments. - `C` Unscheduled Payment - A transaction using a stored credential for a fixed or variable amount that does not occur on a scheduled or regularly occurring transaction date. This includes account top-ups triggered by balance thresholds. - `D` Delayed Charge - A delayed charge is typically used in hotel, cruise lines and vehicle rental environments to perform a supplemental account charge after original services are rendered. - `L` Incremental - An incremental authorisation is typically found in hotel and car rental environments, where the cardholder has agreed to pay for any service incurred during the duration of the contract. An incremental authorisation is where you need to seek authorisation of further funds in addition to what you have originally requested. A common scenario is additional services charged to the contract, such as extending a stay in a hotel. - `S` Resubmission - When the original purchase occurred, but you were not able to get authorisation at the time the goods or services were provided. It should be only used where the goods or services have already been provided, but the authorisation request is declined for insufficient funds. - `X` No-show - A no-show is a transaction where you are enabled to charge for services which the cardholder entered into an agreement to purchase, but the cardholder did not meet the terms of the agreement.
24
+ attr_accessor :cardholder_agreement
25
+
26
+ # The Card Security Code (CSC) (also known as CV2/CVV2) is normally found on the back of the card (American Express has it on the front). The value helps to identify posession of the card as it is not available within the chip or magnetic swipe. When forwarding the CSC, please ensure the value is a string as some values start with 0 and this will be stripped out by any integer parsing. The CSC number aids fraud prevention in Mail Order and Internet payments. Business rules are available on your account to identify whether to accept or decline transactions based on mismatched results of the CSC. The Payment Card Industry (PCI) requires that at no stage of a transaction should the CSC be stored. This applies to all entities handling card data. It should also not be used in any hashing process. CityPay do not store the value and have no method of retrieving the value once the transaction has been processed. For this reason, duplicate checking is unable to determine the CSC in its duplication check algorithm.
23
27
  attr_accessor :csc
24
28
 
25
- # A policy value which determines whether a CSC policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the CSC value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the CSC did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send the CSC details for authorisation.
29
+ # A policy value which determines whether a CSC policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the CSC value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the CSC did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send the CSC details for authorisation.
26
30
  attr_accessor :csc_policy
27
31
 
28
32
  # The processing currency for the transaction. Will default to the merchant account currency.
29
33
  attr_accessor :currency
30
34
 
31
- # A policy value which determines whether a duplication policy is enforced or bypassed. A duplication check has a window of time set against your account within which it can action. If a previous transaction with matching values occurred within the window, any subsequent transaction will result in a T001 result. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be checked for duplication within the duplication window. `2` to bypass. Transactions that are bypassed will not be checked for duplication within the duplication window. `3` to ignore. Transactions that are ignored will have the same affect as bypass.
35
+ # A policy value which determines whether a duplication policy is enforced or bypassed. A duplication check has a window of time set against your account within which it can action. If a previous transaction with matching values occurred within the window, any subsequent transaction will result in a T001 result. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be checked for duplication within the duplication window. `2` to bypass. Transactions that are bypassed will not be checked for duplication within the duplication window. `3` to ignore. Transactions that are ignored will have the same affect as bypass.
32
36
  attr_accessor :duplicate_policy
33
37
 
34
- # The identifier of the transaction to process. The value should be a valid reference and may be used to perform post processing actions and to aid in reconciliation of transactions. The value should be a valid printable string with ASCII character ranges from 32 to 127. The identifier is recommended to be distinct for each transaction such as a [random unique identifier](https://en.wikipedia.org/wiki/Universally_unique_identifier) this will aid in ensuring each transaction is identifiable. When transactions are processed they are also checked for duplicate requests. Changing the identifier on a subsequent request will ensure that a transaction is considered as different.
38
+ # The identifier of the transaction to process. The value should be a valid reference and may be used to perform post processing actions and to aid in reconciliation of transactions. The value should be a valid printable string with ASCII character ranges from 0x32 to 0x127. The identifier is recommended to be distinct for each transaction such as a [random unique identifier](https://en.wikipedia.org/wiki/Universally_unique_identifier) this will aid in ensuring each transaction is identifiable. When transactions are processed they are also checked for duplicate requests. Changing the identifier on a subsequent request will ensure that a transaction is considered as different.
35
39
  attr_accessor :identifier
36
40
 
37
- # A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS address numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the address did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send address numeric details for authorisation.
41
+ # Transactions charged using the API are defined as: **Cardholder Initiated**: A _cardholder initiated transaction_ (CIT) is where the cardholder selects the card for use for a purchase using previously stored details. An example would be a customer buying an item from your website after being present with their saved card details at checkout. **Merchant Intiated**: A _merchant initiated transaction_ (MIT) is an authorisation initiated where you as the merchant submit a cardholders previously stored details without the cardholder's participation. An example would be a subscription to a membership scheme to debit their card monthly. MITs have different reasons such as reauthorisation, delayed, unscheduled, incremental, recurring, instalment, no-show or resubmission. The following values apply - `M` - specifies that the transaction is initiated by the merchant - `C` - specifies that the transaction is initiated by the cardholder Where transactions are merchant initiated, a valid cardholder agreement must be defined.
42
+ attr_accessor :initiation
43
+
44
+ # A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS address numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the address did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send address numeric details for authorisation.
38
45
  attr_accessor :match_avsa
39
46
 
40
47
  # Identifies the merchant account to perform processing for.
41
48
  attr_accessor :merchantid
42
49
 
43
- # An optional reference value for the calling client such as a version number i.e.
44
- attr_accessor :sdk
50
+ # A \"tag\" is a label that you can attach to a payment authorization. Tags can help you group transactions together based on certain criteria, like a work job or a ticket number. They can also assist in filtering transactions when you're generating reports. Multiple Tags You can add more than one tag to a transaction by separating them with commas. Limitations There is a maximum limit of 3 tags that can be added to a single transaction. Each tag can be no longer than 20 characters and alphanumeric with no spaces. Example: Let's say you're a software company and you have different teams working on various projects. When a team makes a purchase or incurs an expense, they can tag the transaction with the project name, the team name, and the type of expense. Project Name: Project_X Team Name: Team_A Type of Expense: Hardware So, the tag for a transaction might look like: Project_X,Team_A,Hardware This way, when you're looking at your financial reports, you can easily filter transactions based on these tags to see how much each project or team is spending on different types of expenses.
51
+ attr_accessor :tag
45
52
 
46
- # A tokenised form of a card that belongs to a card holder's account and that has been previously registered. The token is time based and will only be active for a short duration. The value is therefore designed not to be stored remotely for future use. Tokens will start with ct and are resiliently tamper proof using HMacSHA-256. No sensitive card data is stored internally within the token. Each card will contain a different token and the value may be different on any retrieval call. The value can be presented for payment as a selection value to an end user in a web application.
53
+ attr_accessor :threedsecure
54
+
55
+ # A tokenised form of a card that belongs to a card holder's account and that has been previously registered. The token is time based and will only be active for a short duration. The value is therefore designed not to be stored remotely for future use. Tokens will start with ct and are resiliently tamper proof using HMacSHA-256. No sensitive card data is stored internally within the token. Each card will contain a different token and the value may be different on any retrieval call. The value can be presented for payment as a selection value to an end user in a web application.
47
56
  attr_accessor :token
48
57
 
49
58
  # Further information that can be added to the transaction will display in reporting. Can be used for flexible values such as operator id.
@@ -57,33 +66,44 @@ module CityPayApiClient
57
66
  {
58
67
  :'amount' => :'amount',
59
68
  :'avs_postcode_policy' => :'avs_postcode_policy',
69
+ :'cardholder_agreement' => :'cardholder_agreement',
60
70
  :'csc' => :'csc',
61
71
  :'csc_policy' => :'csc_policy',
62
72
  :'currency' => :'currency',
63
73
  :'duplicate_policy' => :'duplicate_policy',
64
74
  :'identifier' => :'identifier',
75
+ :'initiation' => :'initiation',
65
76
  :'match_avsa' => :'match_avsa',
66
77
  :'merchantid' => :'merchantid',
67
- :'sdk' => :'sdk',
78
+ :'tag' => :'tag',
79
+ :'threedsecure' => :'threedsecure',
68
80
  :'token' => :'token',
69
81
  :'trans_info' => :'trans_info',
70
82
  :'trans_type' => :'trans_type'
71
83
  }
72
84
  end
73
85
 
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ attribute_map.values
89
+ end
90
+
74
91
  # Attribute type mapping.
75
92
  def self.openapi_types
76
93
  {
77
94
  :'amount' => :'Integer',
78
95
  :'avs_postcode_policy' => :'String',
96
+ :'cardholder_agreement' => :'String',
79
97
  :'csc' => :'String',
80
98
  :'csc_policy' => :'String',
81
99
  :'currency' => :'String',
82
100
  :'duplicate_policy' => :'String',
83
101
  :'identifier' => :'String',
102
+ :'initiation' => :'String',
84
103
  :'match_avsa' => :'String',
85
104
  :'merchantid' => :'Integer',
86
- :'sdk' => :'String',
105
+ :'tag' => :'String',
106
+ :'threedsecure' => :'ThreeDSecure',
87
107
  :'token' => :'String',
88
108
  :'trans_info' => :'String',
89
109
  :'trans_type' => :'String'
@@ -113,12 +133,18 @@ module CityPayApiClient
113
133
 
114
134
  if attributes.key?(:'amount')
115
135
  self.amount = attributes[:'amount']
136
+ else
137
+ self.amount = nil
116
138
  end
117
139
 
118
140
  if attributes.key?(:'avs_postcode_policy')
119
141
  self.avs_postcode_policy = attributes[:'avs_postcode_policy']
120
142
  end
121
143
 
144
+ if attributes.key?(:'cardholder_agreement')
145
+ self.cardholder_agreement = attributes[:'cardholder_agreement']
146
+ end
147
+
122
148
  if attributes.key?(:'csc')
123
149
  self.csc = attributes[:'csc']
124
150
  end
@@ -137,6 +163,12 @@ module CityPayApiClient
137
163
 
138
164
  if attributes.key?(:'identifier')
139
165
  self.identifier = attributes[:'identifier']
166
+ else
167
+ self.identifier = nil
168
+ end
169
+
170
+ if attributes.key?(:'initiation')
171
+ self.initiation = attributes[:'initiation']
140
172
  end
141
173
 
142
174
  if attributes.key?(:'match_avsa')
@@ -145,16 +177,22 @@ module CityPayApiClient
145
177
 
146
178
  if attributes.key?(:'merchantid')
147
179
  self.merchantid = attributes[:'merchantid']
180
+ else
181
+ self.merchantid = nil
148
182
  end
149
183
 
150
- if attributes.key?(:'sdk')
151
- self.sdk = attributes[:'sdk']
152
- else
153
- self.sdk = CityPayApiClient::FULL_VERSION
184
+ if attributes.key?(:'tag')
185
+ self.tag = attributes[:'tag']
186
+ end
187
+
188
+ if attributes.key?(:'threedsecure')
189
+ self.threedsecure = attributes[:'threedsecure']
154
190
  end
155
191
 
156
192
  if attributes.key?(:'token')
157
193
  self.token = attributes[:'token']
194
+ else
195
+ self.token = nil
158
196
  end
159
197
 
160
198
  if attributes.key?(:'trans_info')
@@ -169,11 +207,16 @@ module CityPayApiClient
169
207
  # Show invalid properties with the reasons. Usually used together with valid?
170
208
  # @return Array for valid properties with the reasons
171
209
  def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
211
  invalid_properties = Array.new
173
212
  if @amount.nil?
174
213
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
175
214
  end
176
215
 
216
+ if !@cardholder_agreement.nil? && @cardholder_agreement.to_s.length > 1
217
+ invalid_properties.push('invalid value for "cardholder_agreement", the character length must be smaller than or equal to 1.')
218
+ end
219
+
177
220
  if !@csc.nil? && @csc.to_s.length > 4
178
221
  invalid_properties.push('invalid value for "csc", the character length must be smaller than or equal to 4.')
179
222
  end
@@ -202,6 +245,10 @@ module CityPayApiClient
202
245
  invalid_properties.push('invalid value for "identifier", the character length must be great than or equal to 4.')
203
246
  end
204
247
 
248
+ if !@initiation.nil? && @initiation.to_s.length > 1
249
+ invalid_properties.push('invalid value for "initiation", the character length must be smaller than or equal to 1.')
250
+ end
251
+
205
252
  if @merchantid.nil?
206
253
  invalid_properties.push('invalid value for "merchantid", merchantid cannot be nil.')
207
254
  end
@@ -224,7 +271,9 @@ module CityPayApiClient
224
271
  # Check to see if the all the properties in the model are valid
225
272
  # @return true if the model is valid
226
273
  def valid?
274
+ warn '[DEPRECATED] the `valid?` method is obsolete'
227
275
  return false if @amount.nil?
276
+ return false if !@cardholder_agreement.nil? && @cardholder_agreement.to_s.length > 1
228
277
  return false if !@csc.nil? && @csc.to_s.length > 4
229
278
  return false if !@csc.nil? && @csc.to_s.length < 3
230
279
  return false if !@currency.nil? && @currency.to_s.length > 3
@@ -232,6 +281,7 @@ module CityPayApiClient
232
281
  return false if @identifier.nil?
233
282
  return false if @identifier.to_s.length > 50
234
283
  return false if @identifier.to_s.length < 4
284
+ return false if !@initiation.nil? && @initiation.to_s.length > 1
235
285
  return false if @merchantid.nil?
236
286
  return false if @token.nil?
237
287
  return false if !@trans_info.nil? && @trans_info.to_s.length > 50
@@ -239,14 +289,42 @@ module CityPayApiClient
239
289
  true
240
290
  end
241
291
 
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] amount Value to be assigned
294
+ def amount=(amount)
295
+ if amount.nil?
296
+ fail ArgumentError, 'amount cannot be nil'
297
+ end
298
+
299
+ @amount = amount
300
+ end
301
+
302
+ # Custom attribute writer method with validation
303
+ # @param [Object] cardholder_agreement Value to be assigned
304
+ def cardholder_agreement=(cardholder_agreement)
305
+ if cardholder_agreement.nil?
306
+ fail ArgumentError, 'cardholder_agreement cannot be nil'
307
+ end
308
+
309
+ if cardholder_agreement.to_s.length > 1
310
+ fail ArgumentError, 'invalid value for "cardholder_agreement", the character length must be smaller than or equal to 1.'
311
+ end
312
+
313
+ @cardholder_agreement = cardholder_agreement
314
+ end
315
+
242
316
  # Custom attribute writer method with validation
243
317
  # @param [Object] csc Value to be assigned
244
318
  def csc=(csc)
245
- if !csc.nil? && csc.to_s.length > 4
319
+ if csc.nil?
320
+ fail ArgumentError, 'csc cannot be nil'
321
+ end
322
+
323
+ if csc.to_s.length > 4
246
324
  fail ArgumentError, 'invalid value for "csc", the character length must be smaller than or equal to 4.'
247
325
  end
248
326
 
249
- if !csc.nil? && csc.to_s.length < 3
327
+ if csc.to_s.length < 3
250
328
  fail ArgumentError, 'invalid value for "csc", the character length must be great than or equal to 3.'
251
329
  end
252
330
 
@@ -256,11 +334,15 @@ module CityPayApiClient
256
334
  # Custom attribute writer method with validation
257
335
  # @param [Object] currency Value to be assigned
258
336
  def currency=(currency)
259
- if !currency.nil? && currency.to_s.length > 3
337
+ if currency.nil?
338
+ fail ArgumentError, 'currency cannot be nil'
339
+ end
340
+
341
+ if currency.to_s.length > 3
260
342
  fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
261
343
  end
262
344
 
263
- if !currency.nil? && currency.to_s.length < 3
345
+ if currency.to_s.length < 3
264
346
  fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
265
347
  end
266
348
 
@@ -285,10 +367,28 @@ module CityPayApiClient
285
367
  @identifier = identifier
286
368
  end
287
369
 
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] initiation Value to be assigned
372
+ def initiation=(initiation)
373
+ if initiation.nil?
374
+ fail ArgumentError, 'initiation cannot be nil'
375
+ end
376
+
377
+ if initiation.to_s.length > 1
378
+ fail ArgumentError, 'invalid value for "initiation", the character length must be smaller than or equal to 1.'
379
+ end
380
+
381
+ @initiation = initiation
382
+ end
383
+
288
384
  # Custom attribute writer method with validation
289
385
  # @param [Object] trans_info Value to be assigned
290
386
  def trans_info=(trans_info)
291
- if !trans_info.nil? && trans_info.to_s.length > 50
387
+ if trans_info.nil?
388
+ fail ArgumentError, 'trans_info cannot be nil'
389
+ end
390
+
391
+ if trans_info.to_s.length > 50
292
392
  fail ArgumentError, 'invalid value for "trans_info", the character length must be smaller than or equal to 50.'
293
393
  end
294
394
 
@@ -298,7 +398,11 @@ module CityPayApiClient
298
398
  # Custom attribute writer method with validation
299
399
  # @param [Object] trans_type Value to be assigned
300
400
  def trans_type=(trans_type)
301
- if !trans_type.nil? && trans_type.to_s.length > 1
401
+ if trans_type.nil?
402
+ fail ArgumentError, 'trans_type cannot be nil'
403
+ end
404
+
405
+ if trans_type.to_s.length > 1
302
406
  fail ArgumentError, 'invalid value for "trans_type", the character length must be smaller than or equal to 1.'
303
407
  end
304
408
 
@@ -312,14 +416,17 @@ module CityPayApiClient
312
416
  self.class == o.class &&
313
417
  amount == o.amount &&
314
418
  avs_postcode_policy == o.avs_postcode_policy &&
419
+ cardholder_agreement == o.cardholder_agreement &&
315
420
  csc == o.csc &&
316
421
  csc_policy == o.csc_policy &&
317
422
  currency == o.currency &&
318
423
  duplicate_policy == o.duplicate_policy &&
319
424
  identifier == o.identifier &&
425
+ initiation == o.initiation &&
320
426
  match_avsa == o.match_avsa &&
321
427
  merchantid == o.merchantid &&
322
- sdk == o.sdk &&
428
+ tag == o.tag &&
429
+ threedsecure == o.threedsecure &&
323
430
  token == o.token &&
324
431
  trans_info == o.trans_info &&
325
432
  trans_type == o.trans_type
@@ -334,44 +441,40 @@ module CityPayApiClient
334
441
  # Calculates hash code according to all attributes.
335
442
  # @return [Integer] Hash code
336
443
  def hash
337
- [amount, avs_postcode_policy, csc, csc_policy, currency, duplicate_policy, identifier, match_avsa, merchantid, sdk, token, trans_info, trans_type].hash
444
+ [amount, avs_postcode_policy, cardholder_agreement, csc, csc_policy, currency, duplicate_policy, identifier, initiation, match_avsa, merchantid, tag, threedsecure, token, trans_info, trans_type].hash
338
445
  end
339
446
 
340
447
  # Builds the object from hash
341
448
  # @param [Hash] attributes Model attributes in the form of hash
342
449
  # @return [Object] Returns the model itself
343
450
  def self.build_from_hash(attributes)
344
- new.build_from_hash(attributes)
345
- end
346
-
347
- # Builds the object from hash
348
- # @param [Hash] attributes Model attributes in the form of hash
349
- # @return [Object] Returns the model itself
350
- def build_from_hash(attributes)
351
451
  return nil unless attributes.is_a?(Hash)
352
- self.class.openapi_types.each_pair do |key, type|
353
- if type =~ /\AArray<(.*)>/i
452
+ attributes = attributes.transform_keys(&:to_sym)
453
+ transformed_hash = {}
454
+ openapi_types.each_pair do |key, type|
455
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
456
+ transformed_hash["#{key}"] = nil
457
+ elsif type =~ /\AArray<(.*)>/i
354
458
  # check to ensure the input is an array given that the attribute
355
459
  # is documented as an array but the input is not
356
- if attributes[self.class.attribute_map[key]].is_a?(Array)
357
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
460
+ if attributes[attribute_map[key]].is_a?(Array)
461
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
358
462
  end
359
- elsif !attributes[self.class.attribute_map[key]].nil?
360
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
361
- end # or else data not found in attributes(hash), not an issue as the data can be optional
463
+ elsif !attributes[attribute_map[key]].nil?
464
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
465
+ end
362
466
  end
363
-
364
- self
467
+ new(transformed_hash)
365
468
  end
366
469
 
367
470
  # Deserializes the data based on type
368
471
  # @param string type Data type
369
472
  # @param string value Value to be deserialized
370
473
  # @return [Object] Deserialized data
371
- def _deserialize(type, value)
474
+ def self._deserialize(type, value)
372
475
  case type.to_sym
373
- when :DateTime
374
- DateTime.parse(value)
476
+ when :Time
477
+ Time.parse(value)
375
478
  when :Date
376
479
  Date.parse(value)
377
480
  when :String
@@ -401,7 +504,9 @@ module CityPayApiClient
401
504
  end
402
505
  end
403
506
  else # model
404
- CityPayApiClient.const_get(type).build_from_hash(value)
507
+ # models (e.g. Pet) or oneOf
508
+ klass = CityPayApiClient.const_get(type)
509
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
405
510
  end
406
511
  end
407
512
 
@@ -427,7 +532,7 @@ module CityPayApiClient
427
532
  is_nullable = self.class.openapi_nullable.include?(attr)
428
533
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
429
534
  end
430
-
535
+
431
536
  hash[param] = _to_hash(value)
432
537
  end
433
538
  hash
@@ -450,5 +555,7 @@ module CityPayApiClient
450
555
  value
451
556
  end
452
557
  end
558
+
453
559
  end
560
+
454
561
  end