ultracart_api 4.1.96 → 4.1.97

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.
@@ -18,30 +18,50 @@ module UltracartClient
18
18
  # Affiliates with non-empty email, sorted by email.
19
19
  attr_accessor :affiliates
20
20
 
21
+ # Valid values for avs_match_type on the 'address street and zip avs' rule type.
22
+ attr_accessor :avs_match_types
23
+
21
24
  # ISO country codes available to this merchant.
22
25
  attr_accessor :countries
23
26
 
27
+ # Valid values for failure_action on insert and search requests.
28
+ attr_accessor :failure_actions
29
+
24
30
  # Valid values for ip_range_type on IP-based rules.
25
31
  attr_accessor :ip_range_types
26
32
 
27
33
  # True when this merchant has at least one linked merchant account.
28
34
  attr_accessor :linked_accounts
29
35
 
36
+ # Rotating transaction gateways configured for this merchant. Use the oid as a value in rotating_transaction_gateway_filters on insert.
37
+ attr_accessor :rotating_transaction_gateways
38
+
30
39
  # Valid values for rule_group on search requests.
31
40
  attr_accessor :rule_groups
32
41
 
33
42
  # Valid values for rule_type on insert and search requests.
34
43
  attr_accessor :rule_types
35
44
 
45
+ # Screen branding themes configured for this merchant. Use the oid as a value in screen_branding_theme_filters on insert.
46
+ attr_accessor :screen_branding_themes
47
+
48
+ # Valid values for user_action on rule types that distinguish between attempted and approved transactions.
49
+ attr_accessor :user_actions
50
+
36
51
  # Attribute mapping from ruby-style variable name to JSON key.
37
52
  def self.attribute_map
38
53
  {
39
54
  :'affiliates' => :'affiliates',
55
+ :'avs_match_types' => :'avs_match_types',
40
56
  :'countries' => :'countries',
57
+ :'failure_actions' => :'failure_actions',
41
58
  :'ip_range_types' => :'ip_range_types',
42
59
  :'linked_accounts' => :'linked_accounts',
60
+ :'rotating_transaction_gateways' => :'rotating_transaction_gateways',
43
61
  :'rule_groups' => :'rule_groups',
44
- :'rule_types' => :'rule_types'
62
+ :'rule_types' => :'rule_types',
63
+ :'screen_branding_themes' => :'screen_branding_themes',
64
+ :'user_actions' => :'user_actions'
45
65
  }
46
66
  end
47
67
 
@@ -53,12 +73,17 @@ module UltracartClient
53
73
  # Attribute type mapping.
54
74
  def self.openapi_types
55
75
  {
56
- :'affiliates' => :'Object',
57
- :'countries' => :'Object',
58
- :'ip_range_types' => :'Object',
76
+ :'affiliates' => :'Array<FraudLookupAffiliate>',
77
+ :'avs_match_types' => :'Array<String>',
78
+ :'countries' => :'Array<String>',
79
+ :'failure_actions' => :'Array<String>',
80
+ :'ip_range_types' => :'Array<String>',
59
81
  :'linked_accounts' => :'Boolean',
60
- :'rule_groups' => :'Object',
61
- :'rule_types' => :'Object'
82
+ :'rotating_transaction_gateways' => :'Array<FraudLookupGateway>',
83
+ :'rule_groups' => :'Array<String>',
84
+ :'rule_types' => :'Array<String>',
85
+ :'screen_branding_themes' => :'Array<FraudLookupTheme>',
86
+ :'user_actions' => :'Array<String>'
62
87
  }
63
88
  end
64
89
 
@@ -84,27 +109,67 @@ module UltracartClient
84
109
  }
85
110
 
86
111
  if attributes.key?(:'affiliates')
87
- self.affiliates = attributes[:'affiliates']
112
+ if (value = attributes[:'affiliates']).is_a?(Array)
113
+ self.affiliates = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'avs_match_types')
118
+ if (value = attributes[:'avs_match_types']).is_a?(Array)
119
+ self.avs_match_types = value
120
+ end
88
121
  end
89
122
 
90
123
  if attributes.key?(:'countries')
91
- self.countries = attributes[:'countries']
124
+ if (value = attributes[:'countries']).is_a?(Array)
125
+ self.countries = value
126
+ end
127
+ end
128
+
129
+ if attributes.key?(:'failure_actions')
130
+ if (value = attributes[:'failure_actions']).is_a?(Array)
131
+ self.failure_actions = value
132
+ end
92
133
  end
93
134
 
94
135
  if attributes.key?(:'ip_range_types')
95
- self.ip_range_types = attributes[:'ip_range_types']
136
+ if (value = attributes[:'ip_range_types']).is_a?(Array)
137
+ self.ip_range_types = value
138
+ end
96
139
  end
97
140
 
98
141
  if attributes.key?(:'linked_accounts')
99
142
  self.linked_accounts = attributes[:'linked_accounts']
100
143
  end
101
144
 
145
+ if attributes.key?(:'rotating_transaction_gateways')
146
+ if (value = attributes[:'rotating_transaction_gateways']).is_a?(Array)
147
+ self.rotating_transaction_gateways = value
148
+ end
149
+ end
150
+
102
151
  if attributes.key?(:'rule_groups')
103
- self.rule_groups = attributes[:'rule_groups']
152
+ if (value = attributes[:'rule_groups']).is_a?(Array)
153
+ self.rule_groups = value
154
+ end
104
155
  end
105
156
 
106
157
  if attributes.key?(:'rule_types')
107
- self.rule_types = attributes[:'rule_types']
158
+ if (value = attributes[:'rule_types']).is_a?(Array)
159
+ self.rule_types = value
160
+ end
161
+ end
162
+
163
+ if attributes.key?(:'screen_branding_themes')
164
+ if (value = attributes[:'screen_branding_themes']).is_a?(Array)
165
+ self.screen_branding_themes = value
166
+ end
167
+ end
168
+
169
+ if attributes.key?(:'user_actions')
170
+ if (value = attributes[:'user_actions']).is_a?(Array)
171
+ self.user_actions = value
172
+ end
108
173
  end
109
174
  end
110
175
 
@@ -127,11 +192,16 @@ module UltracartClient
127
192
  return true if self.equal?(o)
128
193
  self.class == o.class &&
129
194
  affiliates == o.affiliates &&
195
+ avs_match_types == o.avs_match_types &&
130
196
  countries == o.countries &&
197
+ failure_actions == o.failure_actions &&
131
198
  ip_range_types == o.ip_range_types &&
132
199
  linked_accounts == o.linked_accounts &&
200
+ rotating_transaction_gateways == o.rotating_transaction_gateways &&
133
201
  rule_groups == o.rule_groups &&
134
- rule_types == o.rule_types
202
+ rule_types == o.rule_types &&
203
+ screen_branding_themes == o.screen_branding_themes &&
204
+ user_actions == o.user_actions
135
205
  end
136
206
 
137
207
  # @see the `==` method
@@ -143,7 +213,7 @@ module UltracartClient
143
213
  # Calculates hash code according to all attributes.
144
214
  # @return [Integer] Hash code
145
215
  def hash
146
- [affiliates, countries, ip_range_types, linked_accounts, rule_groups, rule_types].hash
216
+ [affiliates, avs_match_types, countries, failure_actions, ip_range_types, linked_accounts, rotating_transaction_gateways, rule_groups, rule_types, screen_branding_themes, user_actions].hash
147
217
  end
148
218
 
149
219
  # Builds the object from hash
