cybersource_rest_client 0.0.73 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/batches_api.rb +9 -9
  3. data/lib/cybersource_rest_client/api/device_de_association_api.rb +168 -0
  4. data/lib/cybersource_rest_client/api/device_search_api.rb +78 -5
  5. data/lib/cybersource_rest_client/api/subscriptions_api.rb +5 -2
  6. data/lib/cybersource_rest_client/models/{inline_response_200_7__links.rb → de_association_request_body.rb} +190 -200
  7. data/lib/cybersource_rest_client/models/generate_capture_context_request.rb +240 -240
  8. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +303 -303
  9. data/lib/cybersource_rest_client/models/get_subscription_response.rb +267 -257
  10. data/lib/cybersource_rest_client/models/get_subscription_response_reactivation_information.rb +213 -0
  11. data/lib/cybersource_rest_client/models/inline_response_200_10.rb +292 -0
  12. data/lib/cybersource_rest_client/models/{inline_response_200_9_records.rb → inline_response_200_10_records.rb} +209 -209
  13. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record.rb → inline_response_200_10_response_record.rb} +307 -307
  14. data/lib/cybersource_rest_client/models/{inline_response_200_9_response_record_additional_updates.rb → inline_response_200_10_response_record_additional_updates.rb} +242 -242
  15. data/lib/cybersource_rest_client/models/{inline_response_200_9_source_record.rb → inline_response_200_10_source_record.rb} +295 -295
  16. data/lib/cybersource_rest_client/models/inline_response_200_5.rb +247 -202
  17. data/lib/cybersource_rest_client/models/inline_response_200_5_devices.rb +357 -0
  18. data/lib/cybersource_rest_client/models/inline_response_200_6.rb +202 -247
  19. data/lib/cybersource_rest_client/models/inline_response_200_7.rb +247 -251
  20. data/lib/cybersource_rest_client/models/{inline_response_200_6_devices.rb → inline_response_200_7_devices.rb} +371 -371
  21. data/lib/cybersource_rest_client/models/{inline_response_200_6_payment_processor_to_terminal_map.rb → inline_response_200_7_payment_processor_to_terminal_map.rb} +200 -200
  22. data/lib/cybersource_rest_client/models/inline_response_200_8.rb +251 -290
  23. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded.rb → inline_response_200_8__embedded.rb} +191 -191
  24. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links.rb → inline_response_200_8__embedded__links.rb} +191 -191
  25. data/lib/cybersource_rest_client/models/{inline_response_200_8__links_report.rb → inline_response_200_8__embedded__links_reports.rb} +190 -189
  26. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_batches.rb → inline_response_200_8__embedded_batches.rb} +295 -295
  27. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded_totals.rb → inline_response_200_8__embedded_totals.rb} +229 -229
  28. data/lib/cybersource_rest_client/models/inline_response_200_8__links.rb +200 -201
  29. data/lib/cybersource_rest_client/models/inline_response_200_9.rb +290 -292
  30. data/lib/cybersource_rest_client/models/inline_response_200_9__links.rb +201 -0
  31. data/lib/cybersource_rest_client/models/{inline_response_200_7__embedded__links_reports.rb → inline_response_200_9__links_report.rb} +189 -190
  32. data/lib/cybersource_rest_client/models/{inline_response_200_8_billing.rb → inline_response_200_9_billing.rb} +219 -219
  33. data/lib/cybersource_rest_client/models/payments_products.rb +379 -379
  34. data/lib/cybersource_rest_client/models/payments_products_unified_checkout.rb +199 -0
  35. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information.rb +189 -0
  36. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations.rb +189 -0
  37. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features.rb +189 -0
  38. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_configuration_information_configurations_features_paze.rb +213 -0
  39. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information.rb +225 -0
  40. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features.rb +189 -0
  41. data/lib/cybersource_rest_client/models/payments_products_unified_checkout_subscription_information_features_paze_for_unified_checkout.rb +190 -0
  42. data/lib/cybersource_rest_client/models/post_device_search_request.rb +223 -0
  43. data/lib/cybersource_rest_client/models/riskv1decisions_travel_information_legs.rb +252 -241
  44. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_processor_information.rb +394 -383
  45. data/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb +297 -286
  46. data/lib/cybersource_rest_client/models/upv1capturecontexts_complete_mandate.rb +219 -208
  47. data/lib/cybersource_rest_client.rb +28 -15
  48. metadata +30 -17
  49. data/lib/cybersource_rest_client/api/device_de_association_v3_api.rb +0 -96
