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,209 @@
|
|
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 Riskv1authenticationsRiskInformationBuyerHistoryAccountHistory
|
17
|
+
# Applicable when this is not a guest account.
|
18
|
+
attr_accessor :first_use_of_shipping_address
|
19
|
+
|
20
|
+
# Date when the shipping address for this transaction was first used. Recommended for Discover ProtectBuy. If `firstUseOfShippingAddress` is false and not a guest account, then this date is entered.
|
21
|
+
attr_accessor :shipping_address_usage_date
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'first_use_of_shipping_address' => :'firstUseOfShippingAddress',
|
27
|
+
:'shipping_address_usage_date' => :'shippingAddressUsageDate'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.swagger_types
|
33
|
+
{
|
34
|
+
:'first_use_of_shipping_address' => :'BOOLEAN',
|
35
|
+
:'shipping_address_usage_date' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
# convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
46
|
+
|
47
|
+
if attributes.has_key?(:'firstUseOfShippingAddress')
|
48
|
+
self.first_use_of_shipping_address = attributes[:'firstUseOfShippingAddress']
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes.has_key?(:'shippingAddressUsageDate')
|
52
|
+
self.shipping_address_usage_date = attributes[:'shippingAddressUsageDate']
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properties with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = Array.new
|
60
|
+
if !@shipping_address_usage_date.nil? && @shipping_address_usage_date.to_s.length > 10
|
61
|
+
invalid_properties.push('invalid value for "shipping_address_usage_date", the character length must be smaller than or equal to 10.')
|
62
|
+
end
|
63
|
+
|
64
|
+
invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
return false if !@shipping_address_usage_date.nil? && @shipping_address_usage_date.to_s.length > 10
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Custom attribute writer method with validation
|
75
|
+
# @param [Object] shipping_address_usage_date Value to be assigned
|
76
|
+
def shipping_address_usage_date=(shipping_address_usage_date)
|
77
|
+
if !shipping_address_usage_date.nil? && shipping_address_usage_date.to_s.length > 10
|
78
|
+
fail ArgumentError, 'invalid value for "shipping_address_usage_date", the character length must be smaller than or equal to 10.'
|
79
|
+
end
|
80
|
+
|
81
|
+
@shipping_address_usage_date = shipping_address_usage_date
|
82
|
+
end
|
83
|
+
|
84
|
+
# Checks equality by comparing each attribute.
|
85
|
+
# @param [Object] Object to be compared
|
86
|
+
def ==(o)
|
87
|
+
return true if self.equal?(o)
|
88
|
+
self.class == o.class &&
|
89
|
+
first_use_of_shipping_address == o.first_use_of_shipping_address &&
|
90
|
+
shipping_address_usage_date == o.shipping_address_usage_date
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Fixnum] Hash code
|
101
|
+
def hash
|
102
|
+
[first_use_of_shipping_address, shipping_address_usage_date].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.swagger_types.each_pair do |key, type|
|
111
|
+
if type =~ /\AArray<(.*)>/i
|
112
|
+
# check to ensure the input is an array given that the the attribute
|
113
|
+
# is documented as an array but the input is not
|
114
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
115
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
116
|
+
end
|
117
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
118
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
119
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
+
end
|
121
|
+
|
122
|
+
self
|
123
|
+
end
|
124
|
+
|
125
|
+
# Deserializes the data based on type
|
126
|
+
# @param string type Data type
|
127
|
+
# @param string value Value to be deserialized
|
128
|
+
# @return [Object] Deserialized data
|
129
|
+
def _deserialize(type, value)
|
130
|
+
case type.to_sym
|
131
|
+
when :DateTime
|
132
|
+
DateTime.parse(value)
|
133
|
+
when :Date
|
134
|
+
Date.parse(value)
|
135
|
+
when :String
|
136
|
+
value.to_s
|
137
|
+
when :Integer
|
138
|
+
value.to_i
|
139
|
+
when :Float
|
140
|
+
value.to_f
|
141
|
+
when :BOOLEAN
|
142
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
+
true
|
144
|
+
else
|
145
|
+
false
|
146
|
+
end
|
147
|
+
when :Object
|
148
|
+
# generic object (usually a Hash), return directly
|
149
|
+
value
|
150
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
+
inner_type = Regexp.last_match[:inner_type]
|
152
|
+
value.map { |v| _deserialize(inner_type, v) }
|
153
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
+
k_type = Regexp.last_match[:k_type]
|
155
|
+
v_type = Regexp.last_match[:v_type]
|
156
|
+
{}.tap do |hash|
|
157
|
+
value.each do |k, v|
|
158
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
else # model
|
162
|
+
temp_model = CyberSource.const_get(type).new
|
163
|
+
temp_model.build_from_hash(value)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the string representation of the object
|
168
|
+
# @return [String] String presentation of the object
|
169
|
+
def to_s
|
170
|
+
to_hash.to_s
|
171
|
+
end
|
172
|
+
|
173
|
+
# to_body is an alias to to_hash (backward compatibility)
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
175
|
+
def to_body
|
176
|
+
to_hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the object in the form of hash
|
180
|
+
# @return [Hash] Returns the object in the form of hash
|
181
|
+
def to_hash
|
182
|
+
hash = {}
|
183
|
+
self.class.attribute_map.each_pair do |attr, param|
|
184
|
+
value = self.send(attr)
|
185
|
+
next if value.nil?
|
186
|
+
hash[param] = _to_hash(value)
|
187
|
+
end
|
188
|
+
hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Outputs non-array value in the form of hash
|
192
|
+
# For object, use to_hash. Otherwise, just return the value
|
193
|
+
# @param [Object] value Any valid value
|
194
|
+
# @return [Hash] Returns the value in the form of hash
|
195
|
+
def _to_hash(value)
|
196
|
+
if value.is_a?(Array)
|
197
|
+
value.compact.map { |v| _to_hash(v) }
|
198
|
+
elsif value.is_a?(Hash)
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
201
|
+
end
|
202
|
+
elsif value.respond_to? :to_hash
|
203
|
+
value.to_hash
|
204
|
+
else
|
205
|
+
value
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
@@ -0,0 +1,279 @@
|
|
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 Riskv1authenticationsRiskInformationBuyerHistoryCustomerAccount
|
17
|
+
# Date the cardholder’s account was last changed. This includes changes to the billing or shipping address, new payment accounts or new users added. Recommended for Discover ProtectBuy.
|
18
|
+
attr_accessor :last_change_date
|
19
|
+
|
20
|
+
# The values from the enum can be: - GUEST - NEW_ACCOUNT - EXISTING_ACCOUNT
|
21
|
+
attr_accessor :creation_history
|
22
|
+
|
23
|
+
# This field is applicable only in case of EXISTING_ACCOUNT in creationHistory. Possible values: - ACCOUNT_UPDATED_NOW - ACCOUNT_UPDATED_PAST
|
24
|
+
attr_accessor :modification_history
|
25
|
+
|
26
|
+
# This only applies for EXISTING_ACCOUNT in creationHistory. The values from the enum can be: - PASSWORD_CHANGED_NOW - PASSWORD_CHANGED_PAST - PASSWORD_NEVER_CHANGED
|
27
|
+
attr_accessor :password_history
|
28
|
+
|
29
|
+
# Date the cardholder opened the account. Recommended for Discover ProtectBuy. This only applies for EXISTING_ACCOUNT in creationHistory.
|
30
|
+
attr_accessor :create_date
|
31
|
+
|
32
|
+
# Date the cardholder last changed or reset password on account. Recommended for Discover ProtectBuy. This only applies for PASSWORD_CHANGED_PAST in passwordHistory.
|
33
|
+
attr_accessor :password_change_date
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'last_change_date' => :'lastChangeDate',
|
39
|
+
:'creation_history' => :'creationHistory',
|
40
|
+
:'modification_history' => :'modificationHistory',
|
41
|
+
:'password_history' => :'passwordHistory',
|
42
|
+
:'create_date' => :'createDate',
|
43
|
+
:'password_change_date' => :'passwordChangeDate'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.swagger_types
|
49
|
+
{
|
50
|
+
:'last_change_date' => :'String',
|
51
|
+
:'creation_history' => :'String',
|
52
|
+
:'modification_history' => :'String',
|
53
|
+
:'password_history' => :'String',
|
54
|
+
:'create_date' => :'String',
|
55
|
+
:'password_change_date' => :'String'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
return unless attributes.is_a?(Hash)
|
63
|
+
|
64
|
+
# convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
66
|
+
|
67
|
+
if attributes.has_key?(:'lastChangeDate')
|
68
|
+
self.last_change_date = attributes[:'lastChangeDate']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'creationHistory')
|
72
|
+
self.creation_history = attributes[:'creationHistory']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'modificationHistory')
|
76
|
+
self.modification_history = attributes[:'modificationHistory']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'passwordHistory')
|
80
|
+
self.password_history = attributes[:'passwordHistory']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'createDate')
|
84
|
+
self.create_date = attributes[:'createDate']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'passwordChangeDate')
|
88
|
+
self.password_change_date = attributes[:'passwordChangeDate']
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properties with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
if !@last_change_date.nil? && @last_change_date.to_s.length > 10
|
97
|
+
invalid_properties.push('invalid value for "last_change_date", the character length must be smaller than or equal to 10.')
|
98
|
+
end
|
99
|
+
|
100
|
+
if !@create_date.nil? && @create_date.to_s.length > 10
|
101
|
+
invalid_properties.push('invalid value for "create_date", the character length must be smaller than or equal to 10.')
|
102
|
+
end
|
103
|
+
|
104
|
+
if !@password_change_date.nil? && @password_change_date.to_s.length > 10
|
105
|
+
invalid_properties.push('invalid value for "password_change_date", the character length must be smaller than or equal to 10.')
|
106
|
+
end
|
107
|
+
|
108
|
+
invalid_properties
|
109
|
+
end
|
110
|
+
|
111
|
+
# Check to see if the all the properties in the model are valid
|
112
|
+
# @return true if the model is valid
|
113
|
+
def valid?
|
114
|
+
return false if !@last_change_date.nil? && @last_change_date.to_s.length > 10
|
115
|
+
return false if !@create_date.nil? && @create_date.to_s.length > 10
|
116
|
+
return false if !@password_change_date.nil? && @password_change_date.to_s.length > 10
|
117
|
+
true
|
118
|
+
end
|
119
|
+
|
120
|
+
# Custom attribute writer method with validation
|
121
|
+
# @param [Object] last_change_date Value to be assigned
|
122
|
+
def last_change_date=(last_change_date)
|
123
|
+
if !last_change_date.nil? && last_change_date.to_s.length > 10
|
124
|
+
fail ArgumentError, 'invalid value for "last_change_date", the character length must be smaller than or equal to 10.'
|
125
|
+
end
|
126
|
+
|
127
|
+
@last_change_date = last_change_date
|
128
|
+
end
|
129
|
+
|
130
|
+
# Custom attribute writer method with validation
|
131
|
+
# @param [Object] create_date Value to be assigned
|
132
|
+
def create_date=(create_date)
|
133
|
+
if !create_date.nil? && create_date.to_s.length > 10
|
134
|
+
fail ArgumentError, 'invalid value for "create_date", the character length must be smaller than or equal to 10.'
|
135
|
+
end
|
136
|
+
|
137
|
+
@create_date = create_date
|
138
|
+
end
|
139
|
+
|
140
|
+
# Custom attribute writer method with validation
|
141
|
+
# @param [Object] password_change_date Value to be assigned
|
142
|
+
def password_change_date=(password_change_date)
|
143
|
+
if !password_change_date.nil? && password_change_date.to_s.length > 10
|
144
|
+
fail ArgumentError, 'invalid value for "password_change_date", the character length must be smaller than or equal to 10.'
|
145
|
+
end
|
146
|
+
|
147
|
+
@password_change_date = password_change_date
|
148
|
+
end
|
149
|
+
|
150
|
+
# Checks equality by comparing each attribute.
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def ==(o)
|
153
|
+
return true if self.equal?(o)
|
154
|
+
self.class == o.class &&
|
155
|
+
last_change_date == o.last_change_date &&
|
156
|
+
creation_history == o.creation_history &&
|
157
|
+
modification_history == o.modification_history &&
|
158
|
+
password_history == o.password_history &&
|
159
|
+
create_date == o.create_date &&
|
160
|
+
password_change_date == o.password_change_date
|
161
|
+
end
|
162
|
+
|
163
|
+
# @see the `==` method
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def eql?(o)
|
166
|
+
self == o
|
167
|
+
end
|
168
|
+
|
169
|
+
# Calculates hash code according to all attributes.
|
170
|
+
# @return [Fixnum] Hash code
|
171
|
+
def hash
|
172
|
+
[last_change_date, creation_history, modification_history, password_history, create_date, password_change_date].hash
|
173
|
+
end
|
174
|
+
|
175
|
+
# Builds the object from hash
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
+
# @return [Object] Returns the model itself
|
178
|
+
def build_from_hash(attributes)
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
180
|
+
self.class.swagger_types.each_pair do |key, type|
|
181
|
+
if type =~ /\AArray<(.*)>/i
|
182
|
+
# check to ensure the input is an array given that the the attribute
|
183
|
+
# is documented as an array but the input is not
|
184
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
185
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
186
|
+
end
|
187
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
188
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
189
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
190
|
+
end
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def _deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :DateTime
|
202
|
+
DateTime.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :BOOLEAN
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
temp_model = CyberSource.const_get(type).new
|
233
|
+
temp_model.build_from_hash(value)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the string representation of the object
|
238
|
+
# @return [String] String presentation of the object
|
239
|
+
def to_s
|
240
|
+
to_hash.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_body
|
246
|
+
to_hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Returns the object in the form of hash
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_hash
|
252
|
+
hash = {}
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
254
|
+
value = self.send(attr)
|
255
|
+
next if value.nil?
|
256
|
+
hash[param] = _to_hash(value)
|
257
|
+
end
|
258
|
+
hash
|
259
|
+
end
|
260
|
+
|
261
|
+
# Outputs non-array value in the form of hash
|
262
|
+
# For object, use to_hash. Otherwise, just return the value
|
263
|
+
# @param [Object] value Any valid value
|
264
|
+
# @return [Hash] Returns the value in the form of hash
|
265
|
+
def _to_hash(value)
|
266
|
+
if value.is_a?(Array)
|
267
|
+
value.compact.map { |v| _to_hash(v) }
|
268
|
+
elsif value.is_a?(Hash)
|
269
|
+
{}.tap do |hash|
|
270
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
271
|
+
end
|
272
|
+
elsif value.respond_to? :to_hash
|
273
|
+
value.to_hash
|
274
|
+
else
|
275
|
+
value
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|