citypay_api_client 1.0.3 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +111 -39
  3. data/citypay_api_client.gemspec +5 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +52 -49
  14. data/docs/AuthResponse.md +64 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +850 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +218 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +44 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +387 -111
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +38 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +389 -0
  37. data/docs/DirectPostRequest.md +60 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalFunctionsApi.md +375 -0
  50. data/docs/PaResAuthRequest.md +10 -9
  51. data/docs/PaylinkAddress.md +30 -0
  52. data/docs/PaylinkAdjustmentRequest.md +22 -0
  53. data/docs/PaylinkApi.md +806 -0
  54. data/docs/PaylinkAttachmentRequest.md +26 -0
  55. data/docs/PaylinkAttachmentResult.md +22 -0
  56. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  57. data/docs/PaylinkCardHolder.md +36 -0
  58. data/docs/PaylinkCart.md +30 -0
  59. data/docs/PaylinkCartItemModel.md +32 -0
  60. data/docs/PaylinkConfig.md +60 -0
  61. data/docs/PaylinkCustomParam.md +38 -0
  62. data/docs/PaylinkEmailNotificationPath.md +26 -0
  63. data/docs/PaylinkErrorCode.md +20 -0
  64. data/docs/PaylinkFieldGuardModel.md +30 -0
  65. data/docs/PaylinkPartPayments.md +28 -0
  66. data/docs/PaylinkSMSNotificationPath.md +20 -0
  67. data/docs/PaylinkStateEvent.md +22 -0
  68. data/docs/PaylinkTokenCreated.md +44 -0
  69. data/docs/PaylinkTokenRequestModel.md +42 -0
  70. data/docs/PaylinkTokenStatus.md +72 -0
  71. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  72. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  73. data/docs/PaylinkUI.md +24 -0
  74. data/docs/Ping.md +8 -7
  75. data/docs/ProcessBatchRequest.md +24 -0
  76. data/docs/ProcessBatchResponse.md +20 -0
  77. data/docs/RefundRequest.md +26 -0
  78. data/docs/RegisterCard.md +16 -13
  79. data/docs/RequestChallenged.md +16 -15
  80. data/docs/RetrieveRequest.md +12 -11
  81. data/docs/ThreeDSecure.md +32 -15
  82. data/docs/TokenisationResponseModel.md +36 -0
  83. data/docs/VoidRequest.md +12 -13
  84. data/docs/images/3dsv1-challenge.png +0 -0
  85. data/docs/images/3dsv2-challenge.png +0 -0
  86. data/docs/images/3dsv2-frictionless.png +0 -0
  87. data/docs/images/3dsv2-method-challenge.png +0 -0
  88. data/docs/images/3dsv2-method-frictionless.png +0 -0
  89. data/docs/images/3dsv2-no3d.png +0 -0
  90. data/docs/images/citypay-logo.svg +1 -0
  91. data/docs/images/direct-post-flow.png +0 -0
  92. data/docs/images/favicon.ico +0 -0
  93. data/docs/images/header.png +0 -0
  94. data/docs/images/logo.ai +1913 -4
  95. data/docs/images/logo.png +0 -0
  96. data/docs/images/logo.svg +1 -0
  97. data/docs/images/merchant-BPS-workflow.png +0 -0
  98. data/docs/images/paylink-field-guards.png +0 -0
  99. data/lib/.DS_Store +0 -0
  100. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  101. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  102. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  103. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  104. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  105. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  106. data/lib/citypay_api_client/api_client.rb +72 -70
  107. data/lib/citypay_api_client/api_error.rb +3 -2
  108. data/lib/citypay_api_client/configuration.rb +74 -17
  109. data/lib/citypay_api_client/models/account_create.rb +33 -23
  110. data/lib/citypay_api_client/models/account_status.rb +31 -23
  111. data/lib/citypay_api_client/models/acknowledgement.rb +43 -27
  112. data/lib/citypay_api_client/models/acl_check_request.rb +221 -0
  113. data/lib/citypay_api_client/models/acl_check_response_model.rb +244 -0
  114. data/lib/citypay_api_client/models/airline_advice.rb +63 -34
  115. data/lib/citypay_api_client/models/airline_segment.rb +51 -25
  116. data/lib/citypay_api_client/models/auth_reference.rb +80 -31
  117. data/lib/citypay_api_client/models/auth_references.rb +31 -23
  118. data/lib/citypay_api_client/models/auth_request.rb +137 -56
  119. data/lib/citypay_api_client/models/auth_response.rb +83 -123
  120. data/lib/citypay_api_client/models/authen_required.rb +31 -23
  121. data/lib/citypay_api_client/models/batch.rb +267 -0
  122. data/lib/citypay_api_client/models/batch_report_request.rb +278 -0
  123. data/lib/citypay_api_client/models/batch_report_response_model.rb +364 -0
  124. data/lib/citypay_api_client/models/batch_transaction.rb +324 -0
  125. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +452 -0
  126. data/lib/citypay_api_client/models/bin.rb +294 -0
  127. data/lib/citypay_api_client/models/bin_lookup.rb +231 -0
  128. data/lib/citypay_api_client/models/c_res_auth_request.rb +31 -23
  129. data/lib/citypay_api_client/models/capture_request.rb +59 -38
  130. data/lib/citypay_api_client/models/card.rb +93 -29
  131. data/lib/citypay_api_client/models/card_holder_account.rb +49 -27
  132. data/lib/citypay_api_client/models/card_status.rb +31 -23
  133. data/lib/citypay_api_client/models/charge_request.rb +154 -47
  134. data/lib/citypay_api_client/models/check_batch_status.rb +260 -0
  135. data/lib/citypay_api_client/models/check_batch_status_response.rb +215 -0
  136. data/lib/citypay_api_client/models/contact_details.rb +130 -52
  137. data/lib/citypay_api_client/models/decision.rb +31 -23
  138. data/lib/citypay_api_client/models/direct_post_request.rb +707 -0
  139. data/lib/citypay_api_client/models/direct_token_auth_request.rb +244 -0
  140. data/lib/citypay_api_client/models/domain_key_check_request.rb +249 -0
  141. data/lib/citypay_api_client/models/domain_key_request.rb +249 -0
  142. data/lib/citypay_api_client/models/domain_key_response.rb +297 -0
  143. data/lib/citypay_api_client/models/error.rb +57 -31
  144. data/lib/citypay_api_client/models/event_data_model.rb +254 -0
  145. data/lib/citypay_api_client/models/exists.rb +241 -0
  146. data/lib/citypay_api_client/models/external_mpi.rb +61 -27
  147. data/lib/citypay_api_client/models/list_merchants_response.rb +37 -25
  148. data/lib/citypay_api_client/models/mcc6012.rb +31 -23
  149. data/lib/citypay_api_client/models/merchant.rb +31 -23
  150. data/lib/citypay_api_client/models/pa_res_auth_request.rb +36 -24
  151. data/lib/citypay_api_client/models/paylink_address.rb +425 -0
  152. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +272 -0
  153. data/lib/citypay_api_client/models/paylink_attachment_request.rb +268 -0
  154. data/lib/citypay_api_client/models/paylink_attachment_result.rb +248 -0
  155. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +289 -0
  156. data/lib/citypay_api_client/models/paylink_card_holder.rb +360 -0
  157. data/lib/citypay_api_client/models/paylink_cart.rb +275 -0
  158. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +284 -0
  159. data/lib/citypay_api_client/models/paylink_config.rb +428 -0
  160. data/lib/citypay_api_client/models/paylink_custom_param.rb +321 -0
  161. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +265 -0
  162. data/lib/citypay_api_client/models/paylink_error_code.rb +238 -0
  163. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +274 -0
  164. data/lib/citypay_api_client/models/paylink_part_payments.rb +264 -0
  165. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +231 -0
  166. data/lib/citypay_api_client/models/paylink_state_event.rb +234 -0
  167. data/lib/citypay_api_client/models/paylink_token_created.rb +365 -0
  168. data/lib/citypay_api_client/models/paylink_token_request_model.rb +427 -0
  169. data/lib/citypay_api_client/models/paylink_token_status.rb +485 -0
  170. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +269 -0
  171. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +232 -0
  172. data/lib/citypay_api_client/models/paylink_ui.rb +244 -0
  173. data/lib/citypay_api_client/models/ping.rb +37 -25
  174. data/lib/citypay_api_client/models/process_batch_request.rb +313 -0
  175. data/lib/citypay_api_client/models/process_batch_response.rb +231 -0
  176. data/lib/citypay_api_client/models/refund_request.rb +339 -0
  177. data/lib/citypay_api_client/models/register_card.rb +79 -27
  178. data/lib/citypay_api_client/models/request_challenged.rb +39 -31
  179. data/lib/citypay_api_client/models/retrieve_request.rb +39 -25
  180. data/lib/citypay_api_client/models/three_d_secure.rb +116 -28
  181. data/lib/citypay_api_client/models/tokenisation_response_model.rb +332 -0
  182. data/lib/citypay_api_client/models/void_request.rb +39 -37
  183. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  184. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  185. data/lib/citypay_api_client/version.rb +3 -4
  186. data/lib/citypay_api_client.rb +53 -6
  187. data/spec/.DS_Store +0 -0
  188. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  189. data/spec/api/batch_processing_api___spec.rb +70 -0
  190. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  191. data/spec/api/direct_post_api___spec.rb +98 -0
  192. data/spec/api/operational_functions_api___spec.rb +94 -0
  193. data/spec/api/paylink_api___spec.rb +131 -0
  194. data/spec/api_client_spec.rb +4 -4
  195. data/spec/configuration_spec.rb +5 -5
  196. data/spec/it_api_sandbox_spec.rb +117 -55
  197. data/spec/models/account_create_spec.rb +1 -2
  198. data/spec/models/account_status_spec.rb +2 -2
  199. data/spec/models/acknowledgement_spec.rb +7 -22
  200. data/spec/models/acl_check_request_spec.rb +33 -0
  201. data/spec/models/acl_check_response_model_spec.rb +51 -0
  202. data/spec/models/airline_advice_spec.rb +0 -2
  203. data/spec/models/airline_segment_spec.rb +0 -2
  204. data/spec/models/auth_references_spec.rb +7 -8
  205. data/spec/models/auth_request_spec.rb +0 -2
  206. data/spec/models/auth_response_spec.rb +77 -33
  207. data/spec/models/batch_report_request_spec.rb +37 -0
  208. data/spec/models/batch_report_response_model_spec.rb +61 -0
  209. data/spec/models/batch_spec.rb +43 -0
  210. data/spec/models/batch_transaction_result_model_spec.rb +85 -0
  211. data/spec/models/batch_transaction_spec.rb +49 -0
  212. data/spec/models/bin_lookup_spec.rb +31 -0
  213. data/spec/models/bin_spec.rb +81 -0
  214. data/spec/models/capture_request_spec.rb +0 -2
  215. data/spec/models/card_holder_account_spec.rb +8 -7
  216. data/spec/models/charge_request_spec.rb +0 -2
  217. data/spec/models/check_batch_status_response_spec.rb +45 -0
  218. data/spec/models/check_batch_status_spec.rb +39 -0
  219. data/spec/models/decision_spec.rb +1 -1
  220. data/spec/models/direct_post_request_spec.rb +151 -0
  221. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  222. data/spec/models/domain_key_check_request_spec.rb +31 -0
  223. data/spec/models/domain_key_request_spec.rb +45 -0
  224. data/spec/models/domain_key_response_spec.rb +57 -0
  225. data/spec/models/event_data_model_spec.rb +57 -0
  226. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  227. data/spec/models/list_merchants_response_spec.rb +2 -2
  228. data/spec/models/paylink_address_spec.rb +69 -0
  229. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  230. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  231. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  232. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  233. data/spec/models/paylink_card_holder_spec.rb +87 -0
  234. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  235. data/spec/models/paylink_cart_spec.rb +69 -0
  236. data/spec/models/paylink_config_spec.rb +159 -0
  237. data/spec/models/paylink_custom_param_spec.rb +87 -0
  238. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  239. data/spec/models/paylink_error_code_spec.rb +39 -0
  240. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  241. data/spec/models/paylink_part_payments_spec.rb +63 -0
  242. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  243. data/spec/models/paylink_state_event_spec.rb +45 -0
  244. data/spec/models/paylink_token_created_spec.rb +111 -0
  245. data/spec/models/paylink_token_request_model_spec.rb +91 -0
  246. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  247. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  248. data/spec/models/paylink_token_status_spec.rb +195 -0
  249. data/spec/models/paylink_ui_spec.rb +51 -0
  250. data/spec/models/process_batch_request_spec.rb +49 -0
  251. data/spec/models/process_batch_response_spec.rb +39 -0
  252. data/spec/models/refund_request_spec.rb +62 -0
  253. data/spec/models/register_card_spec.rb +0 -2
  254. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  255. data/spec/spec_helper.rb +2 -2
  256. data/spec/utils/direct_post_mac_spec.rb +13 -0
  257. metadata +230 -44
  258. data/Gemfile.lock +0 -70
  259. data/docs/OperationalApi.md +0 -112
  260. data/docs/PaymentProcessingApi.md +0 -320
  261. data/git_push.sh +0 -58
  262. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  263. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  264. data/lib/citypay_api_client/test.rb +0 -20
  265. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,485 @@
