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.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/core/MerchantConfig.rb +2 -0
  3. data/lib/cybersource_rest_client.rb +81 -5
  4. data/lib/cybersource_rest_client/api/authentication_exemptions_api.rb +89 -0
  5. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +154 -0
  6. data/lib/cybersource_rest_client/api/report_definitions_api.rb +9 -0
  7. data/lib/cybersource_rest_client/api/report_downloads_api.rb +3 -0
  8. data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +79 -0
  9. data/lib/cybersource_rest_client/api/reports_api.rb +2 -2
  10. data/lib/cybersource_rest_client/api_client.rb +12 -0
  11. data/lib/cybersource_rest_client/models/authentication_exemptions_request.rb +228 -0
  12. data/lib/cybersource_rest_client/models/buyer_information.rb +20 -20
  13. data/lib/cybersource_rest_client/models/check_payer_auth_enrollment_request.rb +284 -0
  14. data/lib/cybersource_rest_client/models/create_payment_instrument_request.rb +2 -41
  15. data/lib/cybersource_rest_client/models/create_report_subscription_request.rb +27 -2
  16. data/lib/cybersource_rest_client/models/embedded_instrument_identifier_request.rb +226 -0
  17. data/lib/cybersource_rest_client/models/{embedded_instrument_identifier.rb → embedded_instrument_identifier_response.rb} +11 -2
  18. data/lib/cybersource_rest_client/models/{tms_v1_instrument_identifiers_delete409_response__links_payment_instruments.rb → instrument_identifier_payment_instruments_link.rb} +1 -1
  19. data/lib/cybersource_rest_client/models/{instrument_identifier.rb → instrument_identifier_response.rb} +11 -2
  20. data/lib/cybersource_rest_client/models/issuer.rb +208 -0
  21. data/lib/cybersource_rest_client/models/links.rb +10 -1
  22. data/lib/cybersource_rest_client/models/model_409_links.rb +1 -1
  23. data/lib/cybersource_rest_client/models/payment_instrument.rb +9 -9
  24. data/lib/cybersource_rest_client/models/payment_instrument_card.rb +2 -2
  25. data/lib/cybersource_rest_client/models/payment_instrument_instrument_identifier_request.rb +246 -0
  26. data/lib/cybersource_rest_client/models/payment_instrument_self_link.rb +183 -0
  27. data/lib/cybersource_rest_client/models/payment_instruments_links.rb +183 -0
  28. data/lib/cybersource_rest_client/models/personal_identification.rb +1 -1
  29. data/lib/cybersource_rest_client/models/predefined_subscription_request_bean.rb +392 -0
  30. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_installment_information.rb +225 -0
  31. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_information_tokenized_card.rb +1 -1
  32. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_point_of_sale_information_emv.rb +2 -2
  33. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_merchant_information_merchant_descriptor.rb +0 -15
  34. data/lib/cybersource_rest_client/models/ptsv2credits_processing_information.rb +2 -2
  35. data/lib/cybersource_rest_client/models/ptsv2payments_aggregator_information_sub_merchant.rb +1 -1
  36. data/lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb +60 -0
  37. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +22 -27
  38. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_amount_details.rb +2 -2
  39. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_bill_to.rb +26 -1
  40. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_line_items.rb +4 -4
  41. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_card.rb +2 -2
  42. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
  43. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information.rb +2 -2
  44. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_aggregator_information_sub_merchant.rb +1 -1
  45. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_installment_information.rb +270 -0
  46. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_order_information_amount_details.rb +2 -2
  47. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_processing_information.rb +1 -1
  48. data/lib/cybersource_rest_client/models/ptsv2paymentsidrefunds_payment_information_card.rb +2 -2
  49. data/lib/cybersource_rest_client/models/ptsv2payouts_merchant_information_merchant_descriptor.rb +0 -30
  50. data/lib/cybersource_rest_client/models/ptsv2payouts_payment_information_card.rb +2 -2
  51. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +2 -2
  52. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_payouts_options.rb +1 -1
  53. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_get200_response_report_definitions.rb +23 -4
  54. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response.rb +23 -4
  55. data/lib/cybersource_rest_client/models/reporting_v3_report_definitions_name_get200_response_default_settings.rb +255 -0
  56. data/lib/cybersource_rest_client/models/reporting_v3_report_subscriptions_get200_response_subscriptions.rb +27 -2
  57. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link.rb +183 -0
  58. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response__link_report_download.rb +192 -0
  59. data/lib/cybersource_rest_client/models/reporting_v3_reports_get200_response_report_search_results.rb +13 -4
  60. data/lib/cybersource_rest_client/models/request.rb +210 -0
  61. data/lib/cybersource_rest_client/models/risk_v1_authentication_excemptions_post400_response.rb +225 -0
  62. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_consumer_authentication_information_strong_authentication.rb +269 -0
  63. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response.rb +255 -0
  64. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_consumer_authentication_information.rb +183 -0
  65. data/lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_risk_information.rb +199 -0
  66. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response.rb +285 -0
  67. data/lib/cybersource_rest_client/models/risk_v1_authentication_results_post201_response_consumer_authentication_information.rb +324 -0
  68. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response.rb +294 -0
  69. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_consumer_authentication_information.rb +444 -0
  70. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information.rb +183 -0
  71. data/lib/cybersource_rest_client/models/risk_v1_authentications_post201_response_order_information_amount_details.rb +199 -0
  72. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_acquirer_information.rb +199 -0
  73. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_device_information.rb +183 -0
  74. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information.rb +258 -0
  75. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_merchant_information_merchant_descriptor.rb +229 -0
  76. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information.rb +212 -0
  77. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_bill_to.rb +496 -0
  78. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_line_items.rb +283 -0
  79. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_order_information_ship_to.rb +399 -0
  80. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information.rb +192 -0
  81. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_card.rb +325 -0
  82. data/lib/cybersource_rest_client/models/riskv1authenticationexemptions_payment_information_tokenized_card.rb +291 -0
  83. data/lib/cybersource_rest_client/models/riskv1authenticationresults_consumer_authentication_information.rb +524 -0
  84. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information.rb +194 -0
  85. data/lib/cybersource_rest_client/models/riskv1authenticationresults_order_information_line_items.rb +267 -0
  86. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information.rb +192 -0
  87. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_card.rb +298 -0
  88. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +264 -0
  89. data/lib/cybersource_rest_client/models/riskv1authentications_acquirer_information.rb +274 -0
  90. data/lib/cybersource_rest_client/models/riskv1authentications_buyer_information.rb +196 -0
  91. data/lib/cybersource_rest_client/models/riskv1authentications_client_reference_information.rb +208 -0
  92. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information.rb +1359 -0
  93. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_ivr.rb +319 -0
  94. data/lib/cybersource_rest_client/models/riskv1authentications_consumer_authentication_information_strong_authentication.rb +199 -0
  95. data/lib/cybersource_rest_client/models/riskv1authentications_device_information.rb +430 -0
  96. data/lib/cybersource_rest_client/models/riskv1authentications_device_information_raw_data.rb +209 -0
  97. data/lib/cybersource_rest_client/models/riskv1authentications_merchant_information.rb +208 -0
  98. 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
  99. data/lib/cybersource_rest_client/models/riskv1authentications_order_information.rb +283 -0
  100. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_line_items.rb +396 -0
  101. data/lib/cybersource_rest_client/models/riskv1authentications_order_information_ship_to.rb +459 -0
  102. data/lib/cybersource_rest_client/models/riskv1authentications_recurring_payment_information.rb +235 -0
  103. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information.rb +183 -0
  104. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history.rb +262 -0
  105. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_account_history.rb +209 -0
  106. data/lib/cybersource_rest_client/models/riskv1authentications_risk_information_buyer_history_customer_account.rb +279 -0
  107. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information.rb +206 -0
  108. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_legs.rb +259 -0
  109. data/lib/cybersource_rest_client/models/riskv1authentications_travel_information_passengers.rb +224 -0
  110. data/lib/cybersource_rest_client/models/riskv1decisions_device_information.rb +26 -1
  111. data/lib/cybersource_rest_client/models/riskv1decisions_order_information.rb +13 -4
  112. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_address.rb +325 -0
  113. data/lib/cybersource_rest_client/models/riskv1decisions_order_information_bill_to.rb +26 -1
  114. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information.rb +13 -4
  115. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_bank.rb +275 -0
  116. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_card.rb +2 -2
  117. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
  118. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information.rb +13 -4
  119. data/lib/cybersource_rest_client/models/riskv1decisions_risk_information_marking_details.rb +275 -0
  120. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_delete409_response__links.rb +1 -1
  121. 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
  122. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__embedded.rb +183 -0
  123. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links.rb +183 -0
  124. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__links_self.rb +183 -0
  125. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information.rb +20 -20
  126. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_card.rb +2 -2
  127. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_payment_instruments.rb +9 -9
  128. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification.rb +1 -1
  129. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response.rb +10 -1
  130. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links.rb +10 -1
  131. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response__links_payment_instruments.rb +183 -0
  132. data/lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_post200_response_issuer.rb +208 -0
  133. data/lib/cybersource_rest_client/models/tmsv1instrumentidentifiers_card.rb +1 -1
  134. data/lib/cybersource_rest_client/models/tmsv1paymentinstruments_instrument_identifier.rb +226 -0
  135. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_application_information_applications.rb +1 -1
  136. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_client_reference_information.rb +3 -3
  137. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_card.rb +1 -1
  138. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_payment_information_payment_type.rb +12 -31
  139. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processing_information.rb +1 -1
  140. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_client_reference_information.rb +2 -2
  141. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_card.rb +1 -1
  142. data/lib/cybersource_rest_client/models/tss_v2_transactions_post201_response__embedded_payment_information_payment_type.rb +9 -9
  143. data/lib/cybersource_rest_client/models/update_payment_instrument_request.rb +2 -41
  144. data/lib/cybersource_rest_client/utilities/flex/token_verification.rb +42 -0
  145. metadata +79 -7
