ultracart_api 3.4.5 → 3.4.9

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -4
  3. data/docs/EmailList.md +1 -0
  4. data/docs/EmailListSegmentFolder.md +12 -0
  5. data/docs/EmailListSegmentFolderResponse.md +12 -0
  6. data/docs/EmailListSegmentFoldersResponse.md +12 -0
  7. data/docs/EmailSegment.md +1 -0
  8. data/docs/PaymentsConfiguration.md +5 -3
  9. data/docs/PaymentsConfigurationAffirm.md +7 -7
  10. data/docs/PaymentsConfigurationAmazon.md +7 -7
  11. data/docs/PaymentsConfigurationCOD.md +5 -5
  12. data/docs/PaymentsConfigurationCash.md +1 -1
  13. data/docs/PaymentsConfigurationCheck.md +12 -17
  14. data/docs/PaymentsConfigurationCreditCard.md +11 -9
  15. data/docs/PaymentsConfigurationEcheck.md +11 -0
  16. data/docs/PaymentsConfigurationLoanHero.md +4 -4
  17. data/docs/PaymentsConfigurationMoneyOrder.md +11 -0
  18. data/docs/PaymentsConfigurationPayPal.md +28 -28
  19. data/docs/PaymentsConfigurationPurchaseOrder.md +3 -3
  20. data/docs/PaymentsConfigurationQuoteRequest.md +2 -2
  21. data/docs/PaymentsConfigurationRestrictions.md +12 -12
  22. data/docs/PaymentsConfigurationSezzle.md +8 -7
  23. data/docs/PaymentsConfigurationWePay.md +26 -26
  24. data/docs/PaymentsConfigurationWireTransfer.md +10 -10
  25. data/docs/RotatingTransactionGateway.md +4 -3
  26. data/docs/StorefrontApi.md +260 -0
  27. data/lib/ultracart_api.rb +5 -0
  28. data/lib/ultracart_api/api/storefront_api.rb +295 -0
  29. data/lib/ultracart_api/models/email_list.rb +11 -1
  30. data/lib/ultracart_api/models/email_list_segment_folder.rb +240 -0
  31. data/lib/ultracart_api/models/email_list_segment_folder_response.rb +221 -0
  32. data/lib/ultracart_api/models/email_list_segment_folders_response.rb +223 -0
  33. data/lib/ultracart_api/models/email_segment.rb +11 -1
  34. data/lib/ultracart_api/models/payments_configuration.rb +50 -31
  35. data/lib/ultracart_api/models/payments_configuration_affirm.rb +81 -40
  36. data/lib/ultracart_api/models/payments_configuration_amazon.rb +51 -44
  37. data/lib/ultracart_api/models/payments_configuration_cash.rb +4 -3
  38. data/lib/ultracart_api/models/payments_configuration_check.rb +70 -103
  39. data/lib/ultracart_api/models/payments_configuration_cod.rb +39 -34
  40. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +68 -39
  41. data/lib/ultracart_api/models/payments_configuration_echeck.rb +214 -0
  42. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +23 -19
  43. data/lib/ultracart_api/models/payments_configuration_money_order.rb +214 -0
  44. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +270 -172
  45. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +19 -16
  46. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +12 -10
  47. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +48 -36
  48. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +97 -46
  49. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +186 -160
  50. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +71 -61
  51. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +13 -3
  52. data/lib/ultracart_api/version.rb +1 -1
  53. metadata +12 -2