@@ -0,0 +1,314 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class FraudRuleFromOrderRequest
18
+ # Note automatically appended to the order's merchant note when these rules fire.
19
+ attr_accessor :auto_note
20
+
21
+ # Establish an 'address street and zip avs' rule from the order's ship-to street and zip.
22
+ attr_accessor :establish_address_filter
23
+
24
+ # Establish a 'credit card matches' rule by duplicating the order's stored card vault token. Skipped if the order has no stored card.
25
+ attr_accessor :establish_card_filter
26
+
27
+ # Establish an 'address email' rule from the order's email address.
28
+ attr_accessor :establish_email_filter
29
+
30
+ # Establish an 'ip matches' subnet rule from the order's customer IP address (last octet masked to a subnet).
31
+ attr_accessor :establish_ip_filter
32
+
33
+ # Action to take when these rules fire. Defaults to 'Flag For Review' when omitted.
34
+ attr_accessor :failure_action
35
+
36
+ # The order id to establish the fraud rule(s) from.
37
+ attr_accessor :order_id
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'auto_note' => :'auto_note',
65
+ :'establish_address_filter' => :'establish_address_filter',
66
+ :'establish_card_filter' => :'establish_card_filter',
67
+ :'establish_email_filter' => :'establish_email_filter',
68
+ :'establish_ip_filter' => :'establish_ip_filter',
69
+ :'failure_action' => :'failure_action',
70
+ :'order_id' => :'order_id'
71
+ }
72
+ end
73
+
74
+ # Returns all the JSON keys this model knows about
75
+ def self.acceptable_attributes
76
+ attribute_map.values
77
+ end
78
+
79
+ # Attribute type mapping.
80
+ def self.openapi_types
81
+ {
82
+ :'auto_note' => :'String',
83
+ :'establish_address_filter' => :'Boolean',
84
+ :'establish_card_filter' => :'Boolean',
85
+ :'establish_email_filter' => :'Boolean',
86
+ :'establish_ip_filter' => :'Boolean',
87
+ :'failure_action' => :'String',
88
+ :'order_id' => :'String'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::FraudRuleFromOrderRequest` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h|
107
+ if (!self.class.attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::FraudRuleFromOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
109
+ end
110
+ h[k.to_sym] = v
111
+ }
112
+
113
+ if attributes.key?(:'auto_note')
114
+ self.auto_note = attributes[:'auto_note']
115
+ end
116
+
117
+ if attributes.key?(:'establish_address_filter')
118
+ self.establish_address_filter = attributes[:'establish_address_filter']
119
+ end
120
+
121
+ if attributes.key?(:'establish_card_filter')
122
+ self.establish_card_filter = attributes[:'establish_card_filter']
123
+ end
124
+
125
+ if attributes.key?(:'establish_email_filter')
126
+ self.establish_email_filter = attributes[:'establish_email_filter']
127
+ end
128
+
129
+ if attributes.key?(:'establish_ip_filter')
130
+ self.establish_ip_filter = attributes[:'establish_ip_filter']
131
+ end
132
+
133
+ if attributes.key?(:'failure_action')
134
+ self.failure_action = attributes[:'failure_action']
135
+ end
136
+
137
+ if attributes.key?(:'order_id')
138
+ self.order_id = attributes[:'order_id']
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ failure_action_validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
153
+ return false unless failure_action_validator.valid?(@failure_action)
154
+ true
155
+ end
156
+
157
+ # Custom attribute writer method checking allowed values (enum).
158
+ # @param [Object] failure_action Object to be assigned
159
+ def failure_action=(failure_action)
160
+ validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
161
+ unless validator.valid?(failure_action)
162
+ fail ArgumentError, "invalid value for \"failure_action\", must be one of #{validator.allowable_values}."
163
+ end
164
+ @failure_action = failure_action
165
+ end
166
+
167
+ # Checks equality by comparing each attribute.
168
+ # @param [Object] Object to be compared
169
+ def ==(o)
170
+ return true if self.equal?(o)
171
+ self.class == o.class &&
172
+ auto_note == o.auto_note &&
173
+ establish_address_filter == o.establish_address_filter &&
174
+ establish_card_filter == o.establish_card_filter &&
175
+ establish_email_filter == o.establish_email_filter &&
176
+ establish_ip_filter == o.establish_ip_filter &&
177
+ failure_action == o.failure_action &&
178
+ order_id == o.order_id
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 [Integer] Hash code
189
+ def hash
190
+ [auto_note, establish_address_filter, establish_card_filter, establish_email_filter, establish_ip_filter, failure_action, order_id].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 self.build_from_hash(attributes)
197
+ new.build_from_hash(attributes)
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ self.class.openapi_types.each_pair do |key, type|
207
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
+ self.send("#{key}=", nil)
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
+ end
215
+ elsif !attributes[self.class.attribute_map[key]].nil?
216
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
+ end
218
+ end
219
+
220
+ self
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :Time
230
+ Time.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ # models (e.g. Pet) or oneOf
261
+ klass = UltracartClient.const_get(type)
262
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
+ end
264
+ end
265
+
266
+ # Returns the string representation of the object
267
+ # @return [String] String presentation of the object
268
+ def to_s
269
+ to_hash.to_s
270
+ end
271
+
272
+ # to_body is an alias to to_hash (backward compatibility)
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_body
275
+ to_hash
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ # Outputs non-array value in the form of hash
295
+ # For object, use to_hash. Otherwise, just return the value
296
+ # @param [Object] value Any valid value
297
+ # @return [Hash] Returns the value in the form of hash
298
+ def _to_hash(value)
299
+ if value.is_a?(Array)
300
+ value.compact.map { |v| _to_hash(v) }
301
+ elsif value.is_a?(Hash)
302
+ {}.tap do |hash|
303
+ value.each { |k, v| hash[k] = _to_hash(v) }
304
+ end
305
+ elsif value.respond_to? :to_hash
306
+ value.to_hash
307
+ else
308
+ value
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end
@@ -66,22 +66,31 @@ module UltracartClient
66
66
  # Merchant item id. Used by the 'item matches' rule type.
67
67
  attr_accessor :merchant_item_id
68
68
 
69
+ # When failure_action is 'Process Payment and Modify', set order custom field 1 to this value.
69
70
  attr_accessor :modify_custom_field1
70
71
 
72
+ # When failure_action is 'Process Payment and Modify', set order custom field 2 to this value.
71
73
  attr_accessor :modify_custom_field2
72
74
 
75
+ # When failure_action is 'Process Payment and Modify', set order custom field 3 to this value.
73
76
  attr_accessor :modify_custom_field3
74
77
 
78
+ # When failure_action is 'Process Payment and Modify', set order custom field 4 to this value.
75
79
  attr_accessor :modify_custom_field4
76
80
 
81
+ # When failure_action is 'Process Payment and Modify', set order custom field 5 to this value.
77
82
  attr_accessor :modify_custom_field5
78
83
 
84
+ # When failure_action is 'Process Payment and Modify', set order custom field 6 to this value.
79
85
  attr_accessor :modify_custom_field6
80
86
 
87
+ # When failure_action is 'Process Payment and Modify', set order custom field 7 to this value.
81
88
  attr_accessor :modify_custom_field7
82
89
 
90
+ # When failure_action is 'Process Payment and Modify', strip the affiliate from the order.
83
91
  attr_accessor :modify_skip_affiliate
84
92
 
93
+ # When failure_action is 'Process Payment and Modify', skip firing the affiliate network pixel.
85
94
  attr_accessor :modify_skip_affiliate_network_pixel
86
95
 
87
96
  # Optional list of rotating transaction gateway oids restricting this rule to orders processed by one of these gateways.
@@ -170,14 +179,14 @@ module UltracartClient
170
179
  :'avs_response_codes' => :'String',
171
180
  :'count_threshold' => :'Integer',
172
181
  :'country_code' => :'String',
173
- :'credit_card_bins' => :'Object',
182
+ :'credit_card_bins' => :'Array<String>',
174
183
  :'email' => :'String',
175
184
  :'failure_action' => :'String',
176
185
  :'gateway_response_codes' => :'String',
177
186
  :'gateway_response_value' => :'String',
178
187
  :'ip_address' => :'String',
179
188
  :'ip_range_type' => :'String',
180
- :'item_filters' => :'Object',
189
+ :'item_filters' => :'Array<String>',
181
190
  :'merchant_item_id' => :'String',
182
191
  :'modify_custom_field1' => :'String',
183
192
  :'modify_custom_field2' => :'String',
@@ -188,9 +197,9 @@ module UltracartClient
188
197
  :'modify_custom_field7' => :'String',
189
198
  :'modify_skip_affiliate' => :'Boolean',
190
199
  :'modify_skip_affiliate_network_pixel' => :'Boolean',
191
- :'rotating_transaction_gateway_filters' => :'Object',
200
+ :'rotating_transaction_gateway_filters' => :'Array<Integer>',
192
201
  :'rule_type' => :'String',
193
- :'screen_branding_theme_filters' => :'Object',
202
+ :'screen_branding_theme_filters' => :'Array<Integer>',
194
203
  :'user_action' => :'String'
195
204
  }
196
205
  end
@@ -249,7 +258,9 @@ module UltracartClient
249
258
  end
250
259
 
251
260
  if attributes.key?(:'credit_card_bins')
252
- self.credit_card_bins = attributes[:'credit_card_bins']
261
+ if (value = attributes[:'credit_card_bins']).is_a?(Array)
262
+ self.credit_card_bins = value
263
+ end
253
264
  end
254
265
 
255
266
  if attributes.key?(:'email')
@@ -277,7 +288,9 @@ module UltracartClient
277
288
  end
278
289
 
279
290
  if attributes.key?(:'item_filters')
280
- self.item_filters = attributes[:'item_filters']
291
+ if (value = attributes[:'item_filters']).is_a?(Array)
292
+ self.item_filters = value
293
+ end
281
294
  end
282
295
 
283
296
  if attributes.key?(:'merchant_item_id')
@@ -321,7 +334,9 @@ module UltracartClient
321
334
  end
322
335
 
323
336
  if attributes.key?(:'rotating_transaction_gateway_filters')
324
- self.rotating_transaction_gateway_filters = attributes[:'rotating_transaction_gateway_filters']
337
+ if (value = attributes[:'rotating_transaction_gateway_filters']).is_a?(Array)
338
+ self.rotating_transaction_gateway_filters = value
339
+ end
325
340
  end
326
341
 
327
342
  if attributes.key?(:'rule_type')
@@ -329,7 +344,9 @@ module UltracartClient
329
344
  end
330
345
 
331
346
  if attributes.key?(:'screen_branding_theme_filters')
332
- self.screen_branding_theme_filters = attributes[:'screen_branding_theme_filters']
347
+ if (value = attributes[:'screen_branding_theme_filters']).is_a?(Array)
348
+ self.screen_branding_theme_filters = value
349
+ end
333
350
  end
334
351
 
335
352
  if attributes.key?(:'user_action')