citypay_api_client 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +73 -0
  3. data/README.md +59 -32
  4. data/citypay_api_client.gemspec +1 -1
  5. data/docs/Acknowledgement.md +2 -2
  6. data/docs/AclCheckResponseModel.md +3 -3
  7. data/docs/AuthRequest.md +7 -7
  8. data/docs/AuthResponse.md +4 -4
  9. data/docs/AuthorisationAndPaymentApi.md +75 -231
  10. data/docs/Batch.md +1 -1
  11. data/docs/BatchProcessingApi.md +11 -11
  12. data/docs/BatchReportResponseModel.md +2 -2
  13. data/docs/BatchTransaction.md +1 -1
  14. data/docs/BatchTransactionReportRequest.md +22 -0
  15. data/docs/BatchTransactionReportResponse.md +24 -0
  16. data/docs/BatchTransactionResultModel.md +1 -1
  17. data/docs/Bin.md +2 -2
  18. data/docs/CaptureRequest.md +1 -1
  19. data/docs/Card.md +2 -2
  20. data/docs/CardHolderAccountApi.md +9 -5
  21. data/docs/ChargeRequest.md +7 -7
  22. data/docs/Decision.md +0 -2
  23. data/docs/DirectPostApi.md +2 -16
  24. data/docs/DirectPostRequest.md +7 -7
  25. data/docs/EventDataModel.md +2 -2
  26. data/docs/MerchantBatchReportRequest.md +28 -0
  27. data/docs/MerchantBatchReportResponse.md +24 -0
  28. data/docs/MerchantBatchResponse.md +30 -0
  29. data/docs/NetSummaryResponse.md +32 -0
  30. data/docs/PaylinkAdjustmentRequest.md +1 -1
  31. data/docs/PaylinkApi.md +141 -1
  32. data/docs/PaylinkBillPaymentTokenRequest.md +1 -1
  33. data/docs/PaylinkErrorCode.md +2 -2
  34. data/docs/PaylinkResendNotificationRequest.md +20 -0
  35. data/docs/PaylinkStateEvent.md +4 -4
  36. data/docs/PaylinkTokenCreated.md +11 -11
  37. data/docs/PaylinkTokenStatus.md +7 -7
  38. data/docs/PaylinkTokenStatusChangeRequest.md +7 -7
  39. data/docs/PaylinkTokenStatusChangeResponse.md +6 -2
  40. data/docs/PaymentIntent.md +42 -0
  41. data/docs/PaymentIntentReference.md +18 -0
  42. data/docs/RefundRequest.md +1 -1
  43. data/docs/RemittanceData.md +28 -0
  44. data/docs/RemittanceReportRequest.md +28 -0
  45. data/docs/RemittanceReportResponse.md +24 -0
  46. data/docs/RemittedClientData.md +44 -0
  47. data/docs/ReportingApi.md +378 -0
  48. data/docs/TokenisationResponseModel.md +1 -1
  49. data/lib/.DS_Store +0 -0
  50. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +71 -3
  51. data/lib/citypay_api_client/api/batch_processing_api__.rb +7 -7
  52. data/lib/citypay_api_client/api/card_holder_account_api__.rb +4 -1
  53. data/lib/citypay_api_client/api/direct_post_api__.rb +5 -5
  54. data/lib/citypay_api_client/api/operational_functions_api__.rb +1 -1
  55. data/lib/citypay_api_client/api/paylink_api__.rb +138 -1
  56. data/lib/citypay_api_client/api/reporting_api__.rb +381 -0
  57. data/lib/citypay_api_client/api_client.rb +1 -1
  58. data/lib/citypay_api_client/api_error.rb +1 -1
  59. data/lib/citypay_api_client/configuration.rb +1 -1
  60. data/lib/citypay_api_client/models/account_create.rb +1 -1
  61. data/lib/citypay_api_client/models/account_status.rb +1 -1
  62. data/lib/citypay_api_client/models/acknowledgement.rb +1 -29
  63. data/lib/citypay_api_client/models/acl_check_request.rb +1 -1
  64. data/lib/citypay_api_client/models/acl_check_response_model.rb +2 -2
  65. data/lib/citypay_api_client/models/airline_advice.rb +1 -1
  66. data/lib/citypay_api_client/models/airline_segment.rb +1 -1
  67. data/lib/citypay_api_client/models/auth_reference.rb +1 -1
  68. data/lib/citypay_api_client/models/auth_references.rb +1 -1
  69. data/lib/citypay_api_client/models/auth_request.rb +10 -9
  70. data/lib/citypay_api_client/models/auth_response.rb +2 -2
  71. data/lib/citypay_api_client/models/batch.rb +2 -2
  72. data/lib/citypay_api_client/models/batch_report_request.rb +1 -1
  73. data/lib/citypay_api_client/models/batch_report_response_model.rb +2 -2
  74. data/lib/citypay_api_client/models/batch_transaction.rb +1 -1
  75. data/lib/citypay_api_client/models/batch_transaction_report_request.rb +234 -0
  76. data/lib/citypay_api_client/models/batch_transaction_report_response.rb +252 -0
  77. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +1 -1
  78. data/lib/citypay_api_client/models/bin.rb +1 -1
  79. data/lib/citypay_api_client/models/bin_lookup.rb +1 -1
  80. data/lib/citypay_api_client/models/c_res_auth_request.rb +1 -1
  81. data/lib/citypay_api_client/models/capture_request.rb +1 -1
  82. data/lib/citypay_api_client/models/card.rb +1 -1
  83. data/lib/citypay_api_client/models/card_holder_account.rb +1 -1
  84. data/lib/citypay_api_client/models/card_status.rb +1 -1
  85. data/lib/citypay_api_client/models/charge_request.rb +10 -9
  86. data/lib/citypay_api_client/models/check_batch_status.rb +1 -1
  87. data/lib/citypay_api_client/models/check_batch_status_response.rb +1 -1
  88. data/lib/citypay_api_client/models/contact_details.rb +1 -1
  89. data/lib/citypay_api_client/models/decision.rb +2 -11
  90. data/lib/citypay_api_client/models/direct_post_request.rb +10 -9
  91. data/lib/citypay_api_client/models/direct_token_auth_request.rb +1 -1
  92. data/lib/citypay_api_client/models/domain_key_check_request.rb +1 -1
  93. data/lib/citypay_api_client/models/domain_key_request.rb +1 -1
  94. data/lib/citypay_api_client/models/domain_key_response.rb +1 -1
  95. data/lib/citypay_api_client/models/error.rb +1 -1
  96. data/lib/citypay_api_client/models/event_data_model.rb +1 -1
  97. data/lib/citypay_api_client/models/exists.rb +1 -1
  98. data/lib/citypay_api_client/models/external_mpi.rb +1 -1
  99. data/lib/citypay_api_client/models/list_merchants_response.rb +1 -1
  100. data/lib/citypay_api_client/models/mcc6012.rb +1 -1
  101. data/lib/citypay_api_client/models/merchant.rb +1 -1
  102. data/lib/citypay_api_client/models/merchant_batch_report_request.rb +265 -0
  103. data/lib/citypay_api_client/models/merchant_batch_report_response.rb +252 -0
  104. data/lib/citypay_api_client/models/merchant_batch_response.rb +301 -0
  105. data/lib/citypay_api_client/models/net_summary_response.rb +472 -0
  106. data/lib/citypay_api_client/models/pa_res_auth_request.rb +1 -1
  107. data/lib/citypay_api_client/models/paylink_address.rb +1 -1
  108. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +1 -1
  109. data/lib/citypay_api_client/models/paylink_attachment_request.rb +1 -1
  110. data/lib/citypay_api_client/models/paylink_attachment_result.rb +1 -1
  111. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +1 -1
  112. data/lib/citypay_api_client/models/paylink_card_holder.rb +1 -1
  113. data/lib/citypay_api_client/models/paylink_cart.rb +1 -1
  114. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +1 -1
  115. data/lib/citypay_api_client/models/paylink_config.rb +1 -1
  116. data/lib/citypay_api_client/models/paylink_custom_param.rb +1 -1
  117. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +1 -1
  118. data/lib/citypay_api_client/models/paylink_error_code.rb +1 -1
  119. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +1 -1
  120. data/lib/citypay_api_client/models/paylink_part_payments.rb +1 -1
  121. data/lib/citypay_api_client/models/paylink_resend_notification_request.rb +224 -0
  122. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +1 -1
  123. data/lib/citypay_api_client/models/paylink_state_event.rb +2 -2
  124. data/lib/citypay_api_client/models/paylink_token_created.rb +36 -8
  125. data/lib/citypay_api_client/models/paylink_token_request_model.rb +1 -1
  126. data/lib/citypay_api_client/models/paylink_token_status.rb +30 -2
  127. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +6 -7
  128. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +23 -3
  129. data/lib/citypay_api_client/models/paylink_ui.rb +1 -1
  130. data/lib/citypay_api_client/models/payment_intent.rb +479 -0
  131. data/lib/citypay_api_client/models/payment_intent_reference.rb +221 -0
  132. data/lib/citypay_api_client/models/ping.rb +1 -1
  133. data/lib/citypay_api_client/models/process_batch_request.rb +1 -1
  134. data/lib/citypay_api_client/models/process_batch_response.rb +1 -1
  135. data/lib/citypay_api_client/models/refund_request.rb +1 -1
  136. data/lib/citypay_api_client/models/register_card.rb +1 -1
  137. data/lib/citypay_api_client/models/remittance_data.rb +404 -0
  138. data/lib/citypay_api_client/models/remittance_report_request.rb +265 -0
  139. data/lib/citypay_api_client/models/remittance_report_response.rb +252 -0
  140. data/lib/citypay_api_client/models/remitted_client_data.rb +612 -0
  141. data/lib/citypay_api_client/models/request_challenged.rb +1 -1
  142. data/lib/citypay_api_client/models/retrieve_request.rb +1 -1
  143. data/lib/citypay_api_client/models/three_d_secure.rb +1 -1
  144. data/lib/citypay_api_client/models/tokenisation_response_model.rb +1 -1
  145. data/lib/citypay_api_client/models/void_request.rb +1 -1
  146. data/lib/citypay_api_client/version.rb +2 -2
  147. data/lib/citypay_api_client.rb +15 -2
  148. data/spec/.DS_Store +0 -0
  149. data/spec/api/reporting_api___spec.rb +99 -0
  150. data/spec/it_api_sandbox_spec.rb +0 -3
  151. data/spec/models/batch_transaction_report_request_spec.rb +47 -0
  152. data/spec/models/batch_transaction_report_response_spec.rb +53 -0
  153. data/spec/models/decision_spec.rb +0 -26
  154. data/spec/models/merchant_batch_report_request_spec.rb +65 -0
  155. data/spec/models/merchant_batch_report_response_spec.rb +53 -0
  156. data/spec/models/merchant_batch_response_spec.rb +71 -0
  157. data/spec/models/net_summary_response_spec.rb +77 -0
  158. data/spec/models/paylink_resend_notification_request_spec.rb +41 -0
  159. data/spec/models/payment_intent_reference_spec.rb +35 -0
  160. data/spec/models/payment_intent_spec.rb +107 -0
  161. data/spec/models/remittance_data_spec.rb +65 -0
  162. data/spec/models/remittance_report_request_spec.rb +65 -0
  163. data/spec/models/remittance_report_response_spec.rb +53 -0
  164. data/spec/models/remitted_client_data_spec.rb +113 -0
  165. data/spec/spec_helper.rb +1 -1
  166. metadata +124 -69
  167. data/spec/models/authen_required_spec.rb +0 -52
