citypay_api_client 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/api_key.rb +16 -0
  104. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  105. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  106. data/lib/citypay_api_client/models/auth_request.rb +79 -33
  107. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  108. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  109. data/lib/citypay_api_client/models/batch.rb +264 -0
  110. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  111. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  112. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  113. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  114. data/lib/citypay_api_client/models/bin.rb +299 -0
  115. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  116. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  117. data/lib/citypay_api_client/models/capture_request.rb +38 -20
  118. data/lib/citypay_api_client/models/card.rb +67 -10
  119. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  120. data/lib/citypay_api_client/models/card_status.rb +21 -8
  121. data/lib/citypay_api_client/models/charge_request.rb +96 -24
  122. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  123. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  124. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  125. data/lib/citypay_api_client/models/decision.rb +21 -8
  126. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  127. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  128. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  129. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  130. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  131. data/lib/citypay_api_client/models/error.rb +35 -12
  132. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  133. data/lib/citypay_api_client/models/exists.rb +244 -0
  134. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  135. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  136. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  137. data/lib/citypay_api_client/models/merchant.rb +21 -8
  138. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  139. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  140. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  142. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  143. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  144. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  145. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  146. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  147. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  148. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  149. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  150. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  151. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  152. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  153. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  154. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  155. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  156. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  157. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  159. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  160. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  161. data/lib/citypay_api_client/models/ping.rb +21 -8
  162. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  163. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  164. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  165. data/lib/citypay_api_client/models/register_card.rb +59 -12
  166. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  167. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  168. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  169. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  170. data/lib/citypay_api_client/models/void_request.rb +22 -19
  171. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  172. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  173. data/lib/citypay_api_client/version.rb +3 -3
  174. data/lib/citypay_api_client.rb +53 -6
  175. data/spec/.DS_Store +0 -0
  176. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  177. data/spec/api/batch_processing_api___spec.rb +70 -0
  178. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  179. data/spec/api/direct_post_api___spec.rb +98 -0
  180. data/spec/api/operational_functions_api___spec.rb +94 -0
  181. data/spec/api/paylink_api___spec.rb +131 -0
  182. data/spec/api_client_spec.rb +4 -4
  183. data/spec/configuration_spec.rb +5 -5
  184. data/spec/it_api_sandbox_spec.rb +222 -0
  185. data/spec/models/acknowledgement_spec.rb +6 -8
  186. data/spec/models/acl_check_request_spec.rb +33 -0
  187. data/spec/models/acl_check_response_model_spec.rb +51 -0
  188. data/spec/models/auth_references_spec.rb +7 -8
  189. data/spec/models/auth_response_spec.rb +29 -30
  190. data/spec/models/batch_report_request_spec.rb +39 -0
  191. data/spec/models/batch_report_response_model_spec.rb +63 -0
  192. data/spec/models/batch_spec.rb +45 -0
  193. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  194. data/spec/models/batch_transaction_spec.rb +51 -0
  195. data/spec/models/bin_lookup_spec.rb +33 -0
  196. data/spec/models/bin_spec.rb +81 -0
  197. data/spec/models/card_holder_account_spec.rb +8 -5
  198. data/spec/models/check_batch_status_response_spec.rb +45 -0
  199. data/spec/models/check_batch_status_spec.rb +39 -0
  200. data/spec/models/decision_spec.rb +1 -1
  201. data/spec/models/direct_post_request_spec.rb +153 -0
  202. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  203. data/spec/models/domain_key_check_request_spec.rb +33 -0
  204. data/spec/models/domain_key_request_spec.rb +45 -0
  205. data/spec/models/domain_key_response_spec.rb +57 -0
  206. data/spec/models/event_data_model_spec.rb +57 -0
  207. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  208. data/spec/models/list_merchants_response_spec.rb +2 -2
  209. data/spec/models/paylink_address_spec.rb +69 -0
  210. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  212. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  213. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  214. data/spec/models/paylink_card_holder_spec.rb +87 -0
  215. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  216. data/spec/models/paylink_cart_spec.rb +69 -0
  217. data/spec/models/paylink_config_spec.rb +159 -0
  218. data/spec/models/paylink_custom_param_spec.rb +87 -0
  219. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  220. data/spec/models/paylink_error_code_spec.rb +39 -0
  221. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  222. data/spec/models/paylink_part_payments_spec.rb +63 -0
  223. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  224. data/spec/models/paylink_state_event_spec.rb +45 -0
  225. data/spec/models/paylink_token_created_spec.rb +111 -0
  226. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  227. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  228. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  229. data/spec/models/paylink_token_status_spec.rb +195 -0
  230. data/spec/models/paylink_ui_spec.rb +51 -0
  231. data/spec/models/process_batch_request_spec.rb +51 -0
  232. data/spec/models/process_batch_response_spec.rb +39 -0
  233. data/spec/models/refund_request_spec.rb +64 -0
  234. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  235. data/spec/spec_helper.rb +2 -2
  236. data/spec/utils/direct_post_mac_spec.rb +13 -0
  237. metadata +212 -37
  238. data/Gemfile.lock +0 -70
  239. data/git_push.sh +0 -58
  240. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  241. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  242. data/lib/citypay_api_client/test.rb +0 -20
  243. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -1,15 +1,16 @@
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
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class RegisterCard
@@ -25,23 +26,33 @@ module CityPayApiClient
25
26
  # The expiry year of the card.