@@ -0,0 +1,214 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class PaymentsConfigurationEcheck
17
+ # Master flag indicating this merchant accepts eChecks
18
+ attr_accessor :accept_echeck
19
+
20
+ # Optional Quickbooks accounting code
21
+ attr_accessor :accounting_code
22
+
23
+ # Optional Quickbooks deposit to account
24
+ attr_accessor :deposit_to_account
25
+
26
+ attr_accessor :restrictions
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'accept_echeck' => :'accept_echeck',
32
+ :'accounting_code' => :'accounting_code',
33
+ :'deposit_to_account' => :'deposit_to_account',
34
+ :'restrictions' => :'restrictions'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'accept_echeck' => :'BOOLEAN',
42
+ :'accounting_code' => :'String',
43
+ :'deposit_to_account' => :'String',
44
+ :'restrictions' => :'PaymentsConfigurationRestrictions'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'accept_echeck')
57
+ self.accept_echeck = attributes[:'accept_echeck']
58
+ end
59
+
60
+ if attributes.has_key?(:'accounting_code')
61
+ self.accounting_code = attributes[:'accounting_code']
62
+ end
63
+
64
+ if attributes.has_key?(:'deposit_to_account')
65
+ self.deposit_to_account = attributes[:'deposit_to_account']
66
+ end
67
+
68
+ if attributes.has_key?(:'restrictions')
69
+ self.restrictions = attributes[:'restrictions']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ accept_echeck == o.accept_echeck &&
92
+ accounting_code == o.accounting_code &&
93
+ deposit_to_account == o.deposit_to_account &&
94
+ restrictions == o.restrictions
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [accept_echeck, accounting_code, deposit_to_account, restrictions].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = UltracartClient.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+ end
@@ -14,24 +14,28 @@ require 'date'
14
14
 
15
15
  module UltracartClient
16
16
  class PaymentsConfigurationLoanHero
17
+ # Master flag indicating this merchant accepts Loan Hero
17
18
  attr_accessor :accept_loan_hero
18
19
 
19
- attr_accessor :loan_hero_accounting_code
20
+ # Optional Quickbooks accounting code
21
+ attr_accessor :accounting_code
20
22
 
21
- attr_accessor :loan_hero_deposit_to_account
23
+ # Optional Quickbooks deposit to account
24
+ attr_accessor :deposit_to_account
22
25
 
23
26
  attr_accessor :restrictions
24
27
 
28
+ # Internal field to aid UI
25
29
  attr_accessor :show_loan_hero
26
30
 
27
31
  # Attribute mapping from ruby-style variable name to JSON key.
28
32
  def self.attribute_map
29
33
  {
30
- :'accept_loan_hero' => :'acceptLoanHero',
31
- :'loan_hero_accounting_code' => :'loanHeroAccountingCode',
32
- :'loan_hero_deposit_to_account' => :'loanHeroDepositToAccount',
34
+ :'accept_loan_hero' => :'accept_loan_hero',
35
+ :'accounting_code' => :'accounting_code',
36
+ :'deposit_to_account' => :'deposit_to_account',
33
37
  :'restrictions' => :'restrictions',
34
- :'show_loan_hero' => :'showLoanHero'
38
+ :'show_loan_hero' => :'show_loan_hero'
35
39
  }
36
40
  end
37
41
 
@@ -39,8 +43,8 @@ module UltracartClient
39
43
  def self.swagger_types
40
44
  {
41
45
  :'accept_loan_hero' => :'BOOLEAN',
42
- :'loan_hero_accounting_code' => :'String',
43
- :'loan_hero_deposit_to_account' => :'String',
46
+ :'accounting_code' => :'String',
47
+ :'deposit_to_account' => :'String',
44
48
  :'restrictions' => :'PaymentsConfigurationRestrictions',
45
49
  :'show_loan_hero' => :'BOOLEAN'
46
50
  }
@@ -54,24 +58,24 @@ module UltracartClient
54
58
  # convert string to symbol for hash key
55
59
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
60
 
57
- if attributes.has_key?(:'acceptLoanHero')
58
- self.accept_loan_hero = attributes[:'acceptLoanHero']
61
+ if attributes.has_key?(:'accept_loan_hero')
62
+ self.accept_loan_hero = attributes[:'accept_loan_hero']
59
63
  end
60
64
 
61
- if attributes.has_key?(:'loanHeroAccountingCode')
62
- self.loan_hero_accounting_code = attributes[:'loanHeroAccountingCode']
65
+ if attributes.has_key?(:'accounting_code')
66
+ self.accounting_code = attributes[:'accounting_code']
63
67
  end
64
68
 
65
- if attributes.has_key?(:'loanHeroDepositToAccount')
66
- self.loan_hero_deposit_to_account = attributes[:'loanHeroDepositToAccount']
69
+ if attributes.has_key?(:'deposit_to_account')
70
+ self.deposit_to_account = attributes[:'deposit_to_account']
67
71
  end
68
72
 
69
73
  if attributes.has_key?(:'restrictions')
70
74
  self.restrictions = attributes[:'restrictions']