@@ -0,0 +1,404 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # Welcome to the CityPay API, a robust HTTP API payment solution designed for seamless server-to-server transactional processing. Our API facilitates a wide array of payment operations, catering to diverse business needs. Whether you're integrating Internet payments, handling Mail Order/Telephone Order (MOTO) transactions, managing Subscriptions with Recurring and Continuous Authority payments, or navigating the complexities of 3-D Secure authentication, our API is equipped to support your requirements. Additionally, we offer functionalities for Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids, and Completion processing, alongside the capability for tokenised payments. ## Compliance and Security Overview <aside class=\"notice\"> Ensuring the security of payment transactions and compliance with industry standards is paramount. Our API is designed with stringent security measures and compliance protocols to safeguard sensitive information and meet the rigorous requirements of Visa, MasterCard, and the PCI Security Standards Council. </aside> ### Key Compliance and Security Measures * **TLS Encryption**: All data transmissions must utilise TLS version 1.2 or higher, employing [strong cryptography](#enabled-tls-ciphers). Our infrastructure strictly enforces this requirement to maintain the integrity and confidentiality of data in transit. We conduct regular scans and assessments of our TLS endpoints to identify and mitigate vulnerabilities. * **Data Storage Prohibitions**: Storing sensitive cardholder data (CHD), such as the card security code (CSC) or primary account number (PAN), is strictly prohibited. Our API is designed to minimize your exposure to sensitive data, thereby reducing your compliance burden. * **Data Masking**: For consumer protection and compliance, full card numbers must not be displayed on receipts or any customer-facing materials. Our API automatically masks PANs, displaying only the last four digits to facilitate safe receipt generation. * **Network Scans**: If your application is web-based, regular scans of your hosting environment are mandatory to identify and rectify potential vulnerabilities. This proactive measure is crucial for maintaining a secure and compliant online presence. * **PCI Compliance**: Adherence to PCI DSS standards is not optional; it's a requirement for operating securely and legally in the payments ecosystem. For detailed information on compliance requirements and resources, please visit the PCI Security Standards Council website [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/). * **Request Validation**: Our API includes mechanisms to verify the legitimacy of each request, ensuring it pertains to a valid account and originates from a trusted source. We leverage remote IP address verification alongside sophisticated application firewall technologies to thwart a wide array of common security threats. ## Getting Started Before integrating with the CityPay API, ensure your application and development practices align with the outlined compliance and security measures. This preparatory step is crucial for a smooth integration process and the long-term success of your payment processing operations. For further details on API endpoints, request/response formats, and code examples, proceed to the subsequent sections of our documentation. Our aim is to provide you with all the necessary tools and information to integrate our payment processing capabilities seamlessly into your application. Thank you for choosing CityPay API. We look forward to supporting your payment processing needs with our secure, compliant, and versatile API solution.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 7.2.0
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module CityPayApiClient
16
+ class RemittanceData
17
+ # Represents the date and time when the remittance was processed. This timestamp follows the ISO 8601 format for datetime representation.
18
+ attr_accessor :date_created
19
+
20
+ # Represents the net amount after accounting for refunds. This is calculated as SalesAmount - RefundAmount and expressed in the smallest currency unit.
21
+ attr_accessor :net_amount
22
+
23
+ # The total amount refunded to customers.
24
+ attr_accessor :refund_amount
25
+
26
+ # The total number of refund transactions processed. This figure helps in understanding the frequency of refunds relative to sales.
27
+ attr_accessor :refund_count
28
+
29
+ # The total monetary amount of sales transactions.
30
+ attr_accessor :sales_amount
31
+
32
+ # Indicates the total number of sales transactions that occurred. This count provides insight into the volume of sales.
33
+ attr_accessor :sales_count
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'date_created' => :'date_created',
39
+ :'net_amount' => :'net_amount',
40
+ :'refund_amount' => :'refund_amount',
41
+ :'refund_count' => :'refund_count',
42
+ :'sales_amount' => :'sales_amount',
43
+ :'sales_count' => :'sales_count'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'date_created' => :'Time',
56
+ :'net_amount' => :'Integer',
57
+ :'refund_amount' => :'Integer',
58
+ :'refund_count' => :'Integer',
59
+ :'sales_amount' => :'Integer',
60
+ :'sales_count' => :'Integer'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::RemittanceData` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::RemittanceData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'date_created')
86
+ self.date_created = attributes[:'date_created']
87
+ end
88
+
89
+ if attributes.key?(:'net_amount')
90
+ self.net_amount = attributes[:'net_amount']
91
+ end
92
+
93
+ if attributes.key?(:'refund_amount')
94
+ self.refund_amount = attributes[:'refund_amount']
95
+ end
96
+
97
+ if attributes.key?(:'refund_count')
98
+ self.refund_count = attributes[:'refund_count']
99
+ end
100
+
101
+ if attributes.key?(:'sales_amount')
102
+ self.sales_amount = attributes[:'sales_amount']
103
+ end
104
+
105
+ if attributes.key?(:'sales_count')
106
+ self.sales_count = attributes[:'sales_count']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if !@net_amount.nil? && @net_amount > 999999999
116
+ invalid_properties.push('invalid value for "net_amount", must be smaller than or equal to 999999999.')
117
+ end
118
+
119
+ if !@net_amount.nil? && @net_amount < 0
120
+ invalid_properties.push('invalid value for "net_amount", must be greater than or equal to 0.')
121
+ end
122
+
123
+ if !@refund_amount.nil? && @refund_amount > 999999999
124
+ invalid_properties.push('invalid value for "refund_amount", must be smaller than or equal to 999999999.')
125
+ end
126
+
127
+ if !@refund_amount.nil? && @refund_amount < 0
128
+ invalid_properties.push('invalid value for "refund_amount", must be greater than or equal to 0.')
129
+ end
130
+
131
+ if !@refund_count.nil? && @refund_count > 999999999
132
+ invalid_properties.push('invalid value for "refund_count", must be smaller than or equal to 999999999.')
133
+ end
134
+
135
+ if !@refund_count.nil? && @refund_count < 0
136
+ invalid_properties.push('invalid value for "refund_count", must be greater than or equal to 0.')
137
+ end
138
+
139
+ if !@sales_amount.nil? && @sales_amount > 999999999
140
+ invalid_properties.push('invalid value for "sales_amount", must be smaller than or equal to 999999999.')
141
+ end
142
+
143
+ if !@sales_amount.nil? && @sales_amount < 0
144
+ invalid_properties.push('invalid value for "sales_amount", must be greater than or equal to 0.')
145
+ end
146
+
147
+ if !@sales_count.nil? && @sales_count > 999999999
148
+ invalid_properties.push('invalid value for "sales_count", must be smaller than or equal to 999999999.')
149
+ end
150
+
151
+ if !@sales_count.nil? && @sales_count < 0
152
+ invalid_properties.push('invalid value for "sales_count", must be greater than or equal to 0.')
153
+ end
154
+
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ warn '[DEPRECATED] the `valid?` method is obsolete'
162
+ return false if !@net_amount.nil? && @net_amount > 999999999
163
+ return false if !@net_amount.nil? && @net_amount < 0
164
+ return false if !@refund_amount.nil? && @refund_amount > 999999999
165
+ return false if !@refund_amount.nil? && @refund_amount < 0
166
+ return false if !@refund_count.nil? && @refund_count > 999999999
167
+ return false if !@refund_count.nil? && @refund_count < 0
168
+ return false if !@sales_amount.nil? && @sales_amount > 999999999
169
+ return false if !@sales_amount.nil? && @sales_amount < 0
170
+ return false if !@sales_count.nil? && @sales_count > 999999999
171
+ return false if !@sales_count.nil? && @sales_count < 0
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] net_amount Value to be assigned
177
+ def net_amount=(net_amount)
178
+ if net_amount.nil?
179
+ fail ArgumentError, 'net_amount cannot be nil'
180
+ end
181
+
182
+ if net_amount > 999999999
183
+ fail ArgumentError, 'invalid value for "net_amount", must be smaller than or equal to 999999999.'
184
+ end
185
+
186
+ if net_amount < 0
187
+ fail ArgumentError, 'invalid value for "net_amount", must be greater than or equal to 0.'
188
+ end
189
+
190
+ @net_amount = net_amount
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] refund_amount Value to be assigned
195
+ def refund_amount=(refund_amount)
196
+ if refund_amount.nil?
197
+ fail ArgumentError, 'refund_amount cannot be nil'
198
+ end
199
+
200
+ if refund_amount > 999999999
201
+ fail ArgumentError, 'invalid value for "refund_amount", must be smaller than or equal to 999999999.'
202
+ end
203
+
204
+ if refund_amount < 0
205
+ fail ArgumentError, 'invalid value for "refund_amount", must be greater than or equal to 0.'
206
+ end
207
+
208
+ @refund_amount = refund_amount
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] refund_count Value to be assigned
213
+ def refund_count=(refund_count)
214
+ if refund_count.nil?
215
+ fail ArgumentError, 'refund_count cannot be nil'
216
+ end
217
+
218
+ if refund_count > 999999999
219
+ fail ArgumentError, 'invalid value for "refund_count", must be smaller than or equal to 999999999.'
220
+ end
221
+
222
+ if refund_count < 0
223
+ fail ArgumentError, 'invalid value for "refund_count", must be greater than or equal to 0.'
224
+ end
225
+
226
+ @refund_count = refund_count
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] sales_amount Value to be assigned
231
+ def sales_amount=(sales_amount)
232
+ if sales_amount.nil?
233
+ fail ArgumentError, 'sales_amount cannot be nil'
234
+ end
235
+
236
+ if sales_amount > 999999999
237
+ fail ArgumentError, 'invalid value for "sales_amount", must be smaller than or equal to 999999999.'
238
+ end
239
+
240
+ if sales_amount < 0
241
+ fail ArgumentError, 'invalid value for "sales_amount", must be greater than or equal to 0.'
242
+ end
243
+
244
+ @sales_amount = sales_amount
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] sales_count Value to be assigned
249
+ def sales_count=(sales_count)
250
+ if sales_count.nil?
251
+ fail ArgumentError, 'sales_count cannot be nil'
252
+ end
253
+
254
+ if sales_count > 999999999
255
+ fail ArgumentError, 'invalid value for "sales_count", must be smaller than or equal to 999999999.'
256
+ end
257
+
258
+ if sales_count < 0
259
+ fail ArgumentError, 'invalid value for "sales_count", must be greater than or equal to 0.'
260
+ end
261
+
262
+ @sales_count = sales_count
263
+ end
264
+
265
+ # Checks equality by comparing each attribute.
266
+ # @param [Object] Object to be compared
267
+ def ==(o)
268
+ return true if self.equal?(o)
269
+ self.class == o.class &&
270
+ date_created == o.date_created &&
271
+ net_amount == o.net_amount &&
272
+ refund_amount == o.refund_amount &&
273
+ refund_count == o.refund_count &&
274
+ sales_amount == o.sales_amount &&
275
+ sales_count == o.sales_count
276
+ end
277
+
278
+ # @see the `==` method
279
+ # @param [Object] Object to be compared
280
+ def eql?(o)
281
+ self == o
282
+ end
283
+
284
+ # Calculates hash code according to all attributes.
285
+ # @return [Integer] Hash code
286
+ def hash
287
+ [date_created, net_amount, refund_amount, refund_count, sales_amount, sales_count].hash
288
+ end
289
+
290
+ # Builds the object from hash
291
+ # @param [Hash] attributes Model attributes in the form of hash
292
+ # @return [Object] Returns the model itself
293
+ def self.build_from_hash(attributes)
294
+ return nil unless attributes.is_a?(Hash)
295
+ attributes = attributes.transform_keys(&:to_sym)
296
+ transformed_hash = {}
297
+ openapi_types.each_pair do |key, type|
298
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
299
+ transformed_hash["#{key}"] = nil
300
+ elsif type =~ /\AArray<(.*)>/i
301
+ # check to ensure the input is an array given that the attribute
302
+ # is documented as an array but the input is not
303
+ if attributes[attribute_map[key]].is_a?(Array)
304
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
305
+ end
306
+ elsif !attributes[attribute_map[key]].nil?
307
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
308
+ end
309
+ end
310
+ new(transformed_hash)
311
+ end
312
+
313
+ # Deserializes the data based on type
314
+ # @param string type Data type
315
+ # @param string value Value to be deserialized
316
+ # @return [Object] Deserialized data
317
+ def self._deserialize(type, value)
318
+ case type.to_sym
319
+ when :Time
320
+ Time.parse(value)
321
+ when :Date
322
+ Date.parse(value)
323
+ when :String
324
+ value.to_s
325
+ when :Integer
326
+ value.to_i
327
+ when :Float
328
+ value.to_f
329
+ when :Boolean
330
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
331
+ true
332
+ else
333
+ false
334
+ end
335
+ when :Object
336
+ # generic object (usually a Hash), return directly
337
+ value
338
+ when /\AArray<(?<inner_type>.+)>\z/
339
+ inner_type = Regexp.last_match[:inner_type]
340
+ value.map { |v| _deserialize(inner_type, v) }
341
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
342
+ k_type = Regexp.last_match[:k_type]
343
+ v_type = Regexp.last_match[:v_type]
344
+ {}.tap do |hash|
345
+ value.each do |k, v|
346
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
347
+ end
348
+ end
349
+ else # model
350
+ # models (e.g. Pet) or oneOf
351
+ klass = CityPayApiClient.const_get(type)
352
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
353
+ end
354
+ end
355
+
356
+ # Returns the string representation of the object
357
+ # @return [String] String presentation of the object
358
+ def to_s
359
+ to_hash.to_s
360
+ end
361
+
362
+ # to_body is an alias to to_hash (backward compatibility)
363
+ # @return [Hash] Returns the object in the form of hash
364
+ def to_body
365
+ to_hash
366
+ end
367
+
368
+ # Returns the object in the form of hash
369
+ # @return [Hash] Returns the object in the form of hash
370
+ def to_hash
371
+ hash = {}
372
+ self.class.attribute_map.each_pair do |attr, param|
373
+ value = self.send(attr)
374
+ if value.nil?
375
+ is_nullable = self.class.openapi_nullable.include?(attr)
376
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
377
+ end
378
+
379
+ hash[param] = _to_hash(value)
380
+ end
381
+ hash
382
+ end
383
+
384
+ # Outputs non-array value in the form of hash
385
+ # For object, use to_hash. Otherwise, just return the value
386
+ # @param [Object] value Any valid value
387
+ # @return [Hash] Returns the value in the form of hash
388
+ def _to_hash(value)
389
+ if value.is_a?(Array)
390
+ value.compact.map { |v| _to_hash(v) }
391
+ elsif value.is_a?(Hash)
392
+ {}.tap do |hash|
393
+ value.each { |k, v| hash[k] = _to_hash(v) }
394
+ end
395
+ elsif value.respond_to? :to_hash
396
+ value.to_hash
397
+ else
398
+ value
399
+ end
400
+ end
401
+
402
+ end
403
+
404
+ end
@@ -0,0 +1,265 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # Welcome to the CityPay API, a robust HTTP API payment solution designed for seamless server-to-server transactional processing. Our API facilitates a wide array of payment operations, catering to diverse business needs. Whether you're integrating Internet payments, handling Mail Order/Telephone Order (MOTO) transactions, managing Subscriptions with Recurring and Continuous Authority payments, or navigating the complexities of 3-D Secure authentication, our API is equipped to support your requirements. Additionally, we offer functionalities for Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids, and Completion processing, alongside the capability for tokenised payments. ## Compliance and Security Overview <aside class=\"notice\"> Ensuring the security of payment transactions and compliance with industry standards is paramount. Our API is designed with stringent security measures and compliance protocols to safeguard sensitive information and meet the rigorous requirements of Visa, MasterCard, and the PCI Security Standards Council. </aside> ### Key Compliance and Security Measures * **TLS Encryption**: All data transmissions must utilise TLS version 1.2 or higher, employing [strong cryptography](#enabled-tls-ciphers). Our infrastructure strictly enforces this requirement to maintain the integrity and confidentiality of data in transit. We conduct regular scans and assessments of our TLS endpoints to identify and mitigate vulnerabilities. * **Data Storage Prohibitions**: Storing sensitive cardholder data (CHD), such as the card security code (CSC) or primary account number (PAN), is strictly prohibited. Our API is designed to minimize your exposure to sensitive data, thereby reducing your compliance burden. * **Data Masking**: For consumer protection and compliance, full card numbers must not be displayed on receipts or any customer-facing materials. Our API automatically masks PANs, displaying only the last four digits to facilitate safe receipt generation. * **Network Scans**: If your application is web-based, regular scans of your hosting environment are mandatory to identify and rectify potential vulnerabilities. This proactive measure is crucial for maintaining a secure and compliant online presence. * **PCI Compliance**: Adherence to PCI DSS standards is not optional; it's a requirement for operating securely and legally in the payments ecosystem. For detailed information on compliance requirements and resources, please visit the PCI Security Standards Council website [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/). * **Request Validation**: Our API includes mechanisms to verify the legitimacy of each request, ensuring it pertains to a valid account and originates from a trusted source. We leverage remote IP address verification alongside sophisticated application firewall technologies to thwart a wide array of common security threats. ## Getting Started Before integrating with the CityPay API, ensure your application and development practices align with the outlined compliance and security measures. This preparatory step is crucial for a smooth integration process and the long-term success of your payment processing operations. For further details on API endpoints, request/response formats, and code examples, proceed to the subsequent sections of our documentation. Our aim is to provide you with all the necessary tools and information to integrate our payment processing capabilities seamlessly into your application. Thank you for choosing CityPay API. We look forward to supporting your payment processing needs with our secure, compliant, and versatile API solution.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 7.2.0
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module CityPayApiClient
16
+ class RemittanceReportRequest
17
+ # Start date (YYYY-MM-DD) for batch Retrieval range, inclusive. Maximum value is 3 years ago.
18
+ attr_accessor :date_from
19
+
20
+ # End date (YYYY-MM-DD) for batch Retrieval range, inclusive.
21
+ attr_accessor :date_until
22
+
23
+ # The maximum number of results to return in a single response. This value is used to limit the size of data returned by the API, enhancing performance and manageability. Values should be between 5 and 250.
24
+ attr_accessor :max_results
25
+
26
+ attr_accessor :merchant_id
27
+
28
+ # A token that identifies the starting point of the page of results to be returned. An empty value indicates the start of the dataset. When supplied, it is validated and used to fetch the subsequent page of results. This token is typically obtained from the response of a previous pagination request.
29
+ attr_accessor :next_token
30
+
31
+ # Specifies the field by which results are ordered. Available fields are [trans_no,date_when,amount]. By default, fields are ordered by OrderByExpression(trans_no,ASC). To order in descending order, prefix with '-' or suffix with ' DESC'.
32
+ attr_accessor :order_by
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'date_from' => :'date_from',
38
+ :'date_until' => :'date_until',
39
+ :'max_results' => :'maxResults',
40
+ :'merchant_id' => :'merchant_id',
41
+ :'next_token' => :'nextToken',
42
+ :'order_by' => :'orderBy'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'date_from' => :'Date',
55
+ :'date_until' => :'Date',
56
+ :'max_results' => :'Integer',
57
+ :'merchant_id' => :'Array<Integer>',
58
+ :'next_token' => :'String',
59
+ :'order_by' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::RemittanceReportRequest` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::RemittanceReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'date_from')
85
+ self.date_from = attributes[:'date_from']
86
+ end
87
+
88
+ if attributes.key?(:'date_until')
89
+ self.date_until = attributes[:'date_until']
90
+ end
91
+
92
+ if attributes.key?(:'max_results')
93
+ self.max_results = attributes[:'max_results']
94
+ end
95
+
96
+ if attributes.key?(:'merchant_id')
97
+ if (value = attributes[:'merchant_id']).is_a?(Array)
98
+ self.merchant_id = value
99
+ end
100
+ end
101
+
102
+ if attributes.key?(:'next_token')
103
+ self.next_token = attributes[:'next_token']
104
+ end
105
+
106
+ if attributes.key?(:'order_by')
107
+ self.order_by = attributes[:'order_by']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ date_from == o.date_from &&
132
+ date_until == o.date_until &&
133
+ max_results == o.max_results &&
134
+ merchant_id == o.merchant_id &&
135
+ next_token == o.next_token &&
136
+ order_by == o.order_by
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [date_from, date_until, max_results, merchant_id, next_token, order_by].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def self._deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = CityPayApiClient.const_get(type)
213
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ end