cybersource_rest_client 0.0.46 → 0.0.47

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cybersource_rest_client/api/emv_tag_details_api.rb +152 -0
  3. data/lib/cybersource_rest_client/api/transient_token_data_api.rb +92 -0
  4. data/lib/cybersource_rest_client/api/unified_checkout_capture_context_api.rb +88 -0
  5. data/lib/cybersource_rest_client/models/body.rb +216 -0
  6. data/lib/cybersource_rest_client/models/generate_unified_checkout_capture_context_request.rb +276 -0
  7. data/lib/cybersource_rest_client/models/inline_response_400_3.rb +265 -0
  8. data/lib/cybersource_rest_client/models/inline_response_400_3_details.rb +192 -0
  9. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_issuer_information.rb +52 -4
  10. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_issuer_information.rb +4 -20
  11. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response.rb +13 -4
  12. data/lib/cybersource_rest_client/models/pts_v2_payouts_post201_response_issuer_information.rb +190 -0
  13. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +1 -1
  14. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +1 -1
  15. data/lib/cybersource_rest_client/models/ptsv2payments_recurring_payment_information.rb +100 -4
  16. data/lib/cybersource_rest_client/models/tss_v2_get_emv_tags200_response.rb +186 -0
  17. data/lib/cybersource_rest_client/models/tss_v2_get_emv_tags200_response_emv_tag_breakdown_list.rb +215 -0
  18. data/lib/cybersource_rest_client/models/tss_v2_post_emv_tags200_response.rb +186 -0
  19. data/lib/cybersource_rest_client/models/tss_v2_post_emv_tags200_response_emv_tag_breakdown_list.rb +266 -0
  20. data/lib/cybersource_rest_client/models/tss_v2_post_emv_tags200_response_parsed_emv_tags_list.rb +212 -0
  21. data/lib/cybersource_rest_client/models/tssv2transactionsemv_tag_details_emv_details_list.rb +224 -0
  22. data/lib/cybersource_rest_client/models/upv1capturecontexts_capture_mandate.rb +242 -0
  23. data/lib/cybersource_rest_client/models/upv1capturecontexts_checkout_api_initialization.rb +264 -0
  24. data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information.rb +201 -0
  25. data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information_amount_details.rb +192 -0
  26. data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information_bill_to.rb +459 -0
  27. data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information_bill_to_company.rb +350 -0
  28. data/lib/cybersource_rest_client/models/upv1capturecontexts_order_information_ship_to.rb +354 -0
  29. data/lib/cybersource_rest_client.rb +21 -0
  30. metadata +45 -24