71
75
  end
72
76
 
73
- if attributes.has_key?(:'showLoanHero')
74
- self.show_loan_hero = attributes[:'showLoanHero']
77
+ if attributes.has_key?(:'show_loan_hero')
78
+ self.show_loan_hero = attributes[:'show_loan_hero']
75
79
  end
76
80
  end
77
81
 
@@ -94,8 +98,8 @@ module UltracartClient
94
98
  return true if self.equal?(o)
95
99
  self.class == o.class &&
96
100
  accept_loan_hero == o.accept_loan_hero &&
97
- loan_hero_accounting_code == o.loan_hero_accounting_code &&
98
- loan_hero_deposit_to_account == o.loan_hero_deposit_to_account &&
101
+ accounting_code == o.accounting_code &&
102
+ deposit_to_account == o.deposit_to_account &&
99
103
  restrictions == o.restrictions &&
100
104
  show_loan_hero == o.show_loan_hero
101
105
  end
@@ -109,7 +113,7 @@ module UltracartClient
109
113
  # Calculates hash code according to all attributes.
110
114
  # @return [Fixnum] Hash code
111
115
  def hash
112
- [accept_loan_hero, loan_hero_accounting_code, loan_hero_deposit_to_account, restrictions, show_loan_hero].hash
116
+ [accept_loan_hero, accounting_code, deposit_to_account, restrictions, show_loan_hero].hash
113
117
  end
114
118
 
115
119
  # Builds the object from hash
@@ -0,0 +1,214 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class PaymentsConfigurationMoneyOrder
17
+ # Master flag for this merchant accepting money orders
18
+ attr_accessor :accept_money_orders
19
+
20
+ # Optional Quickbooks accounting code
21
+ attr_accessor :accounting_code
22
+
23
+ # Optional Quickbooks deposit to account
24
+ attr_accessor :deposit_to_account
25
+
26
+ attr_accessor :restrictions
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'accept_money_orders' => :'accept_money_orders',
32
+ :'accounting_code' => :'accounting_code',
33
+ :'deposit_to_account' => :'deposit_to_account',
34
+ :'restrictions' => :'restrictions'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'accept_money_orders' => :'BOOLEAN',
42
+ :'accounting_code' => :'String',
43
+ :'deposit_to_account' => :'String',
44
+ :'restrictions' => :'PaymentsConfigurationRestrictions'
45
+ }
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ return unless attributes.is_a?(Hash)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ if attributes.has_key?(:'accept_money_orders')
57
+ self.accept_money_orders = attributes[:'accept_money_orders']
58
+ end
59
+
60
+ if attributes.has_key?(:'accounting_code')
61
+ self.accounting_code = attributes[:'accounting_code']
62
+ end
63
+
64
+ if attributes.has_key?(:'deposit_to_account')
65
+ self.deposit_to_account = attributes[:'deposit_to_account']
66
+ end
67
+
68
+ if attributes.has_key?(:'restrictions')
69
+ self.restrictions = attributes[:'restrictions']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ accept_money_orders == o.accept_money_orders &&
92
+ accounting_code == o.accounting_code &&
93
+ deposit_to_account == o.deposit_to_account &&
94
+ restrictions == o.restrictions
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Fixnum] Hash code
105
+ def hash
106
+ [accept_money_orders, accounting_code, deposit_to_account, restrictions].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ temp_model = UltracartClient.const_get(type).new
167
+ temp_model.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ next if value.nil?
190
+ hash[param] = _to_hash(value)
191
+ end
192
+ hash
193
+ end
194
+
195
+ # Outputs non-array value in the form of hash
196
+ # For object, use to_hash. Otherwise, just return the value
197
+ # @param [Object] value Any valid value
198
+ # @return [Hash] Returns the value in the form of hash
199
+ def _to_hash(value)
200
+ if value.is_a?(Array)
201
+ value.compact.map { |v| _to_hash(v) }
202
+ elsif value.is_a?(Hash)
203
+ {}.tap do |hash|
204
+ value.each { |k, v| hash[k] = _to_hash(v) }
205
+ end
206
+ elsif value.respond_to? :to_hash
207
+ value.to_hash
208
+ else
209
+ value
210
+ end
211
+ end
212
+
213
+ end
214
+ end