26
27
  attr_accessor :expyear
27
28
 
29
+ # The card holder name as it appears on the card. The value is required if the account is to be used for 3dsv2 processing, otherwise it is optional.
30
+ attr_accessor :name_on_card
31
+
28
32
  # Attribute mapping from ruby-style variable name to JSON key.
29
33
  def self.attribute_map
30
34
  {
31
35
  :'cardnumber' => :'cardnumber',
32
36
  :'default' => :'default',
33
37
  :'expmonth' => :'expmonth',
34
- :'expyear' => :'expyear'
38
+ :'expyear' => :'expyear',
39
+ :'name_on_card' => :'name_on_card'
35
40
  }
36
41
  end
37
42
 
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
38
48
  # Attribute type mapping.
39
49
  def self.openapi_types
40
50
  {
41
51
  :'cardnumber' => :'String',
42
52
  :'default' => :'Boolean',
43
53
  :'expmonth' => :'Integer',
44
- :'expyear' => :'Integer'
54
+ :'expyear' => :'Integer',
55
+ :'name_on_card' => :'String'
45
56
  }
46
57
  end
47
58
 
@@ -81,6 +92,10 @@ module CityPayApiClient
81
92
  if attributes.key?(:'expyear')
82
93
  self.expyear = attributes[:'expyear']
83
94
  end
95
+
96
+ if attributes.key?(:'name_on_card')
97
+ self.name_on_card = attributes[:'name_on_card']
98
+ end
84
99
  end
85
100
 
86
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -123,6 +138,14 @@ module CityPayApiClient
123
138
  invalid_properties.push('invalid value for "expyear", must be greater than or equal to 2000.')
124
139
  end
125
140
 
141
+ if !@name_on_card.nil? && @name_on_card.to_s.length > 45
142
+ invalid_properties.push('invalid value for "name_on_card", the character length must be smaller than or equal to 45.')
143
+ end
144
+
145
+ if !@name_on_card.nil? && @name_on_card.to_s.length < 2
146
+ invalid_properties.push('invalid value for "name_on_card", the character length must be great than or equal to 2.')
147
+ end
148
+
126
149
  invalid_properties
127
150
  end
128
151
 
@@ -138,6 +161,8 @@ module CityPayApiClient
138
161
  return false if @expyear.nil?
139
162
  return false if @expyear > 2100
140
163
  return false if @expyear < 2000
164
+ return false if !@name_on_card.nil? && @name_on_card.to_s.length > 45
165
+ return false if !@name_on_card.nil? && @name_on_card.to_s.length < 2
141
166
  true
142
167
  end
143
168
 
@@ -195,6 +220,20 @@ module CityPayApiClient
195
220
  @expyear = expyear
196
221
  end