1
+ =begin
2
+ #CityPay Payment API
3
+
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
+
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 PaylinkTokenStatus
17
+ # the amount that has been paid against the session.
18
+ attr_accessor :amount_paid
19
+
20
+ # an authorisation code if the transaction was processed and isPaid is true.
21
+ attr_accessor :auth_code
22
+
23
+ # a description of the card that was used for payment if paid.
24
+ attr_accessor :card
25
+
26
+ # the date and time that the session was created.
27
+ attr_accessor :created
28
+
29
+ # the date and time of the current status.
30
+ attr_accessor :datetime
31
+
32
+ # the merchant identifier, to help identifying the token.
33
+ attr_accessor :identifier
34
+
35
+ # true if an attachment exists.
36
+ attr_accessor :is_attachment
37
+
38
+ # true if the session was cancelled either by the user or by a system request.
39
+ attr_accessor :is_cancelled
40
+
41
+ # true if the token has been closed.
42
+ attr_accessor :is_closed
43
+
44
+ # true if a customer receipt has been sent.
45
+ attr_accessor :is_customer_receipt_email_sent
46
+
47
+ # true if an email was sent.
48
+ attr_accessor :is_email_sent
49
+
50
+ # true if the session has expired.
51
+ attr_accessor :is_expired
52
+
53
+ # true if the form was ever displayed to the addressee.
54
+ attr_accessor :is_form_viewed
55
+
56
+ # true if a merchant notification receipt was sent.
57
+ attr_accessor :is_merchant_notification_email_sent
58
+
59
+ # true if the session is still open for payment or false if it has been closed.
60
+ attr_accessor :is_open_for_payment
61
+
62
+ # whether the session has been paid and therefore can be considered as complete.
63
+ attr_accessor :is_paid
64
+
65
+ # true if payment has been attempted.
66
+ attr_accessor :is_payment_attempted
67
+
68
+ # true if a post back was executed successfully.
69
+ attr_accessor :is_postback_ok
70
+
71
+ # true if the request has been challenged using 3-D Secure.
72
+ attr_accessor :is_request_challenged
73
+
74
+ # true if an SMS was sent.
75
+ attr_accessor :is_sms_sent
76
+
77
+ # whether the token generation was successfully validated.
78
+ attr_accessor :is_validated
79
+
80
+ # the date and time that the session last had an event actioned against it.
81
+ attr_accessor :last_event_date_time
82
+
83
+ # the result of the last payment if one exists.
84
+ attr_accessor :last_payment_result
85
+
86
+ # identifies the merchant account.
87
+ attr_accessor :mid
88
+
89
+ # the number of attempts made to pay.
90
+ attr_accessor :payment_attempts_count
91
+
92
+ attr_accessor :state_history
93
+
94
+ # the token value which uniquely identifies the session.
95
+ attr_accessor :token
96
+
97
+ # a transaction number if the transacstion was processed and isPaid is true.
98
+ attr_accessor :trans_no
99
+
100
+ # Attribute mapping from ruby-style variable name to JSON key.
101
+ def self.attribute_map
102
+ {
103
+ :'amount_paid' => :'amount_paid',
104
+ :'auth_code' => :'auth_code',
105
+ :'card' => :'card',
106
+ :'created' => :'created',
107
+ :'datetime' => :'datetime',
108
+ :'identifier' => :'identifier',
109
+ :'is_attachment' => :'is_attachment',
110
+ :'is_cancelled' => :'is_cancelled',
111
+ :'is_closed' => :'is_closed',
112
+ :'is_customer_receipt_email_sent' => :'is_customer_receipt_email_sent',
113
+ :'is_email_sent' => :'is_email_sent',
114
+ :'is_expired' => :'is_expired',
115
+ :'is_form_viewed' => :'is_form_viewed',
116
+ :'is_merchant_notification_email_sent' => :'is_merchant_notification_email_sent',
117
+ :'is_open_for_payment' => :'is_open_for_payment',
118
+ :'is_paid' => :'is_paid',
119
+ :'is_payment_attempted' => :'is_payment_attempted',
120
+ :'is_postback_ok' => :'is_postback_ok',
121
+ :'is_request_challenged' => :'is_request_challenged',
122
+ :'is_sms_sent' => :'is_sms_sent',
123
+ :'is_validated' => :'is_validated',
124
+ :'last_event_date_time' => :'last_event_date_time',
125
+ :'last_payment_result' => :'last_payment_result',
126
+ :'mid' => :'mid',
127
+ :'payment_attempts_count' => :'payment_attempts_count',
128
+ :'state_history' => :'state_history',
129
+ :'token' => :'token',
130
+ :'trans_no' => :'trans_no'
131
+ }
132
+ end
133
+
134
+ # Returns all the JSON keys this model knows about
135
+ def self.acceptable_attributes
136
+ attribute_map.values
137
+ end
138
+
139
+ # Attribute type mapping.
140
+ def self.openapi_types
141
+ {
142
+ :'amount_paid' => :'Integer',
143
+ :'auth_code' => :'String',
144
+ :'card' => :'String',
145
+ :'created' => :'Time',
146
+ :'datetime' => :'Time',
147
+ :'identifier' => :'String',
148
+ :'is_attachment' => :'Boolean',
149
+ :'is_cancelled' => :'Boolean',
150
+ :'is_closed' => :'Boolean',
151
+ :'is_customer_receipt_email_sent' => :'Boolean',
152
+ :'is_email_sent' => :'Boolean',
153
+ :'is_expired' => :'Boolean',
154
+ :'is_form_viewed' => :'Boolean',
155
+ :'is_merchant_notification_email_sent' => :'Boolean',
156
+ :'is_open_for_payment' => :'Boolean',
157
+ :'is_paid' => :'Boolean',
158
+ :'is_payment_attempted' => :'Boolean',
159
+ :'is_postback_ok' => :'Boolean',
160
+ :'is_request_challenged' => :'Boolean',
161
+ :'is_sms_sent' => :'Boolean',
162
+ :'is_validated' => :'Boolean',
163
+ :'last_event_date_time' => :'Time',
164
+ :'last_payment_result' => :'String',
165
+ :'mid' => :'String',
166
+ :'payment_attempts_count' => :'Integer',
167
+ :'state_history' => :'Array<PaylinkStateEvent>',
168
+ :'token' => :'String',
169
+ :'trans_no' => :'Integer'
170
+ }
171
+ end
172
+
173
+ # List of attributes with nullable: true
174
+ def self.openapi_nullable
175
+ Set.new([
176
+ ])
177
+ end
178
+
179
+ # Initializes the object
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ def initialize(attributes = {})
182
+ if (!attributes.is_a?(Hash))
183
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::PaylinkTokenStatus` initialize method"
184
+ end
185
+
186
+ # check to see if the attribute exists and convert string to symbol for hash key
187
+ attributes = attributes.each_with_object({}) { |(k, v), h|
188
+ if (!self.class.attribute_map.key?(k.to_sym))
189
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::PaylinkTokenStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
190
+ end
191
+ h[k.to_sym] = v
192
+ }
193
+
194
+ if attributes.key?(:'amount_paid')
195
+ self.amount_paid = attributes[:'amount_paid']
196
+ end
197
+
198
+ if attributes.key?(:'auth_code')
199
+ self.auth_code = attributes[:'auth_code']
200
+ end
201
+
202
+ if attributes.key?(:'card')
203
+ self.card = attributes[:'card']
204
+ end
205
+
206
+ if attributes.key?(:'created')
207
+ self.created = attributes[:'created']
208
+ end
209
+
210
+ if attributes.key?(:'datetime')
211
+ self.datetime = attributes[:'datetime']
212
+ end
213
+
214
+ if attributes.key?(:'identifier')
215
+ self.identifier = attributes[:'identifier']
216
+ end
217
+
218
+ if attributes.key?(:'is_attachment')
219
+ self.is_attachment = attributes[:'is_attachment']
220
+ end
221
+
222
+ if attributes.key?(:'is_cancelled')
223
+ self.is_cancelled = attributes[:'is_cancelled']
224
+ end
225
+
226
+ if attributes.key?(:'is_closed')
227
+ self.is_closed = attributes[:'is_closed']
228
+ end
229
+
230
+ if attributes.key?(:'is_customer_receipt_email_sent')
231
+ self.is_customer_receipt_email_sent = attributes[:'is_customer_receipt_email_sent']
232
+ end
233
+
234
+ if attributes.key?(:'is_email_sent')
235
+ self.is_email_sent = attributes[:'is_email_sent']
236
+ end
237
+
238
+ if attributes.key?(:'is_expired')
239
+ self.is_expired = attributes[:'is_expired']
240
+ end
241
+
242
+ if attributes.key?(:'is_form_viewed')
243
+ self.is_form_viewed = attributes[:'is_form_viewed']
244
+ end
245
+
246
+ if attributes.key?(:'is_merchant_notification_email_sent')
247
+ self.is_merchant_notification_email_sent = attributes[:'is_merchant_notification_email_sent']
248
+ end
249
+
250
+ if attributes.key?(:'is_open_for_payment')
251
+ self.is_open_for_payment = attributes[:'is_open_for_payment']
252
+ end
253
+
254
+ if attributes.key?(:'is_paid')
255
+ self.is_paid = attributes[:'is_paid']
256
+ end
257
+
258
+ if attributes.key?(:'is_payment_attempted')
259
+ self.is_payment_attempted = attributes[:'is_payment_attempted']
260
+ end
261
+
262
+ if attributes.key?(:'is_postback_ok')
263
+ self.is_postback_ok = attributes[:'is_postback_ok']
264
+ end
265
+
266
+ if attributes.key?(:'is_request_challenged')
267
+ self.is_request_challenged = attributes[:'is_request_challenged']
268
+ end
269
+
270
+ if attributes.key?(:'is_sms_sent')
271
+ self.is_sms_sent = attributes[:'is_sms_sent']
272
+ end
273
+
274
+ if attributes.key?(:'is_validated')
275
+ self.is_validated = attributes[:'is_validated']
276
+ end
277
+
278
+ if attributes.key?(:'last_event_date_time')
279
+ self.last_event_date_time = attributes[:'last_event_date_time']
280
+ end
281
+
282
+ if attributes.key?(:'last_payment_result')
283
+ self.last_payment_result = attributes[:'last_payment_result']
284
+ end
285
+
286
+ if attributes.key?(:'mid')
287
+ self.mid = attributes[:'mid']
288
+ end
289
+
290
+ if attributes.key?(:'payment_attempts_count')
291
+ self.payment_attempts_count = attributes[:'payment_attempts_count']
292
+ end
293
+
294
+ if attributes.key?(:'state_history')
295
+ if (value = attributes[:'state_history']).is_a?(Array)
296
+ self.state_history = value
297
+ end
298
+ end
299
+
300
+ if attributes.key?(:'token')
301
+ self.token = attributes[:'token']
302
+ end
303
+
304
+ if attributes.key?(:'trans_no')
305
+ self.trans_no = attributes[:'trans_no']
306
+ end
307
+ end
308
+
309
+ # Show invalid properties with the reasons. Usually used together with valid?
310
+ # @return Array for valid properties with the reasons
311
+ def list_invalid_properties
312
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
313
+ invalid_properties = Array.new
314
+ invalid_properties
315
+ end
316
+
317
+ # Check to see if the all the properties in the model are valid
318
+ # @return true if the model is valid
319
+ def valid?
320
+ warn '[DEPRECATED] the `valid?` method is obsolete'
321
+ true
322
+ end
323
+
324
+ # Checks equality by comparing each attribute.
325
+ # @param [Object] Object to be compared
326
+ def ==(o)
327
+ return true if self.equal?(o)
328
+ self.class == o.class &&
329
+ amount_paid == o.amount_paid &&
330
+ auth_code == o.auth_code &&
331
+ card == o.card &&
332
+ created == o.created &&
333
+ datetime == o.datetime &&
334
+ identifier == o.identifier &&
335
+ is_attachment == o.is_attachment &&
336
+ is_cancelled == o.is_cancelled &&
337
+ is_closed == o.is_closed &&
338
+ is_customer_receipt_email_sent == o.is_customer_receipt_email_sent &&
339
+ is_email_sent == o.is_email_sent &&
340
+ is_expired == o.is_expired &&
341
+ is_form_viewed == o.is_form_viewed &&
342
+ is_merchant_notification_email_sent == o.is_merchant_notification_email_sent &&
343
+ is_open_for_payment == o.is_open_for_payment &&
344
+ is_paid == o.is_paid &&
345
+ is_payment_attempted == o.is_payment_attempted &&
346
+ is_postback_ok == o.is_postback_ok &&
347
+ is_request_challenged == o.is_request_challenged &&
348
+ is_sms_sent == o.is_sms_sent &&
349
+ is_validated == o.is_validated &&
350
+ last_event_date_time == o.last_event_date_time &&
351
+ last_payment_result == o.last_payment_result &&
352
+ mid == o.mid &&
353
+ payment_attempts_count == o.payment_attempts_count &&
354
+ state_history == o.state_history &&
355
+ token == o.token &&
356
+ trans_no == o.trans_no
357
+ end
358
+
359
+ # @see the `==` method
360
+ # @param [Object] Object to be compared
361
+ def eql?(o)
362
+ self == o
363
+ end
364
+
365
+ # Calculates hash code according to all attributes.
366
+ # @return [Integer] Hash code
367
+ def hash
368
+ [amount_paid, auth_code, card, created, datetime, identifier, is_attachment, is_cancelled, is_closed, is_customer_receipt_email_sent, is_email_sent, is_expired, is_form_viewed, is_merchant_notification_email_sent, is_open_for_payment, is_paid, is_payment_attempted, is_postback_ok, is_request_challenged, is_sms_sent, is_validated, last_event_date_time, last_payment_result, mid, payment_attempts_count, state_history, token, trans_no].hash
369
+ end
370
+
371
+ # Builds the object from hash
372
+ # @param [Hash] attributes Model attributes in the form of hash
373
+ # @return [Object] Returns the model itself
374
+ def self.build_from_hash(attributes)
375
+ return nil unless attributes.is_a?(Hash)
376
+ attributes = attributes.transform_keys(&:to_sym)
377
+ transformed_hash = {}
378
+ openapi_types.each_pair do |key, type|
379
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
380
+ transformed_hash["#{key}"] = nil
381
+ elsif type =~ /\AArray<(.*)>/i
382
+ # check to ensure the input is an array given that the attribute
383
+ # is documented as an array but the input is not
384
+ if attributes[attribute_map[key]].is_a?(Array)
385
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
386
+ end
387
+ elsif !attributes[attribute_map[key]].nil?
388
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
389
+ end
390
+ end
391
+ new(transformed_hash)
392
+ end
393
+
394
+ # Deserializes the data based on type
395
+ # @param string type Data type
396
+ # @param string value Value to be deserialized
397
+ # @return [Object] Deserialized data
398
+ def self._deserialize(type, value)
399
+ case type.to_sym
400
+ when :Time
401
+ Time.parse(value)
402
+ when :Date
403
+ Date.parse(value)
404
+ when :String
405
+ value.to_s
406
+ when :Integer
407
+ value.to_i
408
+ when :Float
409
+ value.to_f
410
+ when :Boolean
411
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
412
+ true
413
+ else
414
+ false
415
+ end
416
+ when :Object
417
+ # generic object (usually a Hash), return directly
418
+ value
419
+ when /\AArray<(?<inner_type>.+)>\z/
420
+ inner_type = Regexp.last_match[:inner_type]
421
+ value.map { |v| _deserialize(inner_type, v) }
422
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
423
+ k_type = Regexp.last_match[:k_type]
424
+ v_type = Regexp.last_match[:v_type]
425
+ {}.tap do |hash|
426
+ value.each do |k, v|
427
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
428
+ end
429
+ end
430
+ else # model
431
+ # models (e.g. Pet) or oneOf
432
+ klass = CityPayApiClient.const_get(type)
433
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
434
+ end
435
+ end
436
+
437
+ # Returns the string representation of the object
438
+ # @return [String] String presentation of the object
439
+ def to_s
440
+ to_hash.to_s
441
+ end
442
+
443
+ # to_body is an alias to to_hash (backward compatibility)
444
+ # @return [Hash] Returns the object in the form of hash
445
+ def to_body
446
+ to_hash
447
+ end
448
+
449
+ # Returns the object in the form of hash
450
+ # @return [Hash] Returns the object in the form of hash
451
+ def to_hash
452
+ hash = {}
453
+ self.class.attribute_map.each_pair do |attr, param|
454
+ value = self.send(attr)
455
+ if value.nil?
456
+ is_nullable = self.class.openapi_nullable.include?(attr)
457
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
458
+ end
459
+
460
+ hash[param] = _to_hash(value)
461
+ end
462
+ hash
463
+ end
464
+
465
+ # Outputs non-array value in the form of hash
466
+ # For object, use to_hash. Otherwise, just return the value
467
+ # @param [Object] value Any valid value
468
+ # @return [Hash] Returns the value in the form of hash
469
+ def _to_hash(value)
470
+ if value.is_a?(Array)
471
+ value.compact.map { |v| _to_hash(v) }
472
+ elsif value.is_a?(Hash)
473
+ {}.tap do |hash|
474
+ value.each { |k, v| hash[k] = _to_hash(v) }
475
+ end
476
+ elsif value.respond_to? :to_hash
477
+ value.to_hash
478
+ else
479
+ value
480
+ end
481
+ end
482
+
483
+ end
484
+
485
+ end