@@ -1,286 +1,297 @@
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.4.38
10
- =end
11
-
12
- require 'date'
13
-
14
- module CyberSource
15
- class Upv1capturecontextsCaptureMandate
16
- # Configure Unified Checkout to capture billing address information. Possible values: - FULL: Capture complete billing address information. - PARTIAL: Capture first name, last name, country and postal/zip code only. - NONE: Capture only first name and last name.
17
- attr_accessor :billing_type
18
-
19
- # Configure Unified Checkout to capture customer email address. Possible values: - True - False
20
- attr_accessor :request_email
21
-
22
- # Configure Unified Checkout to capture customer phone number. Possible values: - True - False
23
- attr_accessor :request_phone
24
-
25
- # Configure Unified Checkout to capture customer shipping details. Possible values: - True - False
26
- attr_accessor :request_shipping
27
-
28
- # List of countries available to ship to. Use the two-character ISO Standard Country Codes.
29
- attr_accessor :ship_to_countries
30
-
31
- # Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False
32
- attr_accessor :show_accepted_network_icons
33
-
34
- # Configure Unified Checkout to display the \"Save card for future use\" checkbox.<br> Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.<br> Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False<br><br> **Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.<br><br> **Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details.
35
- attr_accessor :request_save_card
36
-
37
- # Configure Unified Checkout to display combo card at checkout.<br> A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False<br><br> **Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout <br><br> **Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout.
38
- attr_accessor :combo_card
39
-
40
- # Configure Unified Checkout to display and capture the CPF number (Cadastro de Pessoas Físicas). The CPF number is a unique 11-digit identifier issued to Brazilian citizens and residents for tax purposes. Possible values: - True - False<br><br> This field is optional. If set to true the field is required. If set to false the field is optional. If the field is not included in the capture context then it is not captured.<br><br> **Important:** - If PANENTRY is specified in the allowedPaymentTypes field, the CPF number will be displayed in Unified Checkout regardless of what card number is entered. - If CLICKTOPAY is specified in the allowedPaymentTypes field, the CPF number will be displayed in Unified Checkout only when a Visa Click To Pay card is entered.
41
- attr_accessor :cpf
42
-
43
- # Attribute mapping from ruby-style variable name to JSON key.
44
- def self.attribute_map
45
- {
46
- :'billing_type' => :'billingType',
47
- :'request_email' => :'requestEmail',
48
- :'request_phone' => :'requestPhone',
49
- :'request_shipping' => :'requestShipping',
50
- :'ship_to_countries' => :'shipToCountries',
51
- :'show_accepted_network_icons' => :'showAcceptedNetworkIcons',
52
- :'request_save_card' => :'requestSaveCard',
53
- :'combo_card' => :'comboCard',
54
- :'cpf' => :'CPF'
55
- }
56
- end
57
-
58
- # Attribute mapping from JSON key to ruby-style variable name.
59
- def self.json_map
60
- {
61
- :'billing_type' => :'billing_type',
62
- :'request_email' => :'request_email',
63
- :'request_phone' => :'request_phone',
64
- :'request_shipping' => :'request_shipping',
65
- :'ship_to_countries' => :'ship_to_countries',
66
- :'show_accepted_network_icons' => :'show_accepted_network_icons',
67
- :'request_save_card' => :'request_save_card',
68
- :'combo_card' => :'combo_card',
69
- :'cpf' => :'cpf'
70
- }
71
- end
72
-
73
- # Attribute type mapping.
74
- def self.swagger_types
75
- {
76
- :'billing_type' => :'String',
77
- :'request_email' => :'BOOLEAN',
78
- :'request_phone' => :'BOOLEAN',
79
- :'request_shipping' => :'BOOLEAN',
80
- :'ship_to_countries' => :'Array<String>',
81
- :'show_accepted_network_icons' => :'BOOLEAN',
82
- :'request_save_card' => :'BOOLEAN',
83
- :'combo_card' => :'BOOLEAN',
84
- :'cpf' => :'BOOLEAN'
85
- }
86
- end
87
-
88
- # Initializes the object
89
- # @param [Hash] attributes Model attributes in the form of hash
90
- def initialize(attributes = {})
91
- return unless attributes.is_a?(Hash)
92
-
93
- # convert string to symbol for hash key
94
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
-
96
- if attributes.has_key?(:'billingType')
97
- self.billing_type = attributes[:'billingType']
98
- end
99
-
100
- if attributes.has_key?(:'requestEmail')
101
- self.request_email = attributes[:'requestEmail']
102
- end
103
-
104
- if attributes.has_key?(:'requestPhone')
105
- self.request_phone = attributes[:'requestPhone']
106
- end
107
-
108
- if attributes.has_key?(:'requestShipping')
109
- self.request_shipping = attributes[:'requestShipping']
110
- end
111
-
112
- if attributes.has_key?(:'shipToCountries')
113
- if (value = attributes[:'shipToCountries']).is_a?(Array)
114
- self.ship_to_countries = value
115
- end
116
- end
117
-
118
- if attributes.has_key?(:'showAcceptedNetworkIcons')
119
- self.show_accepted_network_icons = attributes[:'showAcceptedNetworkIcons']
120
- end
121
-
122
- if attributes.has_key?(:'requestSaveCard')
123
- self.request_save_card = attributes[:'requestSaveCard']
124
- end
125
-
126
- if attributes.has_key?(:'comboCard')
127
- self.combo_card = attributes[:'comboCard']
128
- end
129
-
130
- if attributes.has_key?(:'CPF')
131
- self.cpf = attributes[:'CPF']
132
- end
133
- end
134
-
135
- # Show invalid properties with the reasons. Usually used together with valid?
136
- # @return Array for valid properties with the reasons
137
- def list_invalid_properties
138
- invalid_properties = Array.new
139
- invalid_properties
140
- end
141
-
142
- # Check to see if the all the properties in the model are valid
143
- # @return true if the model is valid
144
- def valid?
145
- true
146
- end
147
-
148
- # Custom attribute writer method with validation
149
- # @param [Object] billing_type Value to be assigned
150
- def billing_type=(billing_type)
151
- @billing_type = billing_type
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- billing_type == o.billing_type &&
160
- request_email == o.request_email &&
161
- request_phone == o.request_phone &&
162
- request_shipping == o.request_shipping &&
163
- ship_to_countries == o.ship_to_countries &&
164
- show_accepted_network_icons == o.show_accepted_network_icons &&
165
- request_save_card == o.request_save_card &&
166
- combo_card == o.combo_card &&
167
- cpf == o.cpf
168
- end
169
-
170
- # @see the `==` method
171
- # @param [Object] Object to be compared
172
- def eql?(o)
173
- self == o
174
- end
175
-
176
- # Calculates hash code according to all attributes.
177
- # @return [Fixnum] Hash code
178
- def hash
179
- [billing_type, request_email, request_phone, request_shipping, ship_to_countries, show_accepted_network_icons, request_save_card, combo_card, cpf].hash
180
- end
181
-
182
- # Builds the object from hash
183
- # @param [Hash] attributes Model attributes in the form of hash
184
- # @return [Object] Returns the model itself
185
- def build_from_hash(attributes)
186
- return nil unless attributes.is_a?(Hash)
187
- self.class.swagger_types.each_pair do |key, type|
188
- if type =~ /\AArray<(.*)>/i
189
- # check to ensure the input is an array given that the the attribute
190
- # is documented as an array but the input is not
191
- if attributes[self.class.attribute_map[key]].is_a?(Array)
192
- self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
- end
194
- elsif !attributes[self.class.attribute_map[key]].nil?
195
- self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
- end # or else data not found in attributes(hash), not an issue as the data can be optional
197
- end
198
-
199
- self
200
- end
201
-
202
- # Deserializes the data based on type
203
- # @param string type Data type
204
- # @param string value Value to be deserialized
205
- # @return [Object] Deserialized data
206
- def _deserialize(type, value)
207
- case type.to_sym
208
- when :DateTime
209
- DateTime.parse(value)
210
- when :Date
211
- Date.parse(value)
212
- when :String
213
- value.to_s
214
- when :Integer
215
- value.to_i
216
- when :Float
217
- value.to_f
218
- when :BOOLEAN
219
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
- true
221
- else
222
- false
223
- end
224
- when :Object
225
- # generic object (usually a Hash), return directly
226
- value
227
- when /\AArray<(?<inner_type>.+)>\z/
228
- inner_type = Regexp.last_match[:inner_type]
229
- value.map { |v| _deserialize(inner_type, v) }
230
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
- k_type = Regexp.last_match[:k_type]
232
- v_type = Regexp.last_match[:v_type]
233
- {}.tap do |hash|
234
- value.each do |k, v|
235
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
- end
237
- end
238
- else # model
239
- temp_model = CyberSource.const_get(type).new
240
- temp_model.build_from_hash(value)
241
- end
242
- end
243
-
244
- # Returns the string representation of the object
245
- # @return [String] String presentation of the object
246
- def to_s
247
- to_hash.to_s
248
- end
249
-
250
- # to_body is an alias to to_hash (backward compatibility)
251
- # @return [Hash] Returns the object in the form of hash
252
- def to_body
253
- to_hash
254
- end
255
-
256
- # Returns the object in the form of hash
257
- # @return [Hash] Returns the object in the form of hash
258
- def to_hash
259
- hash = {}
260
- self.class.attribute_map.each_pair do |attr, param|
261
- value = self.send(attr)
262
- next if value.nil?
263
- hash[param] = _to_hash(value)
264
- end
265
- hash
266
- end
267
-
268
- # Outputs non-array value in the form of hash
269
- # For object, use to_hash. Otherwise, just return the value
270
- # @param [Object] value Any valid value
271
- # @return [Hash] Returns the value in the form of hash
272
- def _to_hash(value)
273
- if value.is_a?(Array)
274
- value.compact.map { |v| _to_hash(v) }
275
- elsif value.is_a?(Hash)
276
- {}.tap do |hash|
277
- value.each { |k, v| hash[k] = _to_hash(v) }
278
- end
279
- elsif value.respond_to? :to_hash
280
- value.to_hash
281
- else
282
- value
283
- end
284
- end
285
- end
286
- end
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.4.38
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module CyberSource
15
+ class Upv1capturecontextsCaptureMandate
16
+ # Configure Unified Checkout to capture billing address information. Possible values: - FULL: Capture complete billing address information. - PARTIAL: Capture first name, last name, country and postal/zip code only. - NONE: Capture only first name and last name.
17
+ attr_accessor :billing_type
18
+
19
+ # Configure Unified Checkout to capture customer email address. Possible values: - True - False
20
+ attr_accessor :request_email
21
+
22
+ # Configure Unified Checkout to capture customer phone number. Possible values: - True - False
23
+ attr_accessor :request_phone
24
+
25
+ # Configure Unified Checkout to capture customer shipping details. Possible values: - True - False
26
+ attr_accessor :request_shipping
27
+
28
+ # List of countries available to ship to. Use the two-character ISO Standard Country Codes.
29
+ attr_accessor :ship_to_countries
30
+
31
+ # Configure Unified Checkout to display the list of accepted card networks beneath the payment button Possible values: - True - False
32
+ attr_accessor :show_accepted_network_icons
33
+
34
+ # Configure Unified Checkout to display the final confirmation screen when using Click to Pay.<br> Where 'BillingType'= NONE and 'requestShipping'= FALSE and the customer is using an existing Click to Pay card as their chosen payment method, a final confirmation screen can be removed allowing the customer to check out as soon as they have selected their payment method from within their Click to Pay card tray. Possible values: - True - False
35
+ attr_accessor :show_confirmation_step
36
+
37
+ # Configure Unified Checkout to display the \"Save card for future use\" checkbox.<br> Configurable check box that will show in a Manual card entry flow to allow a Cardholder to give consent to store their manually entered credential with the Merchant that they are paying.<br> Applicable when manually entering the details and not enrolling in Click to Pay. Possible values: - True - False<br><br> **Use Cases:** **Offer consumers option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to true. - When set to true, this will show a checkbox with the message 'Save card for future use' in Unified Checkout. - When selected this provides a response in both the Transient Token and Get Credentials API response.<br><br> **Do not offer consumers the option to save their card in Unified Checkout:** - Include the captureMandate.requestSaveCard field in the capture context request and set it to false OR omit the field from the capture context request. - When set to false, the save card option is not shown to consumers when manually entering card details.
38
+ attr_accessor :request_save_card
39
+
40
+ # Configure Unified Checkout to display combo card at checkout.<br> A combo debit/credit card is a single card that functions both as a Debit/Credit card. Unified Checkout / Click to Pay Drop-in UI allows the Cardholder to choose whether they would like the transaction to be paid for using either debit or credit card. **Important:** This is applicable to Visa cards only. Possible values: - True - False<br><br> **Use Cases:** **Offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to true. - When set to true, Combo Card selection is shown at checkout <br><br> **Do not offer Combo Card at Checkout:** - Include the captureMandate.comboCard field in the capture context request and set it to false OR omit the field from the capture context request. - The Combo Card selection is not shown at checkout.
41
+ attr_accessor :combo_card
42
+
43
+ # Configure Unified Checkout to display and capture the CPF number (Cadastro de Pessoas Físicas). The CPF number is a unique 11-digit identifier issued to Brazilian citizens and residents for tax purposes. Possible values: - True - False<br><br> This field is optional. If set to true the field is required. If set to false the field is optional. If the field is not included in the capture context then it is not captured.<br><br> **Important:** - If PANENTRY is specified in the allowedPaymentTypes field, the CPF number will be displayed in Unified Checkout regardless of what card number is entered. - If CLICKTOPAY is specified in the allowedPaymentTypes field, the CPF number will be displayed in Unified Checkout only when a Visa Click To Pay card is entered.
44
+ attr_accessor :cpf
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'billing_type' => :'billingType',
50
+ :'request_email' => :'requestEmail',
51
+ :'request_phone' => :'requestPhone',
52
+ :'request_shipping' => :'requestShipping',
53
+ :'ship_to_countries' => :'shipToCountries',
54
+ :'show_accepted_network_icons' => :'showAcceptedNetworkIcons',
55
+ :'show_confirmation_step' => :'showConfirmationStep',
56
+ :'request_save_card' => :'requestSaveCard',
57
+ :'combo_card' => :'comboCard',
58
+ :'cpf' => :'CPF'
59
+ }
60
+ end
61
+
62
+ # Attribute mapping from JSON key to ruby-style variable name.
63
+ def self.json_map
64
+ {
65
+ :'billing_type' => :'billing_type',
66
+ :'request_email' => :'request_email',
67
+ :'request_phone' => :'request_phone',
68
+ :'request_shipping' => :'request_shipping',
69
+ :'ship_to_countries' => :'ship_to_countries',
70
+ :'show_accepted_network_icons' => :'show_accepted_network_icons',
71
+ :'show_confirmation_step' => :'show_confirmation_step',
72
+ :'request_save_card' => :'request_save_card',
73
+ :'combo_card' => :'combo_card',
74
+ :'cpf' => :'cpf'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ :'billing_type' => :'String',
82
+ :'request_email' => :'BOOLEAN',
83
+ :'request_phone' => :'BOOLEAN',
84
+ :'request_shipping' => :'BOOLEAN',
85
+ :'ship_to_countries' => :'Array<String>',
86
+ :'show_accepted_network_icons' => :'BOOLEAN',
87
+ :'show_confirmation_step' => :'BOOLEAN',
88
+ :'request_save_card' => :'BOOLEAN',
89
+ :'combo_card' => :'BOOLEAN',
90
+ :'cpf' => :'BOOLEAN'
91
+ }
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ return unless attributes.is_a?(Hash)
98
+
99
+ # convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
101
+
102
+ if attributes.has_key?(:'billingType')
103
+ self.billing_type = attributes[:'billingType']
104
+ end
105
+
106
+ if attributes.has_key?(:'requestEmail')
107
+ self.request_email = attributes[:'requestEmail']
108
+ end
109
+
110
+ if attributes.has_key?(:'requestPhone')
111
+ self.request_phone = attributes[:'requestPhone']
112
+ end
113
+
114
+ if attributes.has_key?(:'requestShipping')
115
+ self.request_shipping = attributes[:'requestShipping']
116
+ end
117
+
118
+ if attributes.has_key?(:'shipToCountries')
119
+ if (value = attributes[:'shipToCountries']).is_a?(Array)
120
+ self.ship_to_countries = value
121
+ end
122
+ end
123
+
124
+ if attributes.has_key?(:'showAcceptedNetworkIcons')
125
+ self.show_accepted_network_icons = attributes[:'showAcceptedNetworkIcons']
126
+ end
127
+
128
+ if attributes.has_key?(:'showConfirmationStep')
129
+ self.show_confirmation_step = attributes[:'showConfirmationStep']
130
+ end
131
+
132
+ if attributes.has_key?(:'requestSaveCard')
133
+ self.request_save_card = attributes[:'requestSaveCard']
134
+ end
135
+
136
+ if attributes.has_key?(:'comboCard')
137
+ self.combo_card = attributes[:'comboCard']
138
+ end
139
+
140
+ if attributes.has_key?(:'CPF')
141
+ self.cpf = attributes[:'CPF']
142
+ end
143
+ end
144
+
145
+ # Show invalid properties with the reasons. Usually used together with valid?
146
+ # @return Array for valid properties with the reasons
147
+ def list_invalid_properties
148
+ invalid_properties = Array.new
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] billing_type Value to be assigned
160
+ def billing_type=(billing_type)
161
+ @billing_type = billing_type
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ billing_type == o.billing_type &&
170
+ request_email == o.request_email &&
171
+ request_phone == o.request_phone &&
172
+ request_shipping == o.request_shipping &&
173
+ ship_to_countries == o.ship_to_countries &&
174
+ show_accepted_network_icons == o.show_accepted_network_icons &&
175
+ show_confirmation_step == o.show_confirmation_step &&
176
+ request_save_card == o.request_save_card &&
177
+ combo_card == o.combo_card &&
178
+ cpf == o.cpf
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Fixnum] Hash code
189
+ def hash
190
+ [billing_type, request_email, request_phone, request_shipping, ship_to_countries, show_accepted_network_icons, show_confirmation_step, request_save_card, combo_card, cpf].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ self.class.swagger_types.each_pair do |key, type|
199
+ if type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
203
+ self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
204
+ end
205
+ elsif !attributes[self.class.attribute_map[key]].nil?
206
+ self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
207
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
208
+ end
209
+
210
+ self
211
+ end
212
+
213
+ # Deserializes the data based on type
214
+ # @param string type Data type
215
+ # @param string value Value to be deserialized
216
+ # @return [Object] Deserialized data
217
+ def _deserialize(type, value)
218
+ case type.to_sym
219
+ when :DateTime
220
+ DateTime.parse(value)
221
+ when :Date
222
+ Date.parse(value)
223
+ when :String
224
+ value.to_s
225
+ when :Integer
226
+ value.to_i
227
+ when :Float
228
+ value.to_f
229
+ when :BOOLEAN
230
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
231
+ true
232
+ else
233
+ false
234
+ end
235
+ when :Object
236
+ # generic object (usually a Hash), return directly
237
+ value
238
+ when /\AArray<(?<inner_type>.+)>\z/
239
+ inner_type = Regexp.last_match[:inner_type]
240
+ value.map { |v| _deserialize(inner_type, v) }
241
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
242
+ k_type = Regexp.last_match[:k_type]
243
+ v_type = Regexp.last_match[:v_type]
244
+ {}.tap do |hash|
245
+ value.each do |k, v|
246
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
247
+ end
248
+ end
249
+ else # model
250
+ temp_model = CyberSource.const_get(type).new
251
+ temp_model.build_from_hash(value)
252
+ end
253
+ end
254
+
255
+ # Returns the string representation of the object
256
+ # @return [String] String presentation of the object
257
+ def to_s
258
+ to_hash.to_s
259
+ end
260
+
261
+ # to_body is an alias to to_hash (backward compatibility)
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_body
264
+ to_hash
265
+ end
266
+
267
+ # Returns the object in the form of hash
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_hash
270
+ hash = {}
271
+ self.class.attribute_map.each_pair do |attr, param|
272
+ value = self.send(attr)
273
+ next if value.nil?
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+ end
297
+ end