cybersource_rest_client 0.0.17 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/AuthenticationSDK/core/MerchantConfig.rb +2 -0
- data/lib/cybersource_rest_client.rb +81 -5
- data/lib/cybersource_rest_client/api/authentication_exemptions_api.rb +89 -0
- data/lib/cybersource_rest_client/api/payer_authentication_api.rb +154 -0
- data/lib/cybersource_rest_client/api/report_definitions_api.rb +9 -0
- data/lib/cybersource_rest_client/api/report_downloads_api.rb +3 -0
- data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +79 -0
- data/lib/cybersource_rest_client/api/reports_api.rb +2 -2
- data/lib/cybersource_rest_client/api_client.rb +12 -0
- data/lib/cybersource_rest_client/models/authentication_exemptions_request.rb +228 -0
- data/lib/cybersource_rest_client/models/buyer_information.rb +20 -20
- data/lib/cybersource_rest_client/models/check_payer_auth_enrollment_request.rb +284 -0
- data/lib/cybersource_rest_client/models/create_payment_instrument_request.rb +2 -41
- data/lib/cybersource_rest_client/models/create_report_subscription_request.rb +27 -2
- data/lib/cybersource_rest_client/models/embedded_instrument_identifier_request.rb +226 -0
- data/lib/cybersource_rest_client/models/{embedded_instrument_identifier.rb → embedded_instrument_identifier_response.rb} +11 -2
- data/lib/cybersource_rest_client/models/{tms_v1_instrument_identifiers_delete409_response__links_payment_instruments.rb → instrument_identifier_payment_instruments_link.rb} +1 -1
- data/lib/cybersource_rest_client/models/{instrument_identifier.rb → instrument_identifier_response.rb} +11 -2
- data/lib/cybersource_rest_client/models/issuer.rb +208 -0
- data/lib/cybersource_rest_client/models/links.rb +10 -1
- data/lib/cybersource_rest_client/models/model_409_links.rb +1 -1
- data/lib/cybersource_rest_client/models/payment_instrument.rb +9 -9
- data/lib/cybersource_rest_client/models/payment_instrument_card.rb +2 -2
- data/lib/cybersource_rest_client/models/payment_instrument_instrument_identifier_request.rb +246 -0
- data/lib/cybersource_rest_client/models/payment_instrument_self_link.rb +183 -0
- data/lib/cybersource_rest_client/models/payment_instruments_links.rb +183 -0
- data/lib/cybersource_rest_client/models/personal_identification.rb +1 -1
- data/lib/cybersource_rest_client/models/predefined_subscription_request_bean.rb +392 -0
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +225 -0
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information_emv.rb +2 -2
- data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +0 -15
- data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +60 -0
- data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +22 -27
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +26 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +4 -4
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +270 -0
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +0 -30
- data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +2 -2
- data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_payouts_options.rb +1 -1
- data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response_report_definitions.rb +23 -4
- data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response.rb +23 -4
- data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response_default_settings.rb +255 -0
- data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_subscriptions.rb +27 -2
- data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link.rb +183 -0
- data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link_report_download.rb +192 -0
- data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response_report_search_results.rb +13 -4
- data/lib/cybersource_rest_client/models/request.rb +210 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_excemptions_post400_response.rb +225 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_consumer_authentication_information_strong_authentication.rb +269 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response.rb +255 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_consumer_authentication_information.rb +183 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_risk_information.rb +199 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +285 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response_consumer_authentication_information.rb +324 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +294 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_consumer_authentication_information.rb +444 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information.rb +183 -0
- data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information_amount_details.rb +199 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_acquirer_information.rb +199 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_device_information.rb +183 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information.rb +258 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information_merchant_descriptor.rb +229 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information.rb +212 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_bill_to.rb +496 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_line_items.rb +283 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_ship_to.rb +399 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information.rb +192 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_card.rb +325 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_tokenized_card.rb +291 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +524 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information.rb +194 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +267 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information.rb +192 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +298 -0
- data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +264 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_acquirer_information.rb +274 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +196 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_client_reference_information.rb +208 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information.rb +1359 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_ivr.rb +319 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_strong_authentication.rb +199 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_device_information.rb +430 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_device_information_raw_data.rb +209 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_merchant_information.rb +208 -0
- data/lib/cybersource_rest_client/models/{tss_v2_transactions_get200_response_payment_information_payment_type_funding_source.rb → riskv1authentications_merchant_information_merchant_descriptor.rb} +25 -40
- data/lib/cybersource_rest_client/models/riskv1authentications_order_information.rb +283 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +396 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_order_information_ship_to.rb +459 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_recurring_payment_information.rb +235 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_risk_information.rb +183 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history.rb +262 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_account_history.rb +209 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_customer_account.rb +279 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_travel_information.rb +206 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_legs.rb +259 -0
- data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_passengers.rb +224 -0
- data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +26 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information.rb +13 -4
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information_address.rb +325 -0
- data/lib/cybersource_rest_client/models/riskv1decisions_order_information_bill_to.rb +26 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information.rb +13 -4
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_bank.rb +275 -0
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +2 -2
- data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
- data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +13 -4
- data/lib/cybersource_rest_client/models/riskv1decisions_risk_information_marking_details.rb +275 -0
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_delete409_response__links.rb +1 -1
- data/lib/cybersource_rest_client/models/{tms_v1_instrument_identifiers_payment_instruments_get200_response_instrument_identifier.rb → tms_v1_instrument_identifiers_payment_instruments_embedded_instrument_identifier.rb} +11 -2
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__embedded.rb +183 -0
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links.rb +183 -0
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links_self.rb +183 -0
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information.rb +20 -20
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_card.rb +2 -2
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_payment_instruments.rb +9 -9
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification.rb +1 -1
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response.rb +10 -1
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links.rb +10 -1
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links_payment_instruments.rb +183 -0
- data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response_issuer.rb +208 -0
- data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_instrument_identifier.rb +226 -0
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information_applications.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information.rb +3 -3
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +12 -31
- data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +2 -2
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +1 -1
- data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_type.rb +9 -9
- data/lib/cybersource_rest_client/models/update_payment_instrument_request.rb +2 -41
- data/lib/cybersource_rest_client/utilities/flex/token_verification.rb +42 -0
- metadata +79 -7
@@ -0,0 +1,324 @@
|
|
1
|
+
=begin
|
2
|
+
#CyberSource Merged Spec
|
3
|
+
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class RiskV1AuthenticationResultsPost201ResponseConsumerAuthenticationInformation
|
17
|
+
# Raw authentication data that comes from the cardissuing bank. Primary authentication field that indicates if authentication was successful and if liability shift occurred. You should examine first the result of this field. This field contains one of these values: - `-1`: Invalid PARes. - `0`: Successful validation. - `1`: Cardholder is not participating, but the attempt to authenticate was recorded. - `6`: Issuer unable to perform authentication. - `9`: Cardholder did not complete authentication.
|
18
|
+
attr_accessor :authentication_result
|
19
|
+
|
20
|
+
# Message that explains the authenticationResult reply field.
|
21
|
+
attr_accessor :authentication_status_msg
|
22
|
+
|
23
|
+
# Unique identifier generated by the card-issuing bank for Visa, American Express, JCB, Diners Club, and Discover transactions after the customer is authenticated. The value is in base64. When you request the card authorization service, CyberSource automatically converts the value, not the field name, to the format required by your payment processor.
|
24
|
+
attr_accessor :cavv
|
25
|
+
|
26
|
+
# Field that is returned only when the CAVV is generated, which occurs when paresStatus contains the values Y (successful authentication) or A (attempted authentication). If you use the ATOS processor, send the value of this field in the `cavv_algorithm` request field of the authorization service. This field contains one of these values: - `2`: Visa, American Express, JCB, Diners Club, and Discover - `3`: Mastercard
|
27
|
+
attr_accessor :cavv_algorithm
|
28
|
+
|
29
|
+
# Indicator used to differentiate Internet transactions from other types. The authentication failed if this field is not returned. For Visa, if your payment processor is Streamline, Barclays, AIBMS, or FDC Germany, you receive the value vbv_failure instead of internet when eci is 07. The value of this field is passed automatically to the authorization service if you request the services together. This field contains one of these values: - `aesk`: American Express SafeKey authentication verified successfully. - `aesk_attempted`: Card not enrolled in American Express SafeKey, but the attempt to authenticate was recorded. - `dipb`: Discover ProtectBuy authentication verified successfully. - `dipb_attempted`: Card not enrolled in Discover ProtectBuy, but the attempt to authenticate was recorded. - `internet`: Authentication was not verified successfully. - `js`: J/Secure authentication verified successfully. - `js_attempted`: Card not enrolled in J/Secure, but the attempt to authenticate was recorded. - `moto`: Mail or telephone order. - `pb_attempted`: Card not enrolled in Diners Club ProtectBuy, but the attempt to authenticate was recorded. - `recurring`: Recurring transaction. - `spa`: Mastercard Identity Check authentication verified successfully. - `spa_failure`: Mastercard Identity Check failed authentication. - `vbv`: Visa Secure authentication verified successfully. - `vbv_attempted`: Card not enrolled in Visa Secure, but the attempt to authenticate was recorded. - `vbv_failure`: Visa Secure authentication unavailable.
|
30
|
+
attr_accessor :indicator
|
31
|
+
|
32
|
+
# Note This field applies only to non-U.S-issued cards. For enroll, Numeric electronic commerce indicator (ECI) returned only for Visa, American Express, JCB, Diners Club, and Discover transactions when the card is not enrolled. For more information, see \"Interpreting the Reply,\" page 22. If you are not using the CyberSource payment services, you must send this value to your payment processor in the subsequent request for card authorization. This field contains one of these values: - `06`: The card can be enrolled. Liability shift. - `07`: The card cannot be enrolled. No liability shift. For validate, Numeric electronic commerce indicator (ECI) returned only for Visa, American Express, JCB, Diners Club, and Discover transactions. The field is absent when authentication fails. You must send this value to your payment processor in the subsequent request for card authorization. This field contains one of these values: - `05`: Successful authentication - `06`: Authentication attempted - `07`: Failed authentication (No response from the merchant because of a problem.)
|
33
|
+
attr_accessor :eci
|
34
|
+
|
35
|
+
# ECI value that can be returned for Visa, Mastercard, American Express, JCB, Diners Club, and Discover. The field is absent when authentication fails. If your payment processor is Streamline, you must pass the value of this field instead of the value of `eci` or `ucafCollectionIndicator`. This field can contain one of these values: - `01`: Authentication attempted (Mastercard) - `02`: Successful authentication (Mastercard) - `05`: Successful authentication (Visa, American Express, JCB, Diners Club, and Discover) - `06`: Authentication attempted (Visa, American Express, JCB, Diners Club, and Discover)
|
36
|
+
attr_accessor :eci_raw
|
37
|
+
|
38
|
+
# Raw result of the authentication check. If you are configured for Asia, Middle East, and Africa Gateway Processing, you need to send the value of this field in your authorization request. This field can contain one of these values: - `A`: Proof of authentication attempt was generated. - `N`: Customer failed or canceled authentication. Transaction denied. - `U`: Authentication not completed regardless of the reason. - `Y`: Customer was successfully authenticated.
|
39
|
+
attr_accessor :pares_status
|
40
|
+
|
41
|
+
# This field contains the 3D Secure version that was used to process the transaction. For example, 1.0.2 or 2.0.0.
|
42
|
+
attr_accessor :specification_version
|
43
|
+
|
44
|
+
# AAV is a unique identifier generated by the card-issuing bank for Mastercard Identity Check transactions after the customer is authenticated. The value is in base64. Include the data in the card authorization request.
|
45
|
+
attr_accessor :ucaf_authentication_data
|
46
|
+
|
47
|
+
# For enroll, Returned only for Mastercard transactions. Indicates that authentication is not required because the customer is not enrolled. Add the value of this field to the authorization field ucaf_collection_indicator. This field can contain these values: 0, 1. For validate, Numeric electronic commerce indicator (ECI) returned only for Mastercard Identity Check transactions. The field is absent when authentication fails. You must send this value to your payment processor in the request for card authorization. This field contain one of these values: - `0`: Authentication data not collected, and customer authentication was not completed. - `1`: Authentication data not collected because customer authentication was not completed. - `2`: Authentication data collected because customer completed authentication.
|
48
|
+
attr_accessor :ucaf_collection_indicator
|
49
|
+
|
50
|
+
# Transaction identifier generated by CyberSource for successful enrollment or validation checks. Use this value, which is in base64, to match an outgoing PAReq with an incoming PARes. CyberSource forwards the XID with the card authorization service to these payment processors in these cases: - Barclays - Streamline (when the **ecommerceIndicator**`=spa`)
|
51
|
+
attr_accessor :xid
|
52
|
+
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
54
|
+
def self.attribute_map
|
55
|
+
{
|
56
|
+
:'authentication_result' => :'authenticationResult',
|
57
|
+
:'authentication_status_msg' => :'authenticationStatusMsg',
|
58
|
+
:'cavv' => :'cavv',
|
59
|
+
:'cavv_algorithm' => :'cavvAlgorithm',
|
60
|
+
:'indicator' => :'indicator',
|
61
|
+
:'eci' => :'eci',
|
62
|
+
:'eci_raw' => :'eciRaw',
|
63
|
+
:'pares_status' => :'paresStatus',
|
64
|
+
:'specification_version' => :'specificationVersion',
|
65
|
+
:'ucaf_authentication_data' => :'ucafAuthenticationData',
|
66
|
+
:'ucaf_collection_indicator' => :'ucafCollectionIndicator',
|
67
|
+
:'xid' => :'xid'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute type mapping.
|
72
|
+
def self.swagger_types
|
73
|
+
{
|
74
|
+
:'authentication_result' => :'String',
|
75
|
+
:'authentication_status_msg' => :'String',
|
76
|
+
:'cavv' => :'String',
|
77
|
+
:'cavv_algorithm' => :'String',
|
78
|
+
:'indicator' => :'String',
|
79
|
+
:'eci' => :'String',
|
80
|
+
:'eci_raw' => :'String',
|
81
|
+
:'pares_status' => :'String',
|
82
|
+
:'specification_version' => :'String',
|
83
|
+
:'ucaf_authentication_data' => :'String',
|
84
|
+
:'ucaf_collection_indicator' => :'Float',
|
85
|
+
:'xid' => :'String'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Initializes the object
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
def initialize(attributes = {})
|
92
|
+
return unless attributes.is_a?(Hash)
|
93
|
+
|
94
|
+
# convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
96
|
+
|
97
|
+
if attributes.has_key?(:'authenticationResult')
|
98
|
+
self.authentication_result = attributes[:'authenticationResult']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'authenticationStatusMsg')
|
102
|
+
self.authentication_status_msg = attributes[:'authenticationStatusMsg']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'cavv')
|
106
|
+
self.cavv = attributes[:'cavv']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'cavvAlgorithm')
|
110
|
+
self.cavv_algorithm = attributes[:'cavvAlgorithm']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'indicator')
|
114
|
+
self.indicator = attributes[:'indicator']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'eci')
|
118
|
+
self.eci = attributes[:'eci']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'eciRaw')
|
122
|
+
self.eci_raw = attributes[:'eciRaw']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'paresStatus')
|
126
|
+
self.pares_status = attributes[:'paresStatus']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'specificationVersion')
|
130
|
+
self.specification_version = attributes[:'specificationVersion']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'ucafAuthenticationData')
|
134
|
+
self.ucaf_authentication_data = attributes[:'ucafAuthenticationData']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'ucafCollectionIndicator')
|
138
|
+
self.ucaf_collection_indicator = attributes[:'ucafCollectionIndicator']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'xid')
|
142
|
+
self.xid = attributes[:'xid']
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
147
|
+
# @return Array for valid properties with the reasons
|
148
|
+
def list_invalid_properties
|
149
|
+
invalid_properties = Array.new
|
150
|
+
if !@cavv.nil? && @cavv.to_s.length > 255
|
151
|
+
invalid_properties.push('invalid value for "cavv", the character length must be smaller than or equal to 255.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if !@cavv_algorithm.nil? && @cavv_algorithm.to_s.length > 1
|
155
|
+
invalid_properties.push('invalid value for "cavv_algorithm", the character length must be smaller than or equal to 1.')
|
156
|
+
end
|
157
|
+
|
158
|
+
invalid_properties
|
159
|
+
end
|
160
|
+
|
161
|
+
# Check to see if the all the properties in the model are valid
|
162
|
+
# @return true if the model is valid
|
163
|
+
def valid?
|
164
|
+
return false if !@cavv.nil? && @cavv.to_s.length > 255
|
165
|
+
return false if !@cavv_algorithm.nil? && @cavv_algorithm.to_s.length > 1
|
166
|
+
true
|
167
|
+
end
|
168
|
+
|
169
|
+
# Custom attribute writer method with validation
|
170
|
+
# @param [Object] cavv Value to be assigned
|
171
|
+
def cavv=(cavv)
|
172
|
+
if !cavv.nil? && cavv.to_s.length > 255
|
173
|
+
fail ArgumentError, 'invalid value for "cavv", the character length must be smaller than or equal to 255.'
|
174
|
+
end
|
175
|
+
|
176
|
+
@cavv = cavv
|
177
|
+
end
|
178
|
+
|
179
|
+
# Custom attribute writer method with validation
|
180
|
+
# @param [Object] cavv_algorithm Value to be assigned
|
181
|
+
def cavv_algorithm=(cavv_algorithm)
|
182
|
+
if !cavv_algorithm.nil? && cavv_algorithm.to_s.length > 1
|
183
|
+
fail ArgumentError, 'invalid value for "cavv_algorithm", the character length must be smaller than or equal to 1.'
|
184
|
+
end
|
185
|
+
|
186
|
+
@cavv_algorithm = cavv_algorithm
|
187
|
+
end
|
188
|
+
|
189
|
+
# Checks equality by comparing each attribute.
|
190
|
+
# @param [Object] Object to be compared
|
191
|
+
def ==(o)
|
192
|
+
return true if self.equal?(o)
|
193
|
+
self.class == o.class &&
|
194
|
+
authentication_result == o.authentication_result &&
|
195
|
+
authentication_status_msg == o.authentication_status_msg &&
|
196
|
+
cavv == o.cavv &&
|
197
|
+
cavv_algorithm == o.cavv_algorithm &&
|
198
|
+
indicator == o.indicator &&
|
199
|
+
eci == o.eci &&
|
200
|
+
eci_raw == o.eci_raw &&
|
201
|
+
pares_status == o.pares_status &&
|
202
|
+
specification_version == o.specification_version &&
|
203
|
+
ucaf_authentication_data == o.ucaf_authentication_data &&
|
204
|
+
ucaf_collection_indicator == o.ucaf_collection_indicator &&
|
205
|
+
xid == o.xid
|
206
|
+
end
|
207
|
+
|
208
|
+
# @see the `==` method
|
209
|
+
# @param [Object] Object to be compared
|
210
|
+
def eql?(o)
|
211
|
+
self == o
|
212
|
+
end
|
213
|
+
|
214
|
+
# Calculates hash code according to all attributes.
|
215
|
+
# @return [Fixnum] Hash code
|
216
|
+
def hash
|
217
|
+
[authentication_result, authentication_status_msg, cavv, cavv_algorithm, indicator, eci, eci_raw, pares_status, specification_version, ucaf_authentication_data, ucaf_collection_indicator, xid].hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Builds the object from hash
|
221
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
222
|
+
# @return [Object] Returns the model itself
|
223
|
+
def build_from_hash(attributes)
|
224
|
+
return nil unless attributes.is_a?(Hash)
|
225
|
+
self.class.swagger_types.each_pair do |key, type|
|
226
|
+
if type =~ /\AArray<(.*)>/i
|
227
|
+
# check to ensure the input is an array given that the the attribute
|
228
|
+
# is documented as an array but the input is not
|
229
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
230
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
231
|
+
end
|
232
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
233
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
234
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
235
|
+
end
|
236
|
+
|
237
|
+
self
|
238
|
+
end
|
239
|
+
|
240
|
+
# Deserializes the data based on type
|
241
|
+
# @param string type Data type
|
242
|
+
# @param string value Value to be deserialized
|
243
|
+
# @return [Object] Deserialized data
|
244
|
+
def _deserialize(type, value)
|
245
|
+
case type.to_sym
|
246
|
+
when :DateTime
|
247
|
+
DateTime.parse(value)
|
248
|
+
when :Date
|
249
|
+
Date.parse(value)
|
250
|
+
when :String
|
251
|
+
value.to_s
|
252
|
+
when :Integer
|
253
|
+
value.to_i
|
254
|
+
when :Float
|
255
|
+
value.to_f
|
256
|
+
when :BOOLEAN
|
257
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
258
|
+
true
|
259
|
+
else
|
260
|
+
false
|
261
|
+
end
|
262
|
+
when :Object
|
263
|
+
# generic object (usually a Hash), return directly
|
264
|
+
value
|
265
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
266
|
+
inner_type = Regexp.last_match[:inner_type]
|
267
|
+
value.map { |v| _deserialize(inner_type, v) }
|
268
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
269
|
+
k_type = Regexp.last_match[:k_type]
|
270
|
+
v_type = Regexp.last_match[:v_type]
|
271
|
+
{}.tap do |hash|
|
272
|
+
value.each do |k, v|
|
273
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
else # model
|
277
|
+
temp_model = CyberSource.const_get(type).new
|
278
|
+
temp_model.build_from_hash(value)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# Returns the string representation of the object
|
283
|
+
# @return [String] String presentation of the object
|
284
|
+
def to_s
|
285
|
+
to_hash.to_s
|
286
|
+
end
|
287
|
+
|
288
|
+
# to_body is an alias to to_hash (backward compatibility)
|
289
|
+
# @return [Hash] Returns the object in the form of hash
|
290
|
+
def to_body
|
291
|
+
to_hash
|
292
|
+
end
|
293
|
+
|
294
|
+
# Returns the object in the form of hash
|
295
|
+
# @return [Hash] Returns the object in the form of hash
|
296
|
+
def to_hash
|
297
|
+
hash = {}
|
298
|
+
self.class.attribute_map.each_pair do |attr, param|
|
299
|
+
value = self.send(attr)
|
300
|
+
next if value.nil?
|
301
|
+
hash[param] = _to_hash(value)
|
302
|
+
end
|
303
|
+
hash
|
304
|
+
end
|
305
|
+
|
306
|
+
# Outputs non-array value in the form of hash
|
307
|
+
# For object, use to_hash. Otherwise, just return the value
|
308
|
+
# @param [Object] value Any valid value
|
309
|
+
# @return [Hash] Returns the value in the form of hash
|
310
|
+
def _to_hash(value)
|
311
|
+
if value.is_a?(Array)
|
312
|
+
value.compact.map { |v| _to_hash(v) }
|
313
|
+
elsif value.is_a?(Hash)
|
314
|
+
{}.tap do |hash|
|
315
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
316
|
+
end
|
317
|
+
elsif value.respond_to? :to_hash
|
318
|
+
value.to_hash
|
319
|
+
else
|
320
|
+
value
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
@@ -0,0 +1,294 @@
|
|
1
|
+
=begin
|
2
|
+
#CyberSource Merged Spec
|
3
|
+
|
4
|
+
#All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module CyberSource
|
16
|
+
class RiskV1AuthenticationsPost201Response
|
17
|
+
attr_accessor :_links
|
18
|
+
|
19
|
+
# An unique identification number assigned by CyberSource to identify the submitted request. It is also appended to the endpoint of the resource.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# Time of request in UTC. Format: `YYYY-MM-DDThh:mm:ssZ` Example `2016-08-11T22:47:57Z` equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The `T` separates the date and the time. The `Z` indicates UTC.
|
23
|
+
attr_accessor :submit_time_utc
|
24
|
+
|
25
|
+
# Time that the transaction was submitted in local time.
|
26
|
+
attr_accessor :submit_time_local
|
27
|
+
|
28
|
+
# The status for payerAuthentication 201 enroll and validate calls. Possible values are: - AUTHENTICATION_SUCCESSFUL - PENDING_AUTHENTICATION
|
29
|
+
attr_accessor :status
|
30
|
+
|
31
|
+
# The reason of the status. Possible values are: - Authentication_Completed_Or_Skipped_Sucessfully - Pending_Authentication
|
32
|
+
attr_accessor :reason
|
33
|
+
|
34
|
+
# The message describing the reason of the status. Value is: - The cardholder is enrolled in Payer Authentication. Please authenticate the cardholder before continuing with the transaction.
|
35
|
+
attr_accessor :message
|
36
|
+
|
37
|
+
attr_accessor :client_reference_information
|
38
|
+
|
39
|
+
attr_accessor :order_information
|
40
|
+
|
41
|
+
attr_accessor :consumer_authentication_information
|
42
|
+
|
43
|
+
attr_accessor :error_information
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'_links' => :'_links',
|
49
|
+
:'id' => :'id',
|
50
|
+
:'submit_time_utc' => :'submitTimeUtc',
|
51
|
+
:'submit_time_local' => :'submitTimeLocal',
|
52
|
+
:'status' => :'status',
|
53
|
+
:'reason' => :'reason',
|
54
|
+
:'message' => :'message',
|
55
|
+
:'client_reference_information' => :'clientReferenceInformation',
|
56
|
+
:'order_information' => :'orderInformation',
|
57
|
+
:'consumer_authentication_information' => :'consumerAuthenticationInformation',
|
58
|
+
:'error_information' => :'errorInformation'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.swagger_types
|
64
|
+
{
|
65
|
+
:'_links' => :'PtsV2PaymentsReversalsPost201ResponseLinks',
|
66
|
+
:'id' => :'String',
|
67
|
+
:'submit_time_utc' => :'String',
|
68
|
+
:'submit_time_local' => :'String',
|
69
|
+
:'status' => :'String',
|
70
|
+
:'reason' => :'String',
|
71
|
+
:'message' => :'String',
|
72
|
+
:'client_reference_information' => :'Ptsv2payoutsClientReferenceInformation',
|
73
|
+
:'order_information' => :'RiskV1AuthenticationsPost201ResponseOrderInformation',
|
74
|
+
:'consumer_authentication_information' => :'RiskV1AuthenticationsPost201ResponseConsumerAuthenticationInformation',
|
75
|
+
:'error_information' => :'PtsV2PaymentsPost201ResponseErrorInformation'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Initializes the object
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
def initialize(attributes = {})
|
82
|
+
return unless attributes.is_a?(Hash)
|
83
|
+
|
84
|
+
# convert string to symbol for hash key
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
86
|
+
|
87
|
+
if attributes.has_key?(:'_links')
|
88
|
+
self._links = attributes[:'_links']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'id')
|
92
|
+
self.id = attributes[:'id']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'submitTimeUtc')
|
96
|
+
self.submit_time_utc = attributes[:'submitTimeUtc']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'submitTimeLocal')
|
100
|
+
self.submit_time_local = attributes[:'submitTimeLocal']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'status')
|
104
|
+
self.status = attributes[:'status']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'reason')
|
108
|
+
self.reason = attributes[:'reason']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'message')
|
112
|
+
self.message = attributes[:'message']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'clientReferenceInformation')
|
116
|
+
self.client_reference_information = attributes[:'clientReferenceInformation']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.has_key?(:'orderInformation')
|
120
|
+
self.order_information = attributes[:'orderInformation']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'consumerAuthenticationInformation')
|
124
|
+
self.consumer_authentication_information = attributes[:'consumerAuthenticationInformation']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'errorInformation')
|
128
|
+
self.error_information = attributes[:'errorInformation']
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
133
|
+
# @return Array for valid properties with the reasons
|
134
|
+
def list_invalid_properties
|
135
|
+
invalid_properties = Array.new
|
136
|
+
if !@id.nil? && @id.to_s.length > 26
|
137
|
+
invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 26.')
|
138
|
+
end
|
139
|
+
|
140
|
+
invalid_properties
|
141
|
+
end
|
142
|
+
|
143
|
+
# Check to see if the all the properties in the model are valid
|
144
|
+
# @return true if the model is valid
|
145
|
+
def valid?
|
146
|
+
return false if !@id.nil? && @id.to_s.length > 26
|
147
|
+
true
|
148
|
+
end
|
149
|
+
|
150
|
+
# Custom attribute writer method with validation
|
151
|
+
# @param [Object] id Value to be assigned
|
152
|
+
def id=(id)
|
153
|
+
if !id.nil? && id.to_s.length > 26
|
154
|
+
fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 26.'
|
155
|
+
end
|
156
|
+
|
157
|
+
@id = id
|
158
|
+
end
|
159
|
+
|
160
|
+
# Checks equality by comparing each attribute.
|
161
|
+
# @param [Object] Object to be compared
|
162
|
+
def ==(o)
|
163
|
+
return true if self.equal?(o)
|
164
|
+
self.class == o.class &&
|
165
|
+
_links == o._links &&
|
166
|
+
id == o.id &&
|
167
|
+
submit_time_utc == o.submit_time_utc &&
|
168
|
+
submit_time_local == o.submit_time_local &&
|
169
|
+
status == o.status &&
|
170
|
+
reason == o.reason &&
|
171
|
+
message == o.message &&
|
172
|
+
client_reference_information == o.client_reference_information &&
|
173
|
+
order_information == o.order_information &&
|
174
|
+
consumer_authentication_information == o.consumer_authentication_information &&
|
175
|
+
error_information == o.error_information
|
176
|
+
end
|
177
|
+
|
178
|
+
# @see the `==` method
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def eql?(o)
|
181
|
+
self == o
|
182
|
+
end
|
183
|
+
|
184
|
+
# Calculates hash code according to all attributes.
|
185
|
+
# @return [Fixnum] Hash code
|
186
|
+
def hash
|
187
|
+
[_links, id, submit_time_utc, submit_time_local, status, reason, message, client_reference_information, order_information, consumer_authentication_information, error_information].hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Builds the object from hash
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
+
# @return [Object] Returns the model itself
|
193
|
+
def build_from_hash(attributes)
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
195
|
+
self.class.swagger_types.each_pair do |key, type|
|
196
|
+
if type =~ /\AArray<(.*)>/i
|
197
|
+
# check to ensure the input is an array given that the the attribute
|
198
|
+
# is documented as an array but the input is not
|
199
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
200
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
201
|
+
end
|
202
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
203
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
204
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
205
|
+
end
|
206
|
+
|
207
|
+
self
|
208
|
+
end
|
209
|
+
|
210
|
+
# Deserializes the data based on type
|
211
|
+
# @param string type Data type
|
212
|
+
# @param string value Value to be deserialized
|
213
|
+
# @return [Object] Deserialized data
|
214
|
+
def _deserialize(type, value)
|
215
|
+
case type.to_sym
|
216
|
+
when :DateTime
|
217
|
+
DateTime.parse(value)
|
218
|
+
when :Date
|
219
|
+
Date.parse(value)
|
220
|
+
when :String
|
221
|
+
value.to_s
|
222
|
+
when :Integer
|
223
|
+
value.to_i
|
224
|
+
when :Float
|
225
|
+
value.to_f
|
226
|
+
when :BOOLEAN
|
227
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
228
|
+
true
|
229
|
+
else
|
230
|
+
false
|
231
|
+
end
|
232
|
+
when :Object
|
233
|
+
# generic object (usually a Hash), return directly
|
234
|
+
value
|
235
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
236
|
+
inner_type = Regexp.last_match[:inner_type]
|
237
|
+
value.map { |v| _deserialize(inner_type, v) }
|
238
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
239
|
+
k_type = Regexp.last_match[:k_type]
|
240
|
+
v_type = Regexp.last_match[:v_type]
|
241
|
+
{}.tap do |hash|
|
242
|
+
value.each do |k, v|
|
243
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
else # model
|
247
|
+
temp_model = CyberSource.const_get(type).new
|
248
|
+
temp_model.build_from_hash(value)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
# Returns the string representation of the object
|
253
|
+
# @return [String] String presentation of the object
|
254
|
+
def to_s
|
255
|
+
to_hash.to_s
|
256
|
+
end
|
257
|
+
|
258
|
+
# to_body is an alias to to_hash (backward compatibility)
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
260
|
+
def to_body
|
261
|
+
to_hash
|
262
|
+
end
|
263
|
+
|
264
|
+
# Returns the object in the form of hash
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
266
|
+
def to_hash
|
267
|
+
hash = {}
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
269
|
+
value = self.send(attr)
|
270
|
+
next if value.nil?
|
271
|
+
hash[param] = _to_hash(value)
|
272
|
+
end
|
273
|
+
hash
|
274
|
+
end
|
275
|
+
|
276
|
+
# Outputs non-array value in the form of hash
|
277
|
+
# For object, use to_hash. Otherwise, just return the value
|
278
|
+
# @param [Object] value Any valid value
|
279
|
+
# @return [Hash] Returns the value in the form of hash
|
280
|
+
def _to_hash(value)
|
281
|
+
if value.is_a?(Array)
|
282
|
+
value.compact.map { |v| _to_hash(v) }
|
283
|
+
elsif value.is_a?(Hash)
|
284
|
+
{}.tap do |hash|
|
285
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
286
|
+
end
|
287
|
+
elsif value.respond_to? :to_hash
|
288
|
+
value.to_hash
|
289
|
+
else
|
290
|
+
value
|
291
|
+
end
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|