197
222
 
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] name_on_card Value to be assigned
225
+ def name_on_card=(name_on_card)
226
+ if !name_on_card.nil? && name_on_card.to_s.length > 45
227
+ fail ArgumentError, 'invalid value for "name_on_card", the character length must be smaller than or equal to 45.'
228
+ end
229
+
230
+ if !name_on_card.nil? && name_on_card.to_s.length < 2
231
+ fail ArgumentError, 'invalid value for "name_on_card", the character length must be great than or equal to 2.'
232
+ end
233
+
234
+ @name_on_card = name_on_card
235
+ end
236
+
198
237
  # Checks equality by comparing each attribute.
199
238
  # @param [Object] Object to be compared
200
239
  def ==(o)
@@ -203,7 +242,8 @@ module CityPayApiClient
203
242
  cardnumber == o.cardnumber &&
204
243
  default == o.default &&
205
244
  expmonth == o.expmonth &&
206
- expyear == o.expyear
245
+ expyear == o.expyear &&
246
+ name_on_card == o.name_on_card
207
247
  end
208
248
 
209
249
  # @see the `==` method
@@ -215,7 +255,7 @@ module CityPayApiClient
215
255
  # Calculates hash code according to all attributes.
216
256
  # @return [Integer] Hash code
217
257
  def hash
218
- [cardnumber, default, expmonth, expyear].hash
258
+ [cardnumber, default, expmonth, expyear, name_on_card].hash
219
259
  end
220
260
 
221
261
  # Builds the object from hash
@@ -230,8 +270,11 @@ module CityPayApiClient
230
270
  # @return [Object] Returns the model itself
231
271
  def build_from_hash(attributes)
232
272
  return nil unless attributes.is_a?(Hash)
273
+ attributes = attributes.transform_keys(&:to_sym)
233
274
  self.class.openapi_types.each_pair do |key, type|
234
- if type =~ /\AArray<(.*)>/i
275
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
276
+ self.send("#{key}=", nil)
277
+ elsif type =~ /\AArray<(.*)>/i
235
278
  # check to ensure the input is an array given that the attribute
236
279
  # is documented as an array but the input is not
237
280
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -239,7 +282,7 @@ module CityPayApiClient
239
282
  end
240
283
  elsif !attributes[self.class.attribute_map[key]].nil?
241
284
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
242
- end # or else data not found in attributes(hash), not an issue as the data can be optional
285
+ end
243
286
  end
244
287
 
245
288
  self
@@ -251,8 +294,8 @@ module CityPayApiClient
251
294
  # @return [Object] Deserialized data
252
295
  def _deserialize(type, value)
253
296
  case type.to_sym
254
- when :DateTime
255
- DateTime.parse(value)
297
+ when :Time
298
+ Time.parse(value)
256
299
  when :Date
257
300
  Date.parse(value)
258
301
  when :String
@@ -282,7 +325,9 @@ module CityPayApiClient
282
325
  end
283
326
  end
284
327
  else # model
285
- CityPayApiClient.const_get(type).build_from_hash(value)
328
+ # models (e.g. Pet) or oneOf
329
+ klass = CityPayApiClient.const_get(type)
330
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
286
331
  end
287
332
  end
288
333
 
@@ -308,7 +353,7 @@ module CityPayApiClient
308
353
  is_nullable = self.class.openapi_nullable.include?(attr)
309
354
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
310
355
  end
311
-
356
+
312
357
  hash[param] = _to_hash(value)
313
358
  end
314
359
  hash
@@ -331,5 +376,7 @@ module CityPayApiClient
331
376
  value
332
377
  end
333
378
  end
379
+
334
380
  end
381
+
335
382
  end
@@ -1,15 +1,16 @@
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
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class RequestChallenged
@@ -22,8 +23,8 @@ module CityPayApiClient
22
23
  # The merchant id that processed this transaction.
23
24
  attr_accessor :merchantid
24
25
 
25
- # The 3DSv2 trans id reference for the challenge process.
26
- attr_accessor :three_d_server_trans_id
26
+ # The 3DSv2 trans id reference for the challenge process. May be used to create the ThreeDSSessionData value to send to the ACS.
27
+ attr_accessor :threedserver_trans_id
27
28
 
