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.
- checksums.yaml +4 -4
- data/README.md +105 -34
- data/citypay_api_client.gemspec +4 -5
- data/docs/AccountCreate.md +10 -9
- data/docs/AccountStatus.md +8 -7
- data/docs/Acknowledgement.md +14 -13
- data/docs/AclCheckRequest.md +18 -0
- data/docs/AclCheckResponseModel.md +24 -0
- data/docs/AirlineAdvice.md +38 -37
- data/docs/AirlineSegment.md +22 -21
- data/docs/AuthReference.md +34 -33
- data/docs/AuthReferences.md +8 -7
- data/docs/AuthRequest.md +50 -49
- data/docs/AuthResponse.md +60 -59
- data/docs/AuthenRequired.md +12 -11
- data/docs/AuthorisationAndPaymentApi.md +559 -0
- data/docs/Batch.md +22 -0
- data/docs/BatchProcessingApi.md +214 -0
- data/docs/BatchReportRequest.md +20 -0
- data/docs/BatchReportResponseModel.md +28 -0
- data/docs/BatchTransaction.md +24 -0
- data/docs/BatchTransactionResultModel.md +40 -0
- data/docs/Bin.md +34 -0
- data/docs/BinLookup.md +18 -0
- data/docs/CResAuthRequest.md +8 -7
- data/docs/CaptureRequest.md +18 -17
- data/docs/Card.md +46 -41
- data/docs/CardHolderAccount.md +24 -21
- data/docs/CardHolderAccountApi.md +326 -105
- data/docs/CardStatus.md +10 -9
- data/docs/ChargeRequest.md +36 -31
- data/docs/CheckBatchStatus.md +20 -0
- data/docs/CheckBatchStatusResponse.md +18 -0
- data/docs/ContactDetails.md +32 -31
- data/docs/Decision.md +12 -11
- data/docs/DirectPostApi.md +365 -0
- data/docs/DirectPostRequest.md +58 -0
- data/docs/DirectTokenAuthRequest.md +24 -0
- data/docs/DomainKeyCheckRequest.md +18 -0
- data/docs/DomainKeyRequest.md +22 -0
- data/docs/DomainKeyResponse.md +26 -0
- data/docs/Error.md +16 -13
- data/docs/EventDataModel.md +26 -0
- data/docs/Exists.md +22 -0
- data/docs/ExternalMPI.md +16 -15
- data/docs/ListMerchantsResponse.md +12 -11
- data/docs/MCC6012.md +14 -13
- data/docs/Merchant.md +16 -15
- data/docs/OperationalApi.md +124 -22
- data/docs/OperationalFunctionsApi.md +355 -0
- data/docs/PaResAuthRequest.md +10 -9
- data/docs/PaylinkAddress.md +30 -0
- data/docs/PaylinkAdjustmentRequest.md +22 -0
- data/docs/PaylinkApi.md +630 -0
- data/docs/PaylinkAttachmentRequest.md +26 -0
- data/docs/PaylinkAttachmentResult.md +22 -0
- data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
- data/docs/PaylinkCardHolder.md +36 -0
- data/docs/PaylinkCart.md +30 -0
- data/docs/PaylinkCartItemModel.md +32 -0
- data/docs/PaylinkConfig.md +60 -0
- data/docs/PaylinkCustomParam.md +36 -0
- data/docs/PaylinkEmailNotificationPath.md +26 -0
- data/docs/PaylinkErrorCode.md +20 -0
- data/docs/PaylinkFieldGuardModel.md +30 -0
- data/docs/PaylinkPartPayments.md +28 -0
- data/docs/PaylinkSMSNotificationPath.md +20 -0
- data/docs/PaylinkStateEvent.md +22 -0
- data/docs/PaylinkTokenCreated.md +44 -0
- data/docs/PaylinkTokenRequestModel.md +38 -0
- data/docs/PaylinkTokenStatus.md +72 -0
- data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
- data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
- data/docs/PaylinkUI.md +24 -0
- data/docs/PaymentProcessingApi.md +307 -68
- data/docs/Ping.md +8 -7
- data/docs/ProcessBatchRequest.md +24 -0
- data/docs/ProcessBatchResponse.md +20 -0
- data/docs/RefundRequest.md +26 -0
- data/docs/RegisterCard.md +16 -13
- data/docs/RequestChallenged.md +16 -15
- data/docs/RetrieveRequest.md +12 -11
- data/docs/ThreeDSecure.md +32 -15
- data/docs/TokenisationResponseModel.md +36 -0
- data/docs/VoidRequest.md +12 -13
- data/lib/.DS_Store +0 -0
- data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
- data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
- data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
- data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
- data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
- data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
- data/lib/citypay_api_client/api_client.rb +59 -59
- data/lib/citypay_api_client/api_error.rb +2 -2
- data/lib/citypay_api_client/configuration.rb +53 -15
- data/lib/citypay_api_client/models/account_create.rb +21 -8
- data/lib/citypay_api_client/models/account_status.rb +21 -8
- data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
- data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
- data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
- data/lib/citypay_api_client/models/airline_advice.rb +23 -10
- data/lib/citypay_api_client/models/airline_segment.rb +21 -8
- data/lib/citypay_api_client/models/api_key.rb +16 -0
- data/lib/citypay_api_client/models/auth_reference.rb +45 -11
- data/lib/citypay_api_client/models/auth_references.rb +21 -8
- data/lib/citypay_api_client/models/auth_request.rb +79 -33
- data/lib/citypay_api_client/models/auth_response.rb +43 -106
- data/lib/citypay_api_client/models/authen_required.rb +21 -8
- data/lib/citypay_api_client/models/batch.rb +264 -0
- data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
- data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
- data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
- data/lib/citypay_api_client/models/bin.rb +299 -0
- data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
- data/lib/citypay_api_client/models/capture_request.rb +38 -20
- data/lib/citypay_api_client/models/card.rb +67 -10
- data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
- data/lib/citypay_api_client/models/card_status.rb +21 -8
- data/lib/citypay_api_client/models/charge_request.rb +96 -24
- data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
- data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
- data/lib/citypay_api_client/models/contact_details.rb +87 -44
- data/lib/citypay_api_client/models/decision.rb +21 -8
- data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
- data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
- data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
- data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
- data/lib/citypay_api_client/models/error.rb +35 -12
- data/lib/citypay_api_client/models/event_data_model.rb +259 -0
- data/lib/citypay_api_client/models/exists.rb +244 -0
- data/lib/citypay_api_client/models/external_mpi.rb +27 -8
- data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
- data/lib/citypay_api_client/models/mcc6012.rb +21 -8
- data/lib/citypay_api_client/models/merchant.rb +21 -8
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
- data/lib/citypay_api_client/models/paylink_address.rb +402 -0
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
- data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
- data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
- data/lib/citypay_api_client/models/paylink_config.rb +433 -0
- data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
- data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
- data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
- data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
- data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
- data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
- data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
- data/lib/citypay_api_client/models/ping.rb +21 -8
- data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
- data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
- data/lib/citypay_api_client/models/refund_request.rb +332 -0
- data/lib/citypay_api_client/models/register_card.rb +59 -12
- data/lib/citypay_api_client/models/request_challenged.rb +29 -16
- data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
- data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
- data/lib/citypay_api_client/models/void_request.rb +22 -19
- data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
- data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
- data/lib/citypay_api_client/version.rb +3 -3
- data/lib/citypay_api_client.rb +53 -6
- data/spec/.DS_Store +0 -0
- data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
- data/spec/api/batch_processing_api___spec.rb +70 -0
- data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
- data/spec/api/direct_post_api___spec.rb +98 -0
- data/spec/api/operational_functions_api___spec.rb +94 -0
- data/spec/api/paylink_api___spec.rb +131 -0
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +5 -5
- data/spec/it_api_sandbox_spec.rb +222 -0
- data/spec/models/acknowledgement_spec.rb +6 -8
- data/spec/models/acl_check_request_spec.rb +33 -0
- data/spec/models/acl_check_response_model_spec.rb +51 -0
- data/spec/models/auth_references_spec.rb +7 -8
- data/spec/models/auth_response_spec.rb +29 -30
- data/spec/models/batch_report_request_spec.rb +39 -0
- data/spec/models/batch_report_response_model_spec.rb +63 -0
- data/spec/models/batch_spec.rb +45 -0
- data/spec/models/batch_transaction_result_model_spec.rb +87 -0
- data/spec/models/batch_transaction_spec.rb +51 -0
- data/spec/models/bin_lookup_spec.rb +33 -0
- data/spec/models/bin_spec.rb +81 -0
- data/spec/models/card_holder_account_spec.rb +8 -5
- data/spec/models/check_batch_status_response_spec.rb +45 -0
- data/spec/models/check_batch_status_spec.rb +39 -0
- data/spec/models/decision_spec.rb +1 -1
- data/spec/models/direct_post_request_spec.rb +153 -0
- data/spec/models/direct_token_auth_request_spec.rb +51 -0
- data/spec/models/domain_key_check_request_spec.rb +33 -0
- data/spec/models/domain_key_request_spec.rb +45 -0
- data/spec/models/domain_key_response_spec.rb +57 -0
- data/spec/models/event_data_model_spec.rb +57 -0
- data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
- data/spec/models/list_merchants_response_spec.rb +2 -2
- data/spec/models/paylink_address_spec.rb +69 -0
- data/spec/models/paylink_adjustment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_result_spec.rb +45 -0
- data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
- data/spec/models/paylink_card_holder_spec.rb +87 -0
- data/spec/models/paylink_cart_item_model_spec.rb +75 -0
- data/spec/models/paylink_cart_spec.rb +69 -0
- data/spec/models/paylink_config_spec.rb +159 -0
- data/spec/models/paylink_custom_param_spec.rb +87 -0
- data/spec/models/paylink_email_notification_path_spec.rb +57 -0
- data/spec/models/paylink_error_code_spec.rb +39 -0
- data/spec/models/paylink_field_guard_model_spec.rb +45 -0
- data/spec/models/paylink_part_payments_spec.rb +63 -0
- data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
- data/spec/models/paylink_state_event_spec.rb +45 -0
- data/spec/models/paylink_token_created_spec.rb +111 -0
- data/spec/models/paylink_token_request_model_spec.rb +93 -0
- data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
- data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
- data/spec/models/paylink_token_status_spec.rb +195 -0
- data/spec/models/paylink_ui_spec.rb +51 -0
- data/spec/models/process_batch_request_spec.rb +51 -0
- data/spec/models/process_batch_response_spec.rb +39 -0
- data/spec/models/refund_request_spec.rb +64 -0
- data/spec/models/tokenisation_response_model_spec.rb +87 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/utils/direct_post_mac_spec.rb +13 -0
- metadata +212 -37
- data/Gemfile.lock +0 -70
- data/git_push.sh +0 -58
- data/lib/citypay_api_client/api/operational_api.rb +0 -147
- data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
- data/lib/citypay_api_client/test.rb +0 -20
- data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -0,0 +1,433 @@
|
|
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 PaylinkConfig
|
17
|
+
# Specifies the approach to be adopted by the Paylink form when displaying a 3-D Secure challenge window. The values may be iframe: shows the 3-D Secure ACS in an iframe dialog, neatly embedding it in Paylink. This provides a more seamless flow for the cardholder who is able to validate and authenticate their card using a dialog provided by their card issuer. inline: an inline mode transfers the full browser window to the authentication server, allowing the payment cardholder to see their payment card issuer's URL and the certificate status in the browser. If you request an iframe mode and the browser width is deemed as being small (< 768px) then an inline mode will be enforced. This is to ensure that mobile users have an improved user experience.
|
18
|
+
attr_accessor :acs_mode
|
19
|
+
|
20
|
+
attr_accessor :custom_params
|
21
|
+
|
22
|
+
# Directly specify the merchant descriptor used for the transaction to be displayed on the payment page.
|
23
|
+
attr_accessor :descriptor
|
24
|
+
|
25
|
+
# Specifies a period of time in seconds after which the token cannot be used. A value of 0 defines that the token will never expire. The API will convert an expiry time based on a string value. For instance: s - Time in seconds, for example 90s. m - Time in minutes, for example 20m. h - Time in hours, for example 4h. w - Time in weeks, for example 4w. M - Time in months, for example 6M. y - Time in years, for example 1y. Defaults to 30 minutes.
|
26
|
+
attr_accessor :expire_in
|
27
|
+
|
28
|
+
attr_accessor :field_guard
|
29
|
+
|
30
|
+
attr_accessor :lock_params
|
31
|
+
|
32
|
+
# A URL of a logo to include in the form. The URL should be delivered using HTTPS.
|
33
|
+
attr_accessor :merch_logo
|
34
|
+
|
35
|
+
# A URL of the merchant terms and conditions for payment. If a value is supplied, a checkbox will be required to be completed to confirm that the cardholder agrees to these conditions before payment. A modal dialogue is displayed with the content of the conditions displayed.
|
36
|
+
attr_accessor :merch_terms
|
37
|
+
|
38
|
+
attr_accessor :options
|
39
|
+
|
40
|
+
attr_accessor :part_payments
|
41
|
+
|
42
|
+
attr_accessor :pass_through_data
|
43
|
+
|
44
|
+
attr_accessor :pass_through_headers
|
45
|
+
|
46
|
+
# Specifies a URL to use for a call back when the payment is completed. see Postback Handling }.
|
47
|
+
attr_accessor :postback
|
48
|
+
|
49
|
+
# A password to be added to the postback for HTTP Basic Authentication.
|
50
|
+
attr_accessor :postback_password
|
51
|
+
|
52
|
+
# The policy setting for the postback see Postback Handling.
|
53
|
+
attr_accessor :postback_policy
|
54
|
+
|
55
|
+
# A username to be added to the postback for HTTP Basic Authentication.
|
56
|
+
attr_accessor :postback_username
|
57
|
+
|
58
|
+
# A value which can delay the redirection in seconds. A value of 0 will redirect immediately.
|
59
|
+
attr_accessor :redirect_delay
|
60
|
+
|
61
|
+
# A URL which the browser is redirected to on non-completion of a transaction.
|
62
|
+
attr_accessor :redirect_failure
|
63
|
+
|
64
|
+
# A URL which the browser is redirected to on authorisation of a transaction.
|
65
|
+
attr_accessor :redirect_success
|
66
|
+
|
67
|
+
# The Paylink renderer engine to use.
|
68
|
+
attr_accessor :renderer
|
69
|
+
|
70
|
+
# If a value of true is specified, any redirection will include the transaction result in parameters. It is recommended to use the postback integration rather than redirection parameters.
|
71
|
+
attr_accessor :return_params
|
72
|
+
|
73
|
+
attr_accessor :ui
|
74
|
+
|
75
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
76
|
+
def self.attribute_map
|
77
|
+
{
|
78
|
+
:'acs_mode' => :'acs_mode',
|
79
|
+
:'custom_params' => :'custom_params',
|
80
|
+
:'descriptor' => :'descriptor',
|
81
|
+
:'expire_in' => :'expire_in',
|
82
|
+
:'field_guard' => :'field_guard',
|
83
|
+
:'lock_params' => :'lock_params',
|
84
|
+
:'merch_logo' => :'merch_logo',
|
85
|
+
:'merch_terms' => :'merch_terms',
|
86
|
+
:'options' => :'options',
|
87
|
+
:'part_payments' => :'part_payments',
|
88
|
+
:'pass_through_data' => :'pass_through_data',
|
89
|
+
:'pass_through_headers' => :'pass_through_headers',
|
90
|
+
:'postback' => :'postback',
|
91
|
+
:'postback_password' => :'postback_password',
|
92
|
+
:'postback_policy' => :'postback_policy',
|
93
|
+
:'postback_username' => :'postback_username',
|
94
|
+
:'redirect_delay' => :'redirect_delay',
|
95
|
+
:'redirect_failure' => :'redirect_failure',
|
96
|
+
:'redirect_success' => :'redirect_success',
|
97
|
+
:'renderer' => :'renderer',
|
98
|
+
:'return_params' => :'return_params',
|
99
|
+
:'ui' => :'ui'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# Returns all the JSON keys this model knows about
|
104
|
+
def self.acceptable_attributes
|
105
|
+
attribute_map.values
|
106
|
+
end
|
107
|
+
|
108
|
+
# Attribute type mapping.
|
109
|
+
def self.openapi_types
|
110
|
+
{
|
111
|
+
:'acs_mode' => :'String',
|
112
|
+
:'custom_params' => :'Array<PaylinkCustomParam>',
|
113
|
+
:'descriptor' => :'String',
|
114
|
+
:'expire_in' => :'String',
|
115
|
+
:'field_guard' => :'Array<PaylinkFieldGuardModel>',
|
116
|
+
:'lock_params' => :'Array<String>',
|
117
|
+
:'merch_logo' => :'String',
|
118
|
+
:'merch_terms' => :'String',
|
119
|
+
:'options' => :'Array<String>',
|
120
|
+
:'part_payments' => :'PaylinkPartPayments',
|
121
|
+
:'pass_through_data' => :'Hash<String, String>',
|
122
|
+
:'pass_through_headers' => :'Hash<String, String>',
|
123
|
+
:'postback' => :'String',
|
124
|
+
:'postback_password' => :'String',
|
125
|
+
:'postback_policy' => :'String',
|
126
|
+
:'postback_username' => :'String',
|
127
|
+
:'redirect_delay' => :'Integer',
|
128
|
+
:'redirect_failure' => :'String',
|
129
|
+
:'redirect_success' => :'String',
|
130
|
+
:'renderer' => :'String',
|
131
|
+
:'return_params' => :'Boolean',
|
132
|
+
:'ui' => :'PaylinkUI'
|
133
|
+
}
|
134
|
+
end
|
135
|
+
|
136
|
+
# List of attributes with nullable: true
|
137
|
+
def self.openapi_nullable
|
138
|
+
Set.new([
|
139
|
+
])
|
140
|
+
end
|
141
|
+
|
142
|
+
# Initializes the object
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
def initialize(attributes = {})
|
145
|
+
if (!attributes.is_a?(Hash))
|
146
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::PaylinkConfig` initialize method"
|
147
|
+
end
|
148
|
+
|
149
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
150
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
151
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
152
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::PaylinkConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
153
|
+
end
|
154
|
+
h[k.to_sym] = v
|
155
|
+
}
|
156
|
+
|
157
|
+
if attributes.key?(:'acs_mode')
|
158
|
+
self.acs_mode = attributes[:'acs_mode']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'custom_params')
|
162
|
+
if (value = attributes[:'custom_params']).is_a?(Array)
|
163
|
+
self.custom_params = value
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.key?(:'descriptor')
|
168
|
+
self.descriptor = attributes[:'descriptor']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.key?(:'expire_in')
|
172
|
+
self.expire_in = attributes[:'expire_in']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'field_guard')
|
176
|
+
if (value = attributes[:'field_guard']).is_a?(Array)
|
177
|
+
self.field_guard = value
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'lock_params')
|
182
|
+
if (value = attributes[:'lock_params']).is_a?(Array)
|
183
|
+
self.lock_params = value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'merch_logo')
|
188
|
+
self.merch_logo = attributes[:'merch_logo']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.key?(:'merch_terms')
|
192
|
+
self.merch_terms = attributes[:'merch_terms']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'options')
|
196
|
+
if (value = attributes[:'options']).is_a?(Array)
|
197
|
+
self.options = value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'part_payments')
|
202
|
+
self.part_payments = attributes[:'part_payments']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'pass_through_data')
|
206
|
+
if (value = attributes[:'pass_through_data']).is_a?(Hash)
|
207
|
+
self.pass_through_data = value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
if attributes.key?(:'pass_through_headers')
|
212
|
+
if (value = attributes[:'pass_through_headers']).is_a?(Hash)
|
213
|
+
self.pass_through_headers = value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'postback')
|
218
|
+
self.postback = attributes[:'postback']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'postback_password')
|
222
|
+
self.postback_password = attributes[:'postback_password']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'postback_policy')
|
226
|
+
self.postback_policy = attributes[:'postback_policy']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'postback_username')
|
230
|
+
self.postback_username = attributes[:'postback_username']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'redirect_delay')
|
234
|
+
self.redirect_delay = attributes[:'redirect_delay']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'redirect_failure')
|
238
|
+
self.redirect_failure = attributes[:'redirect_failure']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'redirect_success')
|
242
|
+
self.redirect_success = attributes[:'redirect_success']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'renderer')
|
246
|
+
self.renderer = attributes[:'renderer']
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'return_params')
|
250
|
+
self.return_params = attributes[:'return_params']
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'ui')
|
254
|
+
self.ui = attributes[:'ui']
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
259
|
+
# @return Array for valid properties with the reasons
|
260
|
+
def list_invalid_properties
|
261
|
+
invalid_properties = Array.new
|
262
|
+
invalid_properties
|
263
|
+
end
|
264
|
+
|
265
|
+
# Check to see if the all the properties in the model are valid
|
266
|
+
# @return true if the model is valid
|
267
|
+
def valid?
|
268
|
+
true
|
269
|
+
end
|
270
|
+
|
271
|
+
# Checks equality by comparing each attribute.
|
272
|
+
# @param [Object] Object to be compared
|
273
|
+
def ==(o)
|
274
|
+
return true if self.equal?(o)
|
275
|
+
self.class == o.class &&
|
276
|
+
acs_mode == o.acs_mode &&
|
277
|
+
custom_params == o.custom_params &&
|
278
|
+
descriptor == o.descriptor &&
|
279
|
+
expire_in == o.expire_in &&
|
280
|
+
field_guard == o.field_guard &&
|
281
|
+
lock_params == o.lock_params &&
|
282
|
+
merch_logo == o.merch_logo &&
|
283
|
+
merch_terms == o.merch_terms &&
|
284
|
+
options == o.options &&
|
285
|
+
part_payments == o.part_payments &&
|
286
|
+
pass_through_data == o.pass_through_data &&
|
287
|
+
pass_through_headers == o.pass_through_headers &&
|
288
|
+
postback == o.postback &&
|
289
|
+
postback_password == o.postback_password &&
|
290
|
+
postback_policy == o.postback_policy &&
|
291
|
+
postback_username == o.postback_username &&
|
292
|
+
redirect_delay == o.redirect_delay &&
|
293
|
+
redirect_failure == o.redirect_failure &&
|
294
|
+
redirect_success == o.redirect_success &&
|
295
|
+
renderer == o.renderer &&
|
296
|
+
return_params == o.return_params &&
|
297
|
+
ui == o.ui
|
298
|
+
end
|
299
|
+
|
300
|
+
# @see the `==` method
|
301
|
+
# @param [Object] Object to be compared
|
302
|
+
def eql?(o)
|
303
|
+
self == o
|
304
|
+
end
|
305
|
+
|
306
|
+
# Calculates hash code according to all attributes.
|
307
|
+
# @return [Integer] Hash code
|
308
|
+
def hash
|
309
|
+
[acs_mode, custom_params, descriptor, expire_in, field_guard, lock_params, merch_logo, merch_terms, options, part_payments, pass_through_data, pass_through_headers, postback, postback_password, postback_policy, postback_username, redirect_delay, redirect_failure, redirect_success, renderer, return_params, ui].hash
|
310
|
+
end
|
311
|
+
|
312
|
+
# Builds the object from hash
|
313
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
314
|
+
# @return [Object] Returns the model itself
|
315
|
+
def self.build_from_hash(attributes)
|
316
|
+
new.build_from_hash(attributes)
|
317
|
+
end
|
318
|
+
|
319
|
+
# Builds the object from hash
|
320
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
321
|
+
# @return [Object] Returns the model itself
|
322
|
+
def build_from_hash(attributes)
|
323
|
+
return nil unless attributes.is_a?(Hash)
|
324
|
+
attributes = attributes.transform_keys(&:to_sym)
|
325
|
+
self.class.openapi_types.each_pair do |key, type|
|
326
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
327
|
+
self.send("#{key}=", nil)
|
328
|
+
elsif type =~ /\AArray<(.*)>/i
|
329
|
+
# check to ensure the input is an array given that the attribute
|
330
|
+
# is documented as an array but the input is not
|
331
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
332
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
333
|
+
end
|
334
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
335
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
self
|
340
|
+
end
|
341
|
+
|
342
|
+
# Deserializes the data based on type
|
343
|
+
# @param string type Data type
|
344
|
+
# @param string value Value to be deserialized
|
345
|
+
# @return [Object] Deserialized data
|
346
|
+
def _deserialize(type, value)
|
347
|
+
case type.to_sym
|
348
|
+
when :Time
|
349
|
+
Time.parse(value)
|
350
|
+
when :Date
|
351
|
+
Date.parse(value)
|
352
|
+
when :String
|
353
|
+
value.to_s
|
354
|
+
when :Integer
|
355
|
+
value.to_i
|
356
|
+
when :Float
|
357
|
+
value.to_f
|
358
|
+
when :Boolean
|
359
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
360
|
+
true
|
361
|
+
else
|
362
|
+
false
|
363
|
+
end
|
364
|
+
when :Object
|
365
|
+
# generic object (usually a Hash), return directly
|
366
|
+
value
|
367
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
368
|
+
inner_type = Regexp.last_match[:inner_type]
|
369
|
+
value.map { |v| _deserialize(inner_type, v) }
|
370
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
371
|
+
k_type = Regexp.last_match[:k_type]
|
372
|
+
v_type = Regexp.last_match[:v_type]
|
373
|
+
{}.tap do |hash|
|
374
|
+
value.each do |k, v|
|
375
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
else # model
|
379
|
+
# models (e.g. Pet) or oneOf
|
380
|
+
klass = CityPayApiClient.const_get(type)
|
381
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
# Returns the string representation of the object
|
386
|
+
# @return [String] String presentation of the object
|
387
|
+
def to_s
|
388
|
+
to_hash.to_s
|
389
|
+
end
|
390
|
+
|
391
|
+
# to_body is an alias to to_hash (backward compatibility)
|
392
|
+
# @return [Hash] Returns the object in the form of hash
|
393
|
+
def to_body
|
394
|
+
to_hash
|
395
|
+
end
|
396
|
+
|
397
|
+
# Returns the object in the form of hash
|
398
|
+
# @return [Hash] Returns the object in the form of hash
|
399
|
+
def to_hash
|
400
|
+
hash = {}
|
401
|
+
self.class.attribute_map.each_pair do |attr, param|
|
402
|
+
value = self.send(attr)
|
403
|
+
if value.nil?
|
404
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
405
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
406
|
+
end
|
407
|
+
|
408
|
+
hash[param] = _to_hash(value)
|
409
|
+
end
|
410
|
+
hash
|
411
|
+
end
|
412
|
+
|
413
|
+
# Outputs non-array value in the form of hash
|
414
|
+
# For object, use to_hash. Otherwise, just return the value
|
415
|
+
# @param [Object] value Any valid value
|
416
|
+
# @return [Hash] Returns the value in the form of hash
|
417
|
+
def _to_hash(value)
|
418
|
+
if value.is_a?(Array)
|
419
|
+
value.compact.map { |v| _to_hash(v) }
|
420
|
+
elsif value.is_a?(Hash)
|
421
|
+
{}.tap do |hash|
|
422
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
423
|
+
end
|
424
|
+
elsif value.respond_to? :to_hash
|
425
|
+
value.to_hash
|
426
|
+
else
|
427
|
+
value
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
end
|
432
|
+
|
433
|
+
end
|