@@ -0,0 +1,212 @@
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 Riskv1authenticationexemptionsOrderInformation
17
+ attr_accessor :amount_details
18
+
19
+ attr_accessor :ship_to
20
+
21
+ attr_accessor :line_items
22
+
23
+ attr_accessor :bill_to
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'amount_details' => :'amountDetails',
29
+ :'ship_to' => :'shipTo',
30
+ :'line_items' => :'lineItems',
31
+ :'bill_to' => :'billTo'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'amount_details' => :'Riskv1decisionsOrderInformationAmountDetails',
39
+ :'ship_to' => :'Riskv1authenticationexemptionsOrderInformationShipTo',
40
+ :'line_items' => :'Array<Riskv1authenticationexemptionsOrderInformationLineItems>',
41
+ :'bill_to' => :'Riskv1authenticationexemptionsOrderInformationBillTo'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'amountDetails')
54
+ self.amount_details = attributes[:'amountDetails']
55
+ end
56
+
57
+ if attributes.has_key?(:'shipTo')
58
+ self.ship_to = attributes[:'shipTo']
59
+ end
60
+
61
+ if attributes.has_key?(:'lineItems')
62
+ if (value = attributes[:'lineItems']).is_a?(Array)
63
+ self.line_items = value
64
+ end
65
+ end
66
+
67
+ if attributes.has_key?(:'billTo')
68
+ self.bill_to = attributes[:'billTo']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ amount_details == o.amount_details &&
91
+ ship_to == o.ship_to &&
92
+ line_items == o.line_items &&
93
+ bill_to == o.bill_to
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Fixnum] Hash code
104
+ def hash
105
+ [amount_details, ship_to, line_items, bill_to].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.swagger_types.each_pair do |key, type|
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :DateTime
135
+ DateTime.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :BOOLEAN
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ temp_model = CyberSource.const_get(type).new
166
+ temp_model.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ next if value.nil?
189
+ hash[param] = _to_hash(value)
190
+ end
191
+ hash
192
+ end
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map { |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+ end
212
+ end
@@ -0,0 +1,496 @@
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 Riskv1authenticationexemptionsOrderInformationBillTo
17
+ # Payment card billing street address as it appears on the credit card issuer’s records. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet **Important** When you populate billing street address 1 and billing street address 2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_address1` request-level field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
18
+ attr_accessor :address1
19
+
20
+ # Additional address information. For Payouts: This field may be sent only for FDC Compass. #### Atos This field must not contain colons (:). #### Chase Paymentech Solutions, FDC Compass, and TSYS Acquiring Solutions This value is used for AVS. #### CyberSource through VisaNet **Important** When you populate billing street address 1 and billing street address 2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. For processor-specific information, see the `bill_address2` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
21
+ attr_accessor :address2
22
+
23
+ # State or province of the billing address. Use the State, Province, and Territory Codes for the United States and Canada. For Payouts: This field may be sent only for FDC Compass. ##### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_state` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
24
+ attr_accessor :administrative_area
25
+
26
+ # Payment card billing country. Use the two-character ISO Standard Country Codes. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `bill_country` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
27
+ attr_accessor :country
28
+
29
+ # Payment card billing city. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. For processor-specific information, see the `bill_city` field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
30
+ attr_accessor :locality
31
+
32
+ # Customer’s first name. This name must be the same as the name on the card. #### CyberSource Latin American Processing **Important** For an authorization request, CyberSource Latin American Processing concatenates `orderInformation.billTo.firstName` and `orderInformation.billTo.lastName`. If the concatenated value exceeds 30 characters, CyberSource Latin American Processing declines the authorization request.\\ **Note** CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called _CyberSource Latin American Processing_. It is not for any other Latin American processors that CyberSource supports. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. #### For Payouts: This field may be sent only for FDC Compass. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `customer_firstname` request-level field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
33
+ attr_accessor :first_name
34
+
35
+ # Customer’s last name. This name must be the same as the name on the card. #### CyberSource Latin American Processing **Important** For an authorization request, CyberSource Latin American Processing concatenates `orderInformation.billTo.firstName` and `orderInformation.billTo.lastName`. If the concatenated value exceeds 30 characters, CyberSource Latin American Processing declines the authorization request.\\ **Note** CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called CyberSource Latin American Processing. It is not for any other Latin American processors that CyberSource supports. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. #### For Payouts: This field may be sent only for FDC Compass. For processor-specific information, see the `customer_lastname` request-level field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
36
+ attr_accessor :last_name
37
+
38
+ # Customer’s phone number. #### For Payouts: This field may be sent only for FDC Compass. CyberSource recommends that you include the country code when the order is from outside the U.S. For processor-specific information, see the customer_phone field in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html) #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.
39
+ attr_accessor :phone_number
40
+
41
+ # Customer's email address, including the full domain name. #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. For processor-specific information, see the `customer_email` request-level field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html) #### Invoicing Email address for the customer for sending the invoice. If the invoice is in SENT status and email is updated, the old email customer payment link won't work and you must resend the invoice with the new payment link.
42
+ attr_accessor :email
43
+
44
+ # Postal code for the billing address. The postal code must consist of 5 to 9 digits. When the billing country is the U.S., the 9-digit postal code must follow this format: [5 digits][dash][4 digits] **Example** `12345-6789` When the billing country is Canada, the 6-digit postal code must follow this format: [alpha][numeric][alpha][space][numeric][alpha][numeric] **Example** `A1B 2C3` **Important** It is your responsibility to determine whether a field is required for the transaction you are requesting. #### For Payouts: This field may be sent only for FDC Compass. #### American Express Direct Before sending the postal code to the processor, CyberSource removes all nonalphanumeric characters and, if the remaining value is longer than nine characters, truncates the value starting from the right side. #### Atos This field must not contain colons (:). #### CyberSource through VisaNet Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. For processor-specific information, see the `bill_zip` request-level field description in [Credit Card Services Using the SCMP API.](http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SCMP_API/html)
45
+ attr_accessor :postal_code
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'address1' => :'address1',
51
+ :'address2' => :'address2',
52
+ :'administrative_area' => :'administrativeArea',
53
+ :'country' => :'country',
54
+ :'locality' => :'locality',
55
+ :'first_name' => :'firstName',
56
+ :'last_name' => :'lastName',
57
+ :'phone_number' => :'phoneNumber',
58
+ :'email' => :'email',
59
+ :'postal_code' => :'postalCode'
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ :'address1' => :'String',
67
+ :'address2' => :'String',
68
+ :'administrative_area' => :'String',
69
+ :'country' => :'String',
70
+ :'locality' => :'String',
71
+ :'first_name' => :'String',
72
+ :'last_name' => :'String',
73
+ :'phone_number' => :'String',
74
+ :'email' => :'String',
75
+ :'postal_code' => :'String'
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?(:'address1')
88
+ self.address1 = attributes[:'address1']
89
+ end
90
+
91
+ if attributes.has_key?(:'address2')
92
+ self.address2 = attributes[:'address2']
93
+ end
94
+
95
+ if attributes.has_key?(:'administrativeArea')
96
+ self.administrative_area = attributes[:'administrativeArea']
97
+ end
98
+
99
+ if attributes.has_key?(:'country')
100
+ self.country = attributes[:'country']
101
+ end
102
+
103
+ if attributes.has_key?(:'locality')
104
+ self.locality = attributes[:'locality']
105
+ end
106
+
107
+ if attributes.has_key?(:'firstName')
108
+ self.first_name = attributes[:'firstName']
109
+ end
110
+
111
+ if attributes.has_key?(:'lastName')
112
+ self.last_name = attributes[:'lastName']
113
+ end
114
+
115
+ if attributes.has_key?(:'phoneNumber')
116
+ self.phone_number = attributes[:'phoneNumber']
117
+ end
118
+
119
+ if attributes.has_key?(:'email')
120
+ self.email = attributes[:'email']
121
+ end
122
+
123
+ if attributes.has_key?(:'postalCode')
124
+ self.postal_code = attributes[:'postalCode']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ if @address1.nil?
133
+ invalid_properties.push('invalid value for "address1", address1 cannot be nil.')
134
+ end
135
+
136
+ if @address1.to_s.length > 60
137
+ invalid_properties.push('invalid value for "address1", the character length must be smaller than or equal to 60.')
138
+ end
139
+
140
+ if !@address2.nil? && @address2.to_s.length > 60
141
+ invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 60.')
142
+ end
143
+
144
+ if @administrative_area.nil?
145
+ invalid_properties.push('invalid value for "administrative_area", administrative_area cannot be nil.')
146
+ end
147
+
148
+ if @administrative_area.to_s.length > 20
149
+ invalid_properties.push('invalid value for "administrative_area", the character length must be smaller than or equal to 20.')
150
+ end
151
+
152
+ if @country.nil?
153
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
154
+ end
155
+
156
+ if @country.to_s.length > 2
157
+ invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.')
158
+ end
159
+
160
+ if @locality.nil?
161
+ invalid_properties.push('invalid value for "locality", locality cannot be nil.')
162
+ end
163
+
164
+ if @locality.to_s.length > 50
165
+ invalid_properties.push('invalid value for "locality", the character length must be smaller than or equal to 50.')
166
+ end
167
+
168
+ if @first_name.nil?
169
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
170
+ end
171
+
172
+ if @first_name.to_s.length > 60
173
+ invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 60.')
174
+ end
175
+
176
+ if @last_name.nil?
177
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
178
+ end
179
+
180
+ if @last_name.to_s.length > 60
181
+ invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 60.')
182
+ end
183
+
184
+ if !@phone_number.nil? && @phone_number.to_s.length > 15
185
+ invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 15.')
186
+ end
187
+
188
+ if @email.nil?
189
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
190
+ end
191
+
192
+ if @email.to_s.length > 255
193
+ invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.')
194
+ end
195
+
196
+ if @postal_code.nil?
197
+ invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
198
+ end
199
+
200
+ if @postal_code.to_s.length > 10
201
+ invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 10.')
202
+ end
203
+
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ return false if @address1.nil?
211
+ return false if @address1.to_s.length > 60
212
+ return false if !@address2.nil? && @address2.to_s.length > 60
213
+ return false if @administrative_area.nil?
214
+ return false if @administrative_area.to_s.length > 20
215
+ return false if @country.nil?
216
+ return false if @country.to_s.length > 2
217
+ return false if @locality.nil?
218
+ return false if @locality.to_s.length > 50
219
+ return false if @first_name.nil?
220
+ return false if @first_name.to_s.length > 60
221
+ return false if @last_name.nil?
222
+ return false if @last_name.to_s.length > 60
223
+ return false if !@phone_number.nil? && @phone_number.to_s.length > 15
224
+ return false if @email.nil?
225
+ return false if @email.to_s.length > 255
226
+ return false if @postal_code.nil?
227
+ return false if @postal_code.to_s.length > 10
228
+ true
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] address1 Value to be assigned
233
+ def address1=(address1)
234
+ if address1.nil?
235
+ fail ArgumentError, 'address1 cannot be nil'
236
+ end
237
+
238
+ if address1.to_s.length > 60
239
+ fail ArgumentError, 'invalid value for "address1", the character length must be smaller than or equal to 60.'
240
+ end
241
+
242
+ @address1 = address1
243
+ end
244
+
245
+ # Custom attribute writer method with validation
246
+ # @param [Object] address2 Value to be assigned
247
+ def address2=(address2)
248
+ if !address2.nil? && address2.to_s.length > 60
249
+ fail ArgumentError, 'invalid value for "address2", the character length must be smaller than or equal to 60.'
250
+ end
251
+
252
+ @address2 = address2
253
+ end
254
+
255
+ # Custom attribute writer method with validation
256
+ # @param [Object] administrative_area Value to be assigned
257
+ def administrative_area=(administrative_area)
258
+ if administrative_area.nil?
259
+ fail ArgumentError, 'administrative_area cannot be nil'
260
+ end
261
+
262
+ if administrative_area.to_s.length > 20
263
+ fail ArgumentError, 'invalid value for "administrative_area", the character length must be smaller than or equal to 20.'
264
+ end
265
+
266
+ @administrative_area = administrative_area
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] country Value to be assigned
271
+ def country=(country)
272
+ if country.nil?
273
+ fail ArgumentError, 'country cannot be nil'
274
+ end
275
+
276
+ if country.to_s.length > 2
277
+ fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.'
278
+ end
279
+
280
+ @country = country
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] locality Value to be assigned
285
+ def locality=(locality)
286
+ if locality.nil?
287
+ fail ArgumentError, 'locality cannot be nil'
288
+ end
289
+
290
+ if locality.to_s.length > 50
291
+ fail ArgumentError, 'invalid value for "locality", the character length must be smaller than or equal to 50.'
292
+ end
293
+
294
+ @locality = locality
295
+ end
296
+
297
+ # Custom attribute writer method with validation
298
+ # @param [Object] first_name Value to be assigned
299
+ def first_name=(first_name)
300
+ if first_name.nil?
301
+ fail ArgumentError, 'first_name cannot be nil'
302
+ end
303
+
304
+ if first_name.to_s.length > 60
305
+ fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 60.'
306
+ end
307
+
308
+ @first_name = first_name
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] last_name Value to be assigned
313
+ def last_name=(last_name)
314
+ if last_name.nil?
315
+ fail ArgumentError, 'last_name cannot be nil'
316
+ end
317
+
318
+ if last_name.to_s.length > 60
319
+ fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 60.'
320
+ end
321
+
322
+ @last_name = last_name
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] phone_number Value to be assigned
327
+ def phone_number=(phone_number)
328
+ if !phone_number.nil? && phone_number.to_s.length > 15
329
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 15.'
330
+ end
331
+
332
+ @phone_number = phone_number
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] email Value to be assigned
337
+ def email=(email)
338
+ if email.nil?
339
+ fail ArgumentError, 'email cannot be nil'
340
+ end
341
+
342
+ if email.to_s.length > 255
343
+ fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 255.'
344
+ end
345
+
346
+ @email = email
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] postal_code Value to be assigned
351
+ def postal_code=(postal_code)
352
+ if postal_code.nil?
353
+ fail ArgumentError, 'postal_code cannot be nil'
354
+ end
355
+
356
+ if postal_code.to_s.length > 10
357
+ fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 10.'
358
+ end
359
+
360
+ @postal_code = postal_code
361
+ end
362
+
363
+ # Checks equality by comparing each attribute.
364
+ # @param [Object] Object to be compared
365
+ def ==(o)
366
+ return true if self.equal?(o)
367
+ self.class == o.class &&
368
+ address1 == o.address1 &&
369
+ address2 == o.address2 &&
370
+ administrative_area == o.administrative_area &&
371
+ country == o.country &&
372
+ locality == o.locality &&
373
+ first_name == o.first_name &&
374
+ last_name == o.last_name &&
375
+ phone_number == o.phone_number &&
376
+ email == o.email &&
377
+ postal_code == o.postal_code
378
+ end
379
+
380
+ # @see the `==` method
381
+ # @param [Object] Object to be compared
382
+ def eql?(o)
383
+ self == o
384
+ end
385
+
386
+ # Calculates hash code according to all attributes.
387
+ # @return [Fixnum] Hash code
388
+ def hash
389
+ [address1, address2, administrative_area, country, locality, first_name, last_name, phone_number, email, postal_code].hash
390
+ end
391
+
392
+ # Builds the object from hash
393
+ # @param [Hash] attributes Model attributes in the form of hash
394
+ # @return [Object] Returns the model itself
395
+ def build_from_hash(attributes)
396
+ return nil unless attributes.is_a?(Hash)
397
+ self.class.swagger_types.each_pair do |key, type|
398
+ if type =~ /\AArray<(.*)>/i
399
+ # check to ensure the input is an array given that the the attribute
400
+ # is documented as an array but the input is not
401
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
402
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
403
+ end
404
+ elsif !attributes[self.class.attribute_map[key]].nil?
405
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
406
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
407
+ end
408
+
409
+ self
410
+ end
411
+
412
+ # Deserializes the data based on type
413
+ # @param string type Data type
414
+ # @param string value Value to be deserialized
415
+ # @return [Object] Deserialized data
416
+ def _deserialize(type, value)
417
+ case type.to_sym
418
+ when :DateTime
419
+ DateTime.parse(value)
420
+ when :Date
421
+ Date.parse(value)
422
+ when :String
423
+ value.to_s
424
+ when :Integer
425
+ value.to_i
426
+ when :Float
427
+ value.to_f
428
+ when :BOOLEAN
429
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
430
+ true
431
+ else
432
+ false
433
+ end
434
+ when :Object
435
+ # generic object (usually a Hash), return directly
436
+ value
437
+ when /\AArray<(?<inner_type>.+)>\z/
438
+ inner_type = Regexp.last_match[:inner_type]
439
+ value.map { |v| _deserialize(inner_type, v) }
440
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
441
+ k_type = Regexp.last_match[:k_type]
442
+ v_type = Regexp.last_match[:v_type]
443
+ {}.tap do |hash|
444
+ value.each do |k, v|
445
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
446
+ end
447
+ end
448
+ else # model
449
+ temp_model = CyberSource.const_get(type).new
450
+ temp_model.build_from_hash(value)
451
+ end
452
+ end
453
+
454
+ # Returns the string representation of the object
455
+ # @return [String] String presentation of the object
456
+ def to_s
457
+ to_hash.to_s
458
+ end
459
+
460
+ # to_body is an alias to to_hash (backward compatibility)
461
+ # @return [Hash] Returns the object in the form of hash
462
+ def to_body
463
+ to_hash
464
+ end
465
+
466
+ # Returns the object in the form of hash
467
+ # @return [Hash] Returns the object in the form of hash
468
+ def to_hash
469
+ hash = {}
470
+ self.class.attribute_map.each_pair do |attr, param|
471
+ value = self.send(attr)
472
+ next if value.nil?
473
+ hash[param] = _to_hash(value)
474
+ end
475
+ hash
476
+ end
477
+
478
+ # Outputs non-array value in the form of hash
479
+ # For object, use to_hash. Otherwise, just return the value
480
+ # @param [Object] value Any valid value
481
+ # @return [Hash] Returns the value in the form of hash
482
+ def _to_hash(value)
483
+ if value.is_a?(Array)
484
+ value.compact.map { |v| _to_hash(v) }
485
+ elsif value.is_a?(Hash)
486
+ {}.tap do |hash|
487
+ value.each { |k, v| hash[k] = _to_hash(v) }
488
+ end
489
+ elsif value.respond_to? :to_hash
490
+ value.to_hash
491
+ else
492
+ value
493
+ end
494
+ end
495
+ end
496
+ end