citypay_api_client 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/api_key.rb +16 -0
  104. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  105. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  106. data/lib/citypay_api_client/models/auth_request.rb +79 -33
  107. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  108. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  109. data/lib/citypay_api_client/models/batch.rb +264 -0
  110. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  111. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  112. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  113. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  114. data/lib/citypay_api_client/models/bin.rb +299 -0
  115. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  116. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  117. data/lib/citypay_api_client/models/capture_request.rb +38 -20
  118. data/lib/citypay_api_client/models/card.rb +67 -10
  119. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  120. data/lib/citypay_api_client/models/card_status.rb +21 -8
  121. data/lib/citypay_api_client/models/charge_request.rb +96 -24
  122. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  123. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  124. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  125. data/lib/citypay_api_client/models/decision.rb +21 -8
  126. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  127. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  128. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  129. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  130. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  131. data/lib/citypay_api_client/models/error.rb +35 -12
  132. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  133. data/lib/citypay_api_client/models/exists.rb +244 -0
  134. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  135. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  136. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  137. data/lib/citypay_api_client/models/merchant.rb +21 -8
  138. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  139. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  140. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  142. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  143. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  144. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  145. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  146. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  147. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  148. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  149. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  150. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  151. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  152. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  153. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  154. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  155. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  156. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  157. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  159. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  160. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  161. data/lib/citypay_api_client/models/ping.rb +21 -8
  162. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  163. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  164. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  165. data/lib/citypay_api_client/models/register_card.rb +59 -12
  166. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  167. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  168. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  169. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  170. data/lib/citypay_api_client/models/void_request.rb +22 -19
  171. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  172. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  173. data/lib/citypay_api_client/version.rb +3 -3
  174. data/lib/citypay_api_client.rb +53 -6
  175. data/spec/.DS_Store +0 -0
  176. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  177. data/spec/api/batch_processing_api___spec.rb +70 -0
  178. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  179. data/spec/api/direct_post_api___spec.rb +98 -0
  180. data/spec/api/operational_functions_api___spec.rb +94 -0
  181. data/spec/api/paylink_api___spec.rb +131 -0
  182. data/spec/api_client_spec.rb +4 -4
  183. data/spec/configuration_spec.rb +5 -5
  184. data/spec/it_api_sandbox_spec.rb +222 -0
  185. data/spec/models/acknowledgement_spec.rb +6 -8
  186. data/spec/models/acl_check_request_spec.rb +33 -0
  187. data/spec/models/acl_check_response_model_spec.rb +51 -0
  188. data/spec/models/auth_references_spec.rb +7 -8
  189. data/spec/models/auth_response_spec.rb +29 -30
  190. data/spec/models/batch_report_request_spec.rb +39 -0
  191. data/spec/models/batch_report_response_model_spec.rb +63 -0
  192. data/spec/models/batch_spec.rb +45 -0
  193. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  194. data/spec/models/batch_transaction_spec.rb +51 -0
  195. data/spec/models/bin_lookup_spec.rb +33 -0
  196. data/spec/models/bin_spec.rb +81 -0
  197. data/spec/models/card_holder_account_spec.rb +8 -5
  198. data/spec/models/check_batch_status_response_spec.rb +45 -0
  199. data/spec/models/check_batch_status_spec.rb +39 -0
  200. data/spec/models/decision_spec.rb +1 -1
  201. data/spec/models/direct_post_request_spec.rb +153 -0
  202. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  203. data/spec/models/domain_key_check_request_spec.rb +33 -0
  204. data/spec/models/domain_key_request_spec.rb +45 -0
  205. data/spec/models/domain_key_response_spec.rb +57 -0
  206. data/spec/models/event_data_model_spec.rb +57 -0
  207. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  208. data/spec/models/list_merchants_response_spec.rb +2 -2
  209. data/spec/models/paylink_address_spec.rb +69 -0
  210. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  212. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  213. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  214. data/spec/models/paylink_card_holder_spec.rb +87 -0
  215. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  216. data/spec/models/paylink_cart_spec.rb +69 -0
  217. data/spec/models/paylink_config_spec.rb +159 -0
  218. data/spec/models/paylink_custom_param_spec.rb +87 -0
  219. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  220. data/spec/models/paylink_error_code_spec.rb +39 -0
  221. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  222. data/spec/models/paylink_part_payments_spec.rb +63 -0
  223. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  224. data/spec/models/paylink_state_event_spec.rb +45 -0
  225. data/spec/models/paylink_token_created_spec.rb +111 -0
  226. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  227. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  228. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  229. data/spec/models/paylink_token_status_spec.rb +195 -0
  230. data/spec/models/paylink_ui_spec.rb +51 -0
  231. data/spec/models/process_batch_request_spec.rb +51 -0
  232. data/spec/models/process_batch_response_spec.rb +39 -0
  233. data/spec/models/refund_request_spec.rb +64 -0
  234. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  235. data/spec/spec_helper.rb +2 -2
  236. data/spec/utils/direct_post_mac_spec.rb +13 -0
  237. metadata +212 -37
  238. data/Gemfile.lock +0 -70
  239. data/git_push.sh +0 -58
  240. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  241. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  242. data/lib/citypay_api_client/test.rb +0 -20
  243. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.2.1
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module CityPayApiClient
16
+ class CheckBatchStatusResponse
17
+ attr_accessor :batches
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'batches' => :'batches'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'batches' => :'Array<Batch>'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::CheckBatchStatusResponse` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::CheckBatchStatusResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'batches')
60
+ if (value = attributes[:'batches']).is_a?(Array)
61
+ self.batches = value
62
+ end
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ batches == o.batches
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [batches].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = CityPayApiClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -1,55 +1,56 @@
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 ContactDetails
16
- # The first line of the address for the card holder.
17
+ # The first line of the address for the shipping contact.
17
18
  attr_accessor :address1
18
19
 
19
- # The second line of the address for the card holder.
20
+ # The second line of the address for the shipping contact.
20
21
  attr_accessor :address2
21
22
 
22
- # The third line of the address for the card holder.
23
+ # The third line of the address for the shipping contact.
23
24
  attr_accessor :address3
24
25
 
25
- # The area such as city, department, parish for the card holder.
26
+ # The area such as city, department, parish for the shipping contact.
26
27
  attr_accessor :area
27
28
 
28
- # The company name for the card holder if the contact is a corporate contact.
29
+ # The company name for the shipping contact if the contact is a corporate contact.
29
30
  attr_accessor :company
30
31
 
31
32
  # The country code in ISO 3166 format. The country value may be used for fraud analysis and for acceptance of the transaction.
32
33
  attr_accessor :country
33
34
 
34
- # An email address for the card holder which may be used for correspondence.
35
+ # An email address for the shipping contact which may be used for correspondence.
35
36
  attr_accessor :email
36
37
 
37
- # The first name of the card holder.
38
+ # The first name of the shipping contact.
38
39
  attr_accessor :firstname
39
40
 
40
- # The last name or surname of the card holder.
41
+ # The last name or surname of the shipping contact.
41
42
  attr_accessor :lastname
42
43
 
43
- # A mobile number for the card holder the mobile number is often required by delivery companies to ensure they are able to be in contact when required.
44
+ # A mobile number for the shipping contact the mobile number is often required by delivery companies to ensure they are able to be in contact when required.
44
45
  attr_accessor :mobile_no
45
46
 
46
47
  # The postcode or zip code of the address which may be used for fraud analysis.
47
48
  attr_accessor :postcode
48
49
 
49
- # A telephone number for the card holder.
50
+ # A telephone number for the shipping contact.
50
51
  attr_accessor :telephone_no
51
52
 
52
- # A title for the card holder such as Mr, Mrs, Ms, M. Mme. etc.
53
+ # A title for the shipping contact such as Mr, Mrs, Ms, M. Mme. etc.
53
54
  attr_accessor :title
54
55
 
55
56
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -71,6 +72,11 @@ module CityPayApiClient
71
72
  }
72
73
  end
73
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
74
80
  # Attribute type mapping.
75
81
  def self.openapi_types
76
82
  {
@@ -168,20 +174,24 @@ module CityPayApiClient
168
174
  # @return Array for valid properties with the reasons
169
175
  def list_invalid_properties
170
176
  invalid_properties = Array.new
171
- if !@address1.nil? && @address1.to_s.length > 40
172
- invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 40.')
177
+ if !@address1.nil? && @address1.to_s.length > 50
178
+ invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 50.')
173
179
  end
174
180
 
175
- if !@address2.nil? && @address2.to_s.length > 30
176
- invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 30.')
181
+ if !@address2.nil? && @address2.to_s.length > 50
182
+ invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 50.')
177
183
  end
178
184
 
179
- if !@address3.nil? && @address3.to_s.length > 20
180
- invalid_properties.push('invalid value for "address3", the character length must be smaller than or equal to 20.')
185
+ if !@address3.nil? && @address3.to_s.length > 50
186
+ invalid_properties.push('invalid value for "address3", the character length must be smaller than or equal to 50.')
181
187
  end
182
188
 
183
- if !@area.nil? && @area.to_s.length > 20
184
- invalid_properties.push('invalid value for "area", the character length must be smaller than or equal to 20.')
189
+ if !@area.nil? && @area.to_s.length > 50
190
+ invalid_properties.push('invalid value for "area", the character length must be smaller than or equal to 50.')
191
+ end
192
+
193
+ if !@company.nil? && @company.to_s.length > 50
194
+ invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 50.')
185
195
  end
186
196
 
187
197
  if !@country.nil? && @country.to_s.length > 2
@@ -192,12 +202,16 @@ module CityPayApiClient
192
202
  invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.')
193
203
  end
194
204
 
205
+ if !@email.nil? && @email.to_s.length > 254
206
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 254.')
207
+ end
208
+
195
209
  if !@mobile_no.nil? && @mobile_no.to_s.length > 20
196
210
  invalid_properties.push('invalid value for "mobile_no", the character length must be smaller than or equal to 20.')
197
211
  end
198
212
 
199
- if !@postcode.nil? && @postcode.to_s.length > 10
200
- invalid_properties.push('invalid value for "postcode", the character length must be smaller than or equal to 10.')
213
+ if !@postcode.nil? && @postcode.to_s.length > 16
214
+ invalid_properties.push('invalid value for "postcode", the character length must be smaller than or equal to 16.')
201
215
  end
202
216
 
203
217
  if !@telephone_no.nil? && @telephone_no.to_s.length > 20
@@ -210,14 +224,16 @@ module CityPayApiClient
210
224
  # Check to see if the all the properties in the model are valid
211
225
  # @return true if the model is valid
212
226
  def valid?
213
- return false if !@address1.nil? && @address1.to_s.length > 40
214
- return false if !@address2.nil? && @address2.to_s.length > 30
215
- return false if !@address3.nil? && @address3.to_s.length > 20
216
- return false if !@area.nil? && @area.to_s.length > 20
227
+ return false if !@address1.nil? && @address1.to_s.length > 50
228
+ return false if !@address2.nil? && @address2.to_s.length > 50
229
+ return false if !@address3.nil? && @address3.to_s.length > 50
230
+ return false if !@area.nil? && @area.to_s.length > 50
231
+ return false if !@company.nil? && @company.to_s.length > 50
217
232
  return false if !@country.nil? && @country.to_s.length > 2
218
233
  return false if !@country.nil? && @country.to_s.length < 2
234
+ return false if !@email.nil? && @email.to_s.length > 254
219
235
  return false if !@mobile_no.nil? && @mobile_no.to_s.length > 20
220
- return false if !@postcode.nil? && @postcode.to_s.length > 10
236
+ return false if !@postcode.nil? && @postcode.to_s.length > 16
221
237
  return false if !@telephone_no.nil? && @telephone_no.to_s.length > 20
222
238
  true
223
239
  end
@@ -225,8 +241,8 @@ module CityPayApiClient
225
241
  # Custom attribute writer method with validation
226
242
  # @param [Object] address1 Value to be assigned
227
243
  def address1=(address1)
228
- if !address1.nil? && address1.to_s.length > 40
229
- fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 40.'
244
+ if !address1.nil? && address1.to_s.length > 50
245
+ fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 50.'
230
246
  end
231
247
 
232
248
  @address1 = address1
@@ -235,8 +251,8 @@ module CityPayApiClient
235
251
  # Custom attribute writer method with validation
236
252
  # @param [Object] address2 Value to be assigned
237
253
  def address2=(address2)
238
- if !address2.nil? && address2.to_s.length > 30
239
- fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 30.'
254
+ if !address2.nil? && address2.to_s.length > 50
255
+ fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 50.'
240
256
  end
241
257
 
242
258
  @address2 = address2
@@ -245,8 +261,8 @@ module CityPayApiClient
245
261
  # Custom attribute writer method with validation
246
262
  # @param [Object] address3 Value to be assigned
247
263
  def address3=(address3)
248
- if !address3.nil? && address3.to_s.length > 20
249
- fail ArgumentError, 'invalid value for "address3", the character length must be smaller than or equal to 20.'
264
+ if !address3.nil? && address3.to_s.length > 50
265
+ fail ArgumentError, 'invalid value for "address3", the character length must be smaller than or equal to 50.'
250
266
  end
251
267
 
252
268
  @address3 = address3
@@ -255,13 +271,23 @@ module CityPayApiClient
255
271
  # Custom attribute writer method with validation
256
272
  # @param [Object] area Value to be assigned
257
273
  def area=(area)
258
- if !area.nil? && area.to_s.length > 20
259
- fail ArgumentError, 'invalid value for "area", the character length must be smaller than or equal to 20.'
274
+ if !area.nil? && area.to_s.length > 50
275
+ fail ArgumentError, 'invalid value for "area", the character length must be smaller than or equal to 50.'
260
276
  end
261
277
 
262
278
  @area = area
263
279
  end
264
280
 
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] company Value to be assigned
283
+ def company=(company)
284
+ if !company.nil? && company.to_s.length > 50
285
+ fail ArgumentError, 'invalid value for "company", the character length must be smaller than or equal to 50.'
286
+ end
287
+
288
+ @company = company
289
+ end
290
+
265
291
  # Custom attribute writer method with validation
266
292
  # @param [Object] country Value to be assigned
267
293
  def country=(country)
@@ -276,6 +302,16 @@ module CityPayApiClient
276
302
  @country = country
277
303
  end
278
304
 
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] email Value to be assigned
307
+ def email=(email)
308
+ if !email.nil? && email.to_s.length > 254
309
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.'
310
+ end
311
+
312
+ @email = email
313
+ end
314
+
279
315
  # Custom attribute writer method with validation
280
316
  # @param [Object] mobile_no Value to be assigned
281
317
  def mobile_no=(mobile_no)
@@ -289,8 +325,8 @@ module CityPayApiClient
289
325
  # Custom attribute writer method with validation
290
326
  # @param [Object] postcode Value to be assigned
291
327
  def postcode=(postcode)
292
- if !postcode.nil? && postcode.to_s.length > 10
293
- fail ArgumentError, 'invalid value for "postcode", the character length must be smaller than or equal to 10.'
328
+ if !postcode.nil? && postcode.to_s.length > 16
329
+ fail ArgumentError, 'invalid value for "postcode", the character length must be smaller than or equal to 16.'
294
330
  end
295
331
 
296
332
  @postcode = postcode
@@ -350,8 +386,11 @@ module CityPayApiClient
350
386
  # @return [Object] Returns the model itself
351
387
  def build_from_hash(attributes)
352
388
  return nil unless attributes.is_a?(Hash)
389
+ attributes = attributes.transform_keys(&:to_sym)
353
390
  self.class.openapi_types.each_pair do |key, type|
354
- if type =~ /\AArray<(.*)>/i
391
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
392
+ self.send("#{key}=", nil)
393
+ elsif type =~ /\AArray<(.*)>/i
355
394
  # check to ensure the input is an array given that the attribute
356
395
  # is documented as an array but the input is not
357
396
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -359,7 +398,7 @@ module CityPayApiClient
359
398
  end
360
399
  elsif !attributes[self.class.attribute_map[key]].nil?
361
400
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
362
- end # or else data not found in attributes(hash), not an issue as the data can be optional
401
+ end
363
402
  end
364
403
 
365
404
  self
@@ -371,8 +410,8 @@ module CityPayApiClient
371
410
  # @return [Object] Deserialized data
372
411
  def _deserialize(type, value)
373
412
  case type.to_sym
374
- when :DateTime
375
- DateTime.parse(value)
413
+ when :Time
414
+ Time.parse(value)
376
415
  when :Date
377
416
  Date.parse(value)
378
417
  when :String
@@ -402,7 +441,9 @@ module CityPayApiClient
402
441
  end
403
442
  end
404
443
  else # model
405
- CityPayApiClient.const_get(type).build_from_hash(value)
444
+ # models (e.g. Pet) or oneOf
445
+ klass = CityPayApiClient.const_get(type)
446
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
406
447
  end
407
448
  end
408
449
 
@@ -428,7 +469,7 @@ module CityPayApiClient
428
469
  is_nullable = self.class.openapi_nullable.include?(attr)
429
470
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
430
471
  end
431
-
472
+
432
473
  hash[param] = _to_hash(value)
433
474
  end
434
475
  hash
@@ -451,5 +492,7 @@ module CityPayApiClient
451
492
  value
452
493
  end
453
494
  end
495
+
454
496
  end
497
+
455
498
  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 Decision
@@ -28,6 +29,11 @@ module CityPayApiClient
28
29
  }
29
30
  end
30
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
31
37
  # Attribute type mapping.
32
38
  def self.openapi_types
33
39
  {
@@ -118,8 +124,11 @@ module CityPayApiClient
118
124
  # @return [Object] Returns the model itself
119
125
  def build_from_hash(attributes)
120
126
  return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
121
128
  self.class.openapi_types.each_pair do |key, type|
122
- if type =~ /\AArray<(.*)>/i
129
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ elsif type =~ /\AArray<(.*)>/i
123
132
  # check to ensure the input is an array given that the attribute
124
133
  # is documented as an array but the input is not
125
134
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -127,7 +136,7 @@ module CityPayApiClient
127
136
  end
128
137
  elsif !attributes[self.class.attribute_map[key]].nil?
129
138
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
- end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
131
140
  end
132
141
 
133
142
  self
@@ -139,8 +148,8 @@ module CityPayApiClient
139
148
  # @return [Object] Deserialized data
140
149
  def _deserialize(type, value)
141
150
  case type.to_sym
142
- when :DateTime
143
- DateTime.parse(value)
151
+ when :Time
152
+ Time.parse(value)
144
153
  when :Date
145
154
  Date.parse(value)
146
155
  when :String
@@ -170,7 +179,9 @@ module CityPayApiClient
170
179
  end
171
180
  end
172
181
  else # model
173
- CityPayApiClient.const_get(type).build_from_hash(value)
182
+ # models (e.g. Pet) or oneOf
183
+ klass = CityPayApiClient.const_get(type)
184
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
174
185
  end
175
186
  end
176
187
 
@@ -196,7 +207,7 @@ module CityPayApiClient
196
207
  is_nullable = self.class.openapi_nullable.include?(attr)
197
208
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
209
  end
199
-
210
+
200
211
  hash[param] = _to_hash(value)
201
212
  end
202
213
  hash
@@ -219,5 +230,7 @@ module CityPayApiClient
219
230
  value
220
231
  end
221
232
  end
233
+
222
234
  end
235
+
223
236
  end