28
29
  # The transaction number for the challenge, ordered incrementally from 1 for every merchant_id.
29
30
  attr_accessor :transno
@@ -34,18 +35,23 @@ module CityPayApiClient
34
35
  :'acs_url' => :'acs_url',
35
36
  :'creq' => :'creq',
36
37
  :'merchantid' => :'merchantid',
37
- :'three_d_server_trans_id' => :'ThreeDServerTransId',
38
+ :'threedserver_trans_id' => :'threedserver_trans_id',
38
39
  :'transno' => :'transno'
39
40
  }
40
41
  end
41
42
 
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
42
48
  # Attribute type mapping.
43
49
  def self.openapi_types
44
50
  {
45
51
  :'acs_url' => :'String',
46
52
  :'creq' => :'String',
47
53
  :'merchantid' => :'Integer',
48
- :'three_d_server_trans_id' => :'String',
54
+ :'threedserver_trans_id' => :'String',
49
55
  :'transno' => :'Integer'
50
56
  }
51
57
  end
@@ -83,8 +89,8 @@ module CityPayApiClient
83
89
  self.merchantid = attributes[:'merchantid']
84
90
  end
85
91
 
86
- if attributes.key?(:'three_d_server_trans_id')
87
- self.three_d_server_trans_id = attributes[:'three_d_server_trans_id']
92
+ if attributes.key?(:'threedserver_trans_id')
93
+ self.threedserver_trans_id = attributes[:'threedserver_trans_id']
88
94
  end
89
95
 
90
96
  if attributes.key?(:'transno')
@@ -113,7 +119,7 @@ module CityPayApiClient
113
119
  acs_url == o.acs_url &&
114
120
  creq == o.creq &&
115
121
  merchantid == o.merchantid &&
116
- three_d_server_trans_id == o.three_d_server_trans_id &&
122
+ threedserver_trans_id == o.threedserver_trans_id &&
117
123
  transno == o.transno
118
124
  end
119
125
 
@@ -126,7 +132,7 @@ module CityPayApiClient
126
132
  # Calculates hash code according to all attributes.
127
133
  # @return [Integer] Hash code
128
134
  def hash
129
- [acs_url, creq, merchantid, three_d_server_trans_id, transno].hash
135
+ [acs_url, creq, merchantid, threedserver_trans_id, transno].hash
130
136
  end
131
137
 
132
138
  # Builds the object from hash
@@ -141,8 +147,11 @@ module CityPayApiClient
141
147
  # @return [Object] Returns the model itself
142
148
  def build_from_hash(attributes)
143
149
  return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
144
151
  self.class.openapi_types.each_pair do |key, type|
145
- if type =~ /\AArray<(.*)>/i
152
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ elsif type =~ /\AArray<(.*)>/i
146
155
  # check to ensure the input is an array given that the attribute
147
156
  # is documented as an array but the input is not
148
157
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -150,7 +159,7 @@ module CityPayApiClient
150
159
  end
151
160
  elsif !attributes[self.class.attribute_map[key]].nil?
152
161
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
- end # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
154
163
  end
155
164
 
156
165
  self
@@ -162,8 +171,8 @@ module CityPayApiClient
162
171
  # @return [Object] Deserialized data
163
172
  def _deserialize(type, value)
164
173
  case type.to_sym
165
- when :DateTime
166
- DateTime.parse(value)
174
+ when :Time
175
+ Time.parse(value)
167
176
  when :Date
168
177
  Date.parse(value)
169
178
  when :String
@@ -193,7 +202,9 @@ module CityPayApiClient
193
202
  end
194
203
  end
195
204
  else # model
196
- CityPayApiClient.const_get(type).build_from_hash(value)
205
+ # models (e.g. Pet) or oneOf
206
+ klass = CityPayApiClient.const_get(type)
207
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
208
  end
198
209
  end
199
210
 
@@ -219,7 +230,7 @@ module CityPayApiClient
219
230
  is_nullable = self.class.openapi_nullable.include?(attr)
220
231
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
232
  end
222
-
233
+
223
234
  hash[param] = _to_hash(value)
224
235
  end
225
236
  hash
@@ -242,5 +253,7 @@ module CityPayApiClient
242
253
  value