@@ -0,0 +1,276 @@
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 GenerateUnifiedCheckoutCaptureContextRequest
17
+ attr_accessor :target_origins
18
+
19
+ # verson number of Unified Checkout being used
20
+ attr_accessor :client_version
21
+
22
+ attr_accessor :allowed_card_networks
23
+
24
+ attr_accessor :allowed_payment_types
25
+
26
+ # Country the purchase is originating from (e.g. country of the merchant). Use the two- character ISO Standard
27
+ attr_accessor :country
28
+
29
+ # Localization of the User experience conforming to the ISO 639-1 language standards and two-character ISO Standard Country Code
30
+ attr_accessor :locale
31
+
32
+ attr_accessor :capture_mandate
33
+
34
+ attr_accessor :order_information
35
+
36
+ attr_accessor :checkout_api_initialization
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'target_origins' => :'targetOrigins',
42
+ :'client_version' => :'clientVersion',
43
+ :'allowed_card_networks' => :'allowedCardNetworks',
44
+ :'allowed_payment_types' => :'allowedPaymentTypes',
45
+ :'country' => :'country',
46
+ :'locale' => :'locale',
47
+ :'capture_mandate' => :'captureMandate',
48
+ :'order_information' => :'orderInformation',
49
+ :'checkout_api_initialization' => :'checkoutApiInitialization'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'target_origins' => :'Array<String>',
57
+ :'client_version' => :'String',
58
+ :'allowed_card_networks' => :'Array<String>',
59
+ :'allowed_payment_types' => :'Array<String>',
60
+ :'country' => :'String',
61
+ :'locale' => :'String',
62
+ :'capture_mandate' => :'Upv1capturecontextsCaptureMandate',
63
+ :'order_information' => :'Upv1capturecontextsOrderInformation',
64
+ :'checkout_api_initialization' => :'Upv1capturecontextsCheckoutApiInitialization'
65
+ }
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ return unless attributes.is_a?(Hash)
72
+
73
+ # convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
75
+
76
+ if attributes.has_key?(:'targetOrigins')
77
+ if (value = attributes[:'targetOrigins']).is_a?(Array)
78
+ self.target_origins = value
79
+ end
80
+ end
81
+
82
+ if attributes.has_key?(:'clientVersion')
83
+ self.client_version = attributes[:'clientVersion']
84
+ end
85
+
86
+ if attributes.has_key?(:'allowedCardNetworks')
87
+ if (value = attributes[:'allowedCardNetworks']).is_a?(Array)
88
+ self.allowed_card_networks = value
89
+ end
90
+ end
91
+
92
+ if attributes.has_key?(:'allowedPaymentTypes')
93
+ if (value = attributes[:'allowedPaymentTypes']).is_a?(Array)
94
+ self.allowed_payment_types = value
95
+ end
96
+ end
97
+
98
+ if attributes.has_key?(:'country')
99
+ self.country = attributes[:'country']
100
+ end
101
+
102
+ if attributes.has_key?(:'locale')
103
+ self.locale = attributes[:'locale']
104
+ end
105
+
106
+ if attributes.has_key?(:'captureMandate')
107
+ self.capture_mandate = attributes[:'captureMandate']
108
+ end
109
+
110
+ if attributes.has_key?(:'orderInformation')
111
+ self.order_information = attributes[:'orderInformation']
112
+ end
113
+
114
+ if attributes.has_key?(:'checkoutApiInitialization')
115
+ self.checkout_api_initialization = attributes[:'checkoutApiInitialization']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] client_version Value to be assigned
134
+ def client_version=(client_version)
135
+ @client_version = client_version
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] country Value to be assigned
140
+ def country=(country)
141
+ @country = country
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ target_origins == o.target_origins &&
150
+ client_version == o.client_version &&
151
+ allowed_card_networks == o.allowed_card_networks &&
152
+ allowed_payment_types == o.allowed_payment_types &&
153
+ country == o.country &&
154
+ locale == o.locale &&
155
+ capture_mandate == o.capture_mandate &&
156
+ order_information == o.order_information &&
157
+ checkout_api_initialization == o.checkout_api_initialization
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [target_origins, client_version, allowed_card_networks, allowed_payment_types, country, locale, capture_mandate, order_information, checkout_api_initialization].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :BOOLEAN
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ temp_model = CyberSource.const_get(type).new
230
+ temp_model.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ next if value.nil?
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,265 @@
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 InlineResponse4003
17
+ attr_accessor :correlation_id
18
+
19
+ attr_accessor :details
20
+
21
+ attr_accessor :information_link
22
+
23
+ attr_accessor :message
24
+
25
+ attr_accessor :reason
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'correlation_id' => :'correlationId',
53
+ :'details' => :'details',
54
+ :'information_link' => :'informationLink',
55
+ :'message' => :'message',
56
+ :'reason' => :'reason'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.swagger_types
62
+ {
63
+ :'correlation_id' => :'String',
64
+ :'details' => :'Array<InlineResponse4003Details>',
65
+ :'information_link' => :'String',
66
+ :'message' => :'String',
67
+ :'reason' => :'String'
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
+
79
+ if attributes.has_key?(:'correlationId')
80
+ self.correlation_id = attributes[:'correlationId']
81
+ end
82
+
83
+ if attributes.has_key?(:'details')
84
+ if (value = attributes[:'details']).is_a?(Array)
85
+ self.details = value
86
+ end
87
+ end
88
+
89
+ if attributes.has_key?(:'informationLink')
90
+ self.information_link = attributes[:'informationLink']
91
+ end
92
+
93
+ if attributes.has_key?(:'message')
94
+ self.message = attributes[:'message']
95
+ end
96
+
97
+ if attributes.has_key?(:'reason')
98
+ self.reason = attributes[:'reason']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @message.nil?
107
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
108
+ end
109
+
110
+ if @reason.nil?
111
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ return false if @message.nil?
121
+ return false if @reason.nil?
122
+ reason_validator = EnumAttributeValidator.new('String', ['INVALID_APIKEY', 'INVALID_SHIPPING_INPUT_PARAMS', 'CAPTURE_CONTEXT_INVALID', 'CAPTURE_CONTEXT_EXPIRED', 'SDK_XHR_ERROR', 'UNIFIEDPAYMENTS_VALIDATION_PARAMS', 'UNIFIEDPAYMENTS_VALIDATION_FIELDS', 'UNIFIEDPAYMENT_PAYMENT_PARAMITERS', 'CREATE_TOKEN_TIMEOUT', 'CREATE_TOKEN_XHR_ERROR', 'SHOW_LOAD_CONTAINER_SELECTOR', 'SHOW_LOAD_INVALID_CONTAINER', 'SHOW_TOKEN_TIMEOUT', 'SHOW_TOKEN_XHR_ERROR', 'SHOW_PAYMENT_TIMEOUT'])
123
+ return false unless reason_validator.valid?(@reason)
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method checking allowed values (enum).
128
+ # @param [Object] reason Object to be assigned
129
+ def reason=(reason)
130
+ validator = EnumAttributeValidator.new('String', ['INVALID_APIKEY', 'INVALID_SHIPPING_INPUT_PARAMS', 'CAPTURE_CONTEXT_INVALID', 'CAPTURE_CONTEXT_EXPIRED', 'SDK_XHR_ERROR', 'UNIFIEDPAYMENTS_VALIDATION_PARAMS', 'UNIFIEDPAYMENTS_VALIDATION_FIELDS', 'UNIFIEDPAYMENT_PAYMENT_PARAMITERS', 'CREATE_TOKEN_TIMEOUT', 'CREATE_TOKEN_XHR_ERROR', 'SHOW_LOAD_CONTAINER_SELECTOR', 'SHOW_LOAD_INVALID_CONTAINER', 'SHOW_TOKEN_TIMEOUT', 'SHOW_TOKEN_XHR_ERROR', 'SHOW_PAYMENT_TIMEOUT'])
131
+ unless validator.valid?(reason)
132
+ fail ArgumentError, 'invalid value for "reason", must be one of #{validator.allowable_values}.'
133
+ end
134
+ @reason = reason
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ correlation_id == o.correlation_id &&
143
+ details == o.details &&
144
+ information_link == o.information_link &&
145
+ message == o.message &&
146
+ reason == o.reason
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Fixnum] Hash code
157
+ def hash
158
+ [correlation_id, details, information_link, message, reason].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ self.class.swagger_types.each_pair do |key, type|
167
+ if type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ temp_model = CyberSource.const_get(type).new
219
+ temp_model.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ # Returns the string representation of the object
224
+ # @return [String] String presentation of the object
225
+ def to_s
226
+ to_hash.to_s
227
+ end
228
+
229
+ # to_body is an alias to to_hash (backward compatibility)
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_body
232
+ to_hash
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ next if value.nil?
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+ end
265
+ end