243
254
  end
244
255
  end
256
+
245
257
  end
258
+
246
259
  end
@@ -1,15 +1,16 @@
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
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class RetrieveRequest
@@ -31,6 +32,11 @@ module CityPayApiClient
31
32
  }
32
33
  end
33
34
 
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
34
40
  # Attribute type mapping.
35
41
  def self.openapi_types
36
42
  {
@@ -150,8 +156,11 @@ module CityPayApiClient
150
156
  # @return [Object] Returns the model itself
151
157
  def build_from_hash(attributes)
152
158
  return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
153
160
  self.class.openapi_types.each_pair do |key, type|
154
- if type =~ /\AArray<(.*)>/i
161
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ elsif type =~ /\AArray<(.*)>/i
155
164
  # check to ensure the input is an array given that the attribute
156
165
  # is documented as an array but the input is not
157
166
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -159,7 +168,7 @@ module CityPayApiClient
159
168
  end
160
169
  elsif !attributes[self.class.attribute_map[key]].nil?
161
170
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
- end # or else data not found in attributes(hash), not an issue as the data can be optional
171
+ end
163
172
  end
164
173
 
165
174
  self
@@ -171,8 +180,8 @@ module CityPayApiClient
171
180
  # @return [Object] Deserialized data
172
181
  def _deserialize(type, value)
173
182
  case type.to_sym
174
- when :DateTime
175
- DateTime.parse(value)
183
+ when :Time
184
+ Time.parse(value)
176
185
  when :Date
177
186
  Date.parse(value)
178
187
  when :String
@@ -202,7 +211,9 @@ module CityPayApiClient
202
211
  end
203
212
  end
204
213
  else # model
205
- CityPayApiClient.const_get(type).build_from_hash(value)
214
+ # models (e.g. Pet) or oneOf
215
+ klass = CityPayApiClient.const_get(type)
216
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
217
  end
207
218
  end
208
219
 
@@ -228,7 +239,7 @@ module CityPayApiClient
228
239
  is_nullable = self.class.openapi_nullable.include?(attr)
229
240
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
241
  end
231
-
242
+
232
243
  hash[param] = _to_hash(value)
233
244
  end
234
245
  hash
@@ -251,5 +262,7 @@ module CityPayApiClient
251
262
  value
252
263
  end
253
264
  end
265
+
254
266
  end
267
+
255
268
  end
@@ -1,37 +1,70 @@
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
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class ThreeDSecure
16
- # The content of the HTTP accept header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
17
+ # Required for 3DSv1. Optional if the `cp_bx` value is provided otherwise required for 3Dv2 processing operating in browser authentication mode. The `cp_bx` value will override any value supplied to this field. The content of the HTTP accept header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
17
18
  attr_accessor :accept_headers
18
19
 
20
+ # BrowserColorDepth field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
21
+ attr_accessor :browser_color_depth
22
+
23
+ # BrowserIP field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
24
+ attr_accessor :browser_ip
25
+
26
+ # BrowserJavaEnabled field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
27
+ attr_accessor :browser_java_enabled
28
+
29
+ # BrowserLanguage field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
30
+ attr_accessor :browser_language
31
+
32
+ # BrowserScreenHeight field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
33
+ attr_accessor :browser_screen_height
34
+
35
+ # BrowserScreenWidth field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
36
+ attr_accessor :browser_screen_width
37
+
38
+ # BrowserTZ field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
39
+ attr_accessor :browser_tz
40
+
41
+ # Required for 3DSv2. Browser extension value produced by the citypay.js `bx` function. See [https://sandbox.citypay.com/3dsv2/bx](https://sandbox.citypay.com/3dsv2/bx) for details.
42
+ attr_accessor :cp_bx
43
+
19
44
  # Where a merchant is configured for 3DSv2, setting this option will attempt to downgrade the transaction to 3DSv1.
20
45
  attr_accessor :downgrade1
21
46
 
22
- # A controller URL for 3D-Secure processing that any response from an authentication request or challenge request should be sent to. The controller should forward on the response from the URL back via this API for subsequent processing. Required if 3DSv1 or 3DSv2 is required.
47
+ # A controller URL for 3D-Secure processing that any response from an authentication request or challenge request should be sent to. The controller should forward on the response from the URL back via this API for subsequent processing.
23
48
  attr_accessor :merchant_termurl
24
49
 
25
- # A policy value which determines whether ThreeDSecure is enforced or bypassed. Note that this will only work for e-commerce transactions and accounts that have 3DSecure enabled and fully registered with Visa, MasterCard or American Express. It is useful when transactions may be wanted to bypass processing rules. Note that this may affect the liability shift of transactions and may occur a higher fee with the acquiring bank. 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 will be enabled for 3DS processing `2` to bypass. Transactions that are bypassed will switch off 3DS processing.
50
+ # A policy value which determines whether ThreeDSecure is enforced or bypassed. Note that this will only work for e-commerce transactions and accounts that have 3DSecure enabled and fully registered with Visa, MasterCard or American Express. It is useful when transactions may be wanted to bypass processing rules. Note that this may affect the liability shift of transactions and may occur a higher fee with the acquiring bank. 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 will be enabled for 3DS processing `2` to bypass. Transactions that are bypassed will switch off 3DS processing.
26
51
  attr_accessor :tds_policy
27
52
 
28
- # The content of the HTTP user-agent header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
53
+ # Required for 3DSv1. Optional if the `cp_bx` value is provided otherwise required 3Dv2 processing operating in browser authentication mode. The `cp_bx` value will override any value supplied to this field. The content of the HTTP user-agent header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
29
54
  attr_accessor :user_agent
30
55
 
31
56
  # Attribute mapping from ruby-style variable name to JSON key.
32
57
  def self.attribute_map
33
58
  {
34
59
  :'accept_headers' => :'accept_headers',
60
+ :'browser_color_depth' => :'browserColorDepth',
61
+ :'browser_ip' => :'browserIP',
62
+ :'browser_java_enabled' => :'browserJavaEnabled',
63
+ :'browser_language' => :'browserLanguage',
64
+ :'browser_screen_height' => :'browserScreenHeight',
65
+ :'browser_screen_width' => :'browserScreenWidth',
66
+ :'browser_tz' => :'browserTZ',
67
+ :'cp_bx' => :'cp_bx',
35
68
  :'downgrade1' => :'downgrade1',
36
69
  :'merchant_termurl' => :'merchant_termurl',
37
70
  :'tds_policy' => :'tds_policy',
@@ -39,10 +72,23 @@ module CityPayApiClient
39
72
  }
40
73
  end
41
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
42
80
  # Attribute type mapping.
43
81
  def self.openapi_types
44
82
  {
45
83
  :'accept_headers' => :'String',
84
+ :'browser_color_depth' => :'String',
85
+ :'browser_ip' => :'String',
86
+ :'browser_java_enabled' => :'String',
87
+ :'browser_language' => :'String',
88
+ :'browser_screen_height' => :'String',
89
+ :'browser_screen_width' => :'String',
90
+ :'browser_tz' => :'String',
91
+ :'cp_bx' => :'String',
46
92
  :'downgrade1' => :'Boolean',
47
93
  :'merchant_termurl' => :'String',
48
94
  :'tds_policy' => :'String',
@@ -75,6 +121,38 @@ module CityPayApiClient
75
121
  self.accept_headers = attributes[:'accept_headers']
76
122
  end
77
123
 
124
+ if attributes.key?(:'browser_color_depth')
125
+ self.browser_color_depth = attributes[:'browser_color_depth']
126
+ end
127
+
128
+ if attributes.key?(:'browser_ip')
129
+ self.browser_ip = attributes[:'browser_ip']
130
+ end
131
+
132
+ if attributes.key?(:'browser_java_enabled')
133
+ self.browser_java_enabled = attributes[:'browser_java_enabled']
134
+ end
135
+
136
+ if attributes.key?(:'browser_language')
137
+ self.browser_language = attributes[:'browser_language']
138
+ end
139
+
140
+ if attributes.key?(:'browser_screen_height')
141
+ self.browser_screen_height = attributes[:'browser_screen_height']
142
+ end
143
+
144
+ if attributes.key?(:'browser_screen_width')
145
+ self.browser_screen_width = attributes[:'browser_screen_width']
146
+ end
147
+
148
+ if attributes.key?(:'browser_tz')
149
+ self.browser_tz = attributes[:'browser_tz']
150
+ end
151
+
152
+ if attributes.key?(:'cp_bx')
153
+ self.cp_bx = attributes[:'cp_bx']
154
+ end
155
+
78
156
  if attributes.key?(:'downgrade1')
79
157
  self.downgrade1 = attributes[:'downgrade1']
80
158
  end
@@ -111,6 +189,14 @@ module CityPayApiClient
111
189
  return true if self.equal?(o)
112
190
  self.class == o.class &&
113
191
  accept_headers == o.accept_headers &&
192
+ browser_color_depth == o.browser_color_depth &&
193
+ browser_ip == o.browser_ip &&
194
+ browser_java_enabled == o.browser_java_enabled &&
195
+ browser_language == o.browser_language &&
196
+ browser_screen_height == o.browser_screen_height &&
197
+ browser_screen_width == o.browser_screen_width &&
198
+ browser_tz == o.browser_tz &&
199
+ cp_bx == o.cp_bx &&
114
200
  downgrade1 == o.downgrade1 &&
115
201
  merchant_termurl == o.merchant_termurl &&
116
202
  tds_policy == o.tds_policy &&
@@ -126,7 +212,7 @@ module CityPayApiClient
126
212
  # Calculates hash code according to all attributes.
127
213
  # @return [Integer] Hash code
128
214
  def hash
129
- [accept_headers, downgrade1, merchant_termurl, tds_policy, user_agent].hash
215
+ [accept_headers, browser_color_depth, browser_ip, browser_java_enabled, browser_language, browser_screen_height, browser_screen_width, browser_tz, cp_bx, downgrade1, merchant_termurl, tds_policy, user_agent].hash
130
216
  end
131
217
 
132
218
  # Builds the object from hash
@@ -141,8 +227,11 @@ module CityPayApiClient
141
227
  # @return [Object] Returns the model itself
142
228
  def build_from_hash(attributes)
143
229
  return nil unless attributes.is_a?(Hash)
230
+ attributes = attributes.transform_keys(&:to_sym)
144
231
  self.class.openapi_types.each_pair do |key, type|
145
- if type =~ /\AArray<(.*)>/i
232
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
233
+ self.send("#{key}=", nil)
234
+ elsif type =~ /\AArray<(.*)>/i
146
235
  # check to ensure the input is an array given that the attribute
147
236
  # is documented as an array but the input is not
148
237
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -150,7 +239,7 @@ module CityPayApiClient
150
239
  end
151
240
  elsif !attributes[self.class.attribute_map[key]].nil?
152
241
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
- end # or else data not found in attributes(hash), not an issue as the data can be optional
242
+ end
154
243
  end
155
244
 
156
245
  self
@@ -162,8 +251,8 @@ module CityPayApiClient
162
251
  # @return [Object] Deserialized data
163
252
  def _deserialize(type, value)
164
253
  case type.to_sym
165
- when :DateTime
166
- DateTime.parse(value)
254
+ when :Time
255
+ Time.parse(value)
167
256
  when :Date
168
257
  Date.parse(value)
169
258
  when :String
@@ -193,7 +282,9 @@ module CityPayApiClient
193
282
  end
194
283
  end
195
284
  else # model
196
- CityPayApiClient.const_get(type).build_from_hash(value)
285
+ # models (e.g. Pet) or oneOf
286
+ klass = CityPayApiClient.const_get(type)
287
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
197
288
  end
198
289
  end
199
290
 
@@ -219,7 +310,7 @@ module CityPayApiClient
219
310
  is_nullable = self.class.openapi_nullable.include?(attr)
220
311
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
312
  end
222
-
313
+
223
314
  hash[param] = _to_hash(value)
224
315
  end
225
316
  hash
@@ -242,5 +333,7 @@ module CityPayApiClient
242
333
  value
243
334
  end
244
335
  end
336
+
245
337
  end
338
+
246
339
  end