ultracart_api 3.10.14 → 3.10.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -97
  3. data/docs/ChannelPartnerApi.md +51 -0
  4. data/docs/{DelayAutoOrdersResponse.md → ChannelPartnerEstimateTaxResponse.md} +2 -2
  5. data/docs/ChargebackApi.md +1 -1
  6. data/docs/CustomerActivity.md +4 -0
  7. data/docs/CustomerApi.md +58 -1
  8. data/docs/CustomerMergeRequest.md +9 -0
  9. data/docs/OrderApi.md +1 -1
  10. data/docs/SsoApi.md +2 -2
  11. data/docs/UserApi.md +2 -2
  12. data/docs/WebhookApi.md +1 -1
  13. data/lib/ultracart_api/api/channel_partner_api.rb +55 -0
  14. data/lib/ultracart_api/api/chargeback_api.rb +1 -1
  15. data/lib/ultracart_api/api/customer_api.rb +64 -1
  16. data/lib/ultracart_api/api/order_api.rb +1 -1
  17. data/lib/ultracart_api/api/sso_api.rb +2 -2
  18. data/lib/ultracart_api/api/user_api.rb +2 -2
  19. data/lib/ultracart_api/api/webhook_api.rb +1 -1
  20. data/lib/ultracart_api/models/{stripe_connect_response.rb → channel_partner_estimate_tax_response.rb} +8 -8
  21. data/lib/ultracart_api/models/customer_activity.rb +40 -4
  22. data/lib/ultracart_api/models/{payments_configuration_cash.rb → customer_merge_request.rb} +16 -15
  23. data/lib/ultracart_api/version.rb +1 -1
  24. data/lib/ultracart_api.rb +2 -39
  25. metadata +6 -80
  26. data/docs/ConfigurationApi.md +0 -756
  27. data/docs/PaymentsConfiguration.md +0 -24
  28. data/docs/PaymentsConfigurationAffirm.md +0 -15
  29. data/docs/PaymentsConfigurationAmazon.md +0 -15
  30. data/docs/PaymentsConfigurationCOD.md +0 -13
  31. data/docs/PaymentsConfigurationCash.md +0 -9
  32. data/docs/PaymentsConfigurationCheck.md +0 -19
  33. data/docs/PaymentsConfigurationCreditCard.md +0 -17
  34. data/docs/PaymentsConfigurationCreditCardType.md +0 -18
  35. data/docs/PaymentsConfigurationEcheck.md +0 -12
  36. data/docs/PaymentsConfigurationInsurance.md +0 -9
  37. data/docs/PaymentsConfigurationLoanHero.md +0 -12
  38. data/docs/PaymentsConfigurationMoneyOrder.md +0 -11
  39. data/docs/PaymentsConfigurationPayPal.md +0 -36
  40. data/docs/PaymentsConfigurationPurchaseOrder.md +0 -11
  41. data/docs/PaymentsConfigurationQuoteRequest.md +0 -10
  42. data/docs/PaymentsConfigurationResponse.md +0 -12
  43. data/docs/PaymentsConfigurationRestrictions.md +0 -21
  44. data/docs/PaymentsConfigurationRestrictionsTheme.md +0 -10
  45. data/docs/PaymentsConfigurationSezzle.md +0 -15
  46. data/docs/PaymentsConfigurationTestMethod.md +0 -18
  47. data/docs/PaymentsConfigurationWePay.md +0 -35
  48. data/docs/PaymentsConfigurationWireTransfer.md +0 -18
  49. data/docs/PaymentsThemeTransactionType.md +0 -10
  50. data/docs/PaymentsWepayEnroll.md +0 -22
  51. data/docs/RotatingTransactionGateway.md +0 -51
  52. data/docs/RotatingTransactionGatewayResponse.md +0 -12
  53. data/docs/RotatingTransactionGatewaysResponse.md +0 -12
  54. data/docs/RtgCurrency.md +0 -10
  55. data/docs/RtgDayOfMonthRestriction.md +0 -9
  56. data/docs/RtgDayOfWeekRestriction.md +0 -10
  57. data/docs/RtgSummaryGateway.md +0 -24
  58. data/docs/RtgSummaryResponse.md +0 -14
  59. data/docs/RtgThemeRestriction.md +0 -10
  60. data/docs/StripeConnectResponse.md +0 -12
  61. data/docs/TransactionGateway.md +0 -71
  62. data/docs/TransactionGatewaysRequest.md +0 -10
  63. data/docs/TransactionGatewaysResponse.md +0 -12
  64. data/lib/ultracart_api/api/configuration_api.rb +0 -843
  65. data/lib/ultracart_api/models/delay_auto_orders_response.rb +0 -221
  66. data/lib/ultracart_api/models/payments_configuration.rb +0 -329
  67. data/lib/ultracart_api/models/payments_configuration_affirm.rb +0 -288
  68. data/lib/ultracart_api/models/payments_configuration_amazon.rb +0 -288
  69. data/lib/ultracart_api/models/payments_configuration_check.rb +0 -294
  70. data/lib/ultracart_api/models/payments_configuration_cod.rb +0 -234
  71. data/lib/ultracart_api/models/payments_configuration_credit_card.rb +0 -279
  72. data/lib/ultracart_api/models/payments_configuration_credit_card_type.rb +0 -318
  73. data/lib/ultracart_api/models/payments_configuration_echeck.rb +0 -226
  74. data/lib/ultracart_api/models/payments_configuration_insurance.rb +0 -194
  75. data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +0 -224
  76. data/lib/ultracart_api/models/payments_configuration_money_order.rb +0 -214
  77. data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +0 -534
  78. data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +0 -214
  79. data/lib/ultracart_api/models/payments_configuration_quote_request.rb +0 -204
  80. data/lib/ultracart_api/models/payments_configuration_response.rb +0 -221
  81. data/lib/ultracart_api/models/payments_configuration_restrictions.rb +0 -447
  82. data/lib/ultracart_api/models/payments_configuration_restrictions_theme.rb +0 -202
  83. data/lib/ultracart_api/models/payments_configuration_sezzle.rb +0 -288
  84. data/lib/ultracart_api/models/payments_configuration_test_method.rb +0 -319
  85. data/lib/ultracart_api/models/payments_configuration_we_pay.rb +0 -454
  86. data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +0 -284
  87. data/lib/ultracart_api/models/payments_theme_transaction_type.rb +0 -239
  88. data/lib/ultracart_api/models/payments_wepay_enroll.rb +0 -310
  89. data/lib/ultracart_api/models/rotating_transaction_gateway.rb +0 -675
  90. data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +0 -221
  91. data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +0 -223
  92. data/lib/ultracart_api/models/rtg_currency.rb +0 -205
  93. data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +0 -195
  94. data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +0 -205
  95. data/lib/ultracart_api/models/rtg_summary_gateway.rb +0 -329
  96. data/lib/ultracart_api/models/rtg_summary_response.rb +0 -240
  97. data/lib/ultracart_api/models/rtg_theme_restriction.rb +0 -239
  98. data/lib/ultracart_api/models/transaction_gateway.rb +0 -823
  99. data/lib/ultracart_api/models/transaction_gateways_request.rb +0 -242
  100. data/lib/ultracart_api/models/transaction_gateways_response.rb +0 -223
@@ -1,279 +0,0 @@
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 PaymentsConfigurationCreditCard
17
- # Master flag indicating whether this merchant accepts credit card payments
18
- attr_accessor :accept_credit_card
19
-
20
- # Description that appears on customer statements
21
- attr_accessor :billed_by
22
-
23
- # If false, order will be accepted and placed into Accounts Receivable without charging card first
24
- attr_accessor :charge_during_checkout
25
-
26
- # UltraCart will require customer to enter cvv if this is true
27
- attr_accessor :collect_cvv2
28
-
29
- # Human readable description of the credit card gateway currently configured
30
- attr_accessor :configured_gateway_details
31
-
32
- # The number of failed attempts before the order is placed into Accounts Receivable for manual intervention
33
- attr_accessor :failed_attempts
34
-
35
- # This internal flag aids the UI in determining which buttons to show.
36
- attr_accessor :hide_connect_single_gateway
37
-
38
- # UltraCart will send customers emails to update their credit card if the card is declined
39
- attr_accessor :send_customer_billing_update_on_decline
40
-
41
- # A list of credit cards the merchant wishes to accept.
42
- attr_accessor :supported_cards
43
-
44
- # An array of test methods for placing test orders. The cards defined here may be real or fake, but any order placed with them will be marked as Test orders
45
- attr_accessor :test_methods
46
-
47
- # Attribute mapping from ruby-style variable name to JSON key.
48
- def self.attribute_map
49
- {
50
- :'accept_credit_card' => :'accept_credit_card',
51
- :'billed_by' => :'billed_by',
52
- :'charge_during_checkout' => :'charge_during_checkout',
53
- :'collect_cvv2' => :'collect_cvv2',
54
- :'configured_gateway_details' => :'configured_gateway_details',
55
- :'failed_attempts' => :'failed_attempts',
56
- :'hide_connect_single_gateway' => :'hide_connect_single_gateway',
57
- :'send_customer_billing_update_on_decline' => :'send_customer_billing_update_on_decline',
58
- :'supported_cards' => :'supported_cards',
59
- :'test_methods' => :'test_methods'
60
- }
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.swagger_types
65
- {
66
- :'accept_credit_card' => :'BOOLEAN',
67
- :'billed_by' => :'String',
68
- :'charge_during_checkout' => :'BOOLEAN',
69
- :'collect_cvv2' => :'BOOLEAN',
70
- :'configured_gateway_details' => :'String',
71
- :'failed_attempts' => :'Integer',
72
- :'hide_connect_single_gateway' => :'BOOLEAN',
73
- :'send_customer_billing_update_on_decline' => :'BOOLEAN',
74
- :'supported_cards' => :'Array<PaymentsConfigurationCreditCardType>',
75
- :'test_methods' => :'Array<PaymentsConfigurationTestMethod>'
76
- }
77
- end
78
-
79
- # Initializes the object
80
- # @param [Hash] attributes Model attributes in the form of hash
81
- def initialize(attributes = {})
82
- return unless attributes.is_a?(Hash)
83
-
84
- # convert string to symbol for hash key
85
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
86
-
87
- if attributes.has_key?(:'accept_credit_card')
88
- self.accept_credit_card = attributes[:'accept_credit_card']
89
- end
90
-
91
- if attributes.has_key?(:'billed_by')
92
- self.billed_by = attributes[:'billed_by']
93
- end
94
-
95
- if attributes.has_key?(:'charge_during_checkout')
96
- self.charge_during_checkout = attributes[:'charge_during_checkout']
97
- end
98
-
99
- if attributes.has_key?(:'collect_cvv2')
100
- self.collect_cvv2 = attributes[:'collect_cvv2']
101
- end
102
-
103
- if attributes.has_key?(:'configured_gateway_details')
104
- self.configured_gateway_details = attributes[:'configured_gateway_details']
105
- end
106
-
107
- if attributes.has_key?(:'failed_attempts')
108
- self.failed_attempts = attributes[:'failed_attempts']
109
- end
110
-
111
- if attributes.has_key?(:'hide_connect_single_gateway')
112
- self.hide_connect_single_gateway = attributes[:'hide_connect_single_gateway']
113
- end
114
-
115
- if attributes.has_key?(:'send_customer_billing_update_on_decline')
116
- self.send_customer_billing_update_on_decline = attributes[:'send_customer_billing_update_on_decline']
117
- end
118
-
119
- if attributes.has_key?(:'supported_cards')
120
- if (value = attributes[:'supported_cards']).is_a?(Array)
121
- self.supported_cards = value
122
- end
123
- end
124
-
125
- if attributes.has_key?(:'test_methods')
126
- if (value = attributes[:'test_methods']).is_a?(Array)
127
- self.test_methods = value
128
- end
129
- end
130
- end
131
-
132
- # Show invalid properties with the reasons. Usually used together with valid?
133
- # @return Array for valid properties with the reasons
134
- def list_invalid_properties
135
- invalid_properties = Array.new
136
- invalid_properties
137
- end
138
-
139
- # Check to see if the all the properties in the model are valid
140
- # @return true if the model is valid
141
- def valid?
142
- true
143
- end
144
-
145
- # Checks equality by comparing each attribute.
146
- # @param [Object] Object to be compared
147
- def ==(o)
148
- return true if self.equal?(o)
149
- self.class == o.class &&
150
- accept_credit_card == o.accept_credit_card &&
151
- billed_by == o.billed_by &&
152
- charge_during_checkout == o.charge_during_checkout &&
153
- collect_cvv2 == o.collect_cvv2 &&
154
- configured_gateway_details == o.configured_gateway_details &&
155
- failed_attempts == o.failed_attempts &&
156
- hide_connect_single_gateway == o.hide_connect_single_gateway &&
157
- send_customer_billing_update_on_decline == o.send_customer_billing_update_on_decline &&
158
- supported_cards == o.supported_cards &&
159
- test_methods == o.test_methods
160
- end
161
-
162
- # @see the `==` method
163
- # @param [Object] Object to be compared
164
- def eql?(o)
165
- self == o
166
- end
167
-
168
- # Calculates hash code according to all attributes.
169
- # @return [Fixnum] Hash code
170
- def hash
171
- [accept_credit_card, billed_by, charge_during_checkout, collect_cvv2, configured_gateway_details, failed_attempts, hide_connect_single_gateway, send_customer_billing_update_on_decline, supported_cards, test_methods].hash
172
- end
173
-
174
- # Builds the object from hash
175
- # @param [Hash] attributes Model attributes in the form of hash
176
- # @return [Object] Returns the model itself
177
- def build_from_hash(attributes)
178
- return nil unless attributes.is_a?(Hash)
179
- self.class.swagger_types.each_pair do |key, type|
180
- if type =~ /\AArray<(.*)>/i
181
- # check to ensure the input is an array given that the attribute
182
- # is documented as an array but the input is not
183
- if attributes[self.class.attribute_map[key]].is_a?(Array)
184
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
- end
186
- elsif !attributes[self.class.attribute_map[key]].nil?
187
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
- end # or else data not found in attributes(hash), not an issue as the data can be optional
189
- end
190
-
191
- self
192
- end
193
-
194
- # Deserializes the data based on type
195
- # @param string type Data type
196
- # @param string value Value to be deserialized
197
- # @return [Object] Deserialized data
198
- def _deserialize(type, value)
199
- case type.to_sym
200
- when :DateTime
201
- DateTime.parse(value)
202
- when :Date
203
- Date.parse(value)
204
- when :String
205
- value.to_s
206
- when :Integer
207
- value.to_i
208
- when :Float
209
- value.to_f
210
- when :BOOLEAN
211
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
- true
213
- else
214
- false
215
- end
216
- when :Object
217
- # generic object (usually a Hash), return directly
218
- value
219
- when /\AArray<(?<inner_type>.+)>\z/
220
- inner_type = Regexp.last_match[:inner_type]
221
- value.map { |v| _deserialize(inner_type, v) }
222
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
- k_type = Regexp.last_match[:k_type]
224
- v_type = Regexp.last_match[:v_type]
225
- {}.tap do |hash|
226
- value.each do |k, v|
227
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
- end
229
- end
230
- else # model
231
- temp_model = UltracartClient.const_get(type).new
232
- temp_model.build_from_hash(value)
233
- end
234
- end
235
-
236
- # Returns the string representation of the object
237
- # @return [String] String presentation of the object
238
- def to_s
239
- to_hash.to_s
240
- end
241
-
242
- # to_body is an alias to to_hash (backward compatibility)
243
- # @return [Hash] Returns the object in the form of hash
244
- def to_body
245
- to_hash
246
- end
247
-
248
- # Returns the object in the form of hash
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_hash
251
- hash = {}
252
- self.class.attribute_map.each_pair do |attr, param|
253
- value = self.send(attr)
254
- next if value.nil?
255
- hash[param] = _to_hash(value)
256
- end
257
- hash
258
- end
259
-
260
- # Outputs non-array value in the form of hash
261
- # For object, use to_hash. Otherwise, just return the value
262
- # @param [Object] value Any valid value
263
- # @return [Hash] Returns the value in the form of hash
264
- def _to_hash(value)
265
- if value.is_a?(Array)
266
- value.compact.map { |v| _to_hash(v) }
267
- elsif value.is_a?(Hash)
268
- {}.tap do |hash|
269
- value.each { |k, v| hash[k] = _to_hash(v) }
270
- end
271
- elsif value.respond_to? :to_hash
272
- value.to_hash
273
- else
274
- value
275
- end
276
- end
277
-
278
- end
279
- end
@@ -1,318 +0,0 @@
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 PaymentsConfigurationCreditCardType
17
- # Optional field used for Quickbooks integrations to match this credit card with the corresponding payment type in Quickbooks
18
- attr_accessor :accounting_code
19
-
20
- # Internally used icon information for this card type
21
- attr_accessor :card_type_icon
22
-
23
- # Credit card type
24
- attr_accessor :credit_card
25
-
26
- # The name of the account to deposit funds
27
- attr_accessor :deposit_to_account
28
-
29
- # If true, this card type will be accepted during checkout
30
- attr_accessor :enabled
31
-
32
- # Optional additional fee applied to order for this card
33
- attr_accessor :processing_fee
34
-
35
- # Optional additional fee applied to order for this card
36
- attr_accessor :processing_percentage
37
-
38
- attr_accessor :restrictions
39
-
40
- # Optional field. If integrated with Quickbooks, this code will be used when informing Quickbooks about any surcharges applied to orders
41
- attr_accessor :surcharge_accounting_code
42
-
43
- # An optional additional fee to charge the customer for using this card.
44
- attr_accessor :transaction_fee
45
-
46
- # An optional transaction percentage to charge the customer for using this card
47
- attr_accessor :transaction_percentage
48
-
49
- class EnumAttributeValidator
50
- attr_reader :datatype
51
- attr_reader :allowable_values
52
-
53
- def initialize(datatype, allowable_values)
54
- @allowable_values = allowable_values.map do |value|
55
- case datatype.to_s
56
- when /Integer/i
57
- value.to_i
58
- when /Float/i
59
- value.to_f
60
- else
61
- value
62
- end
63
- end
64
- end
65
-
66
- def valid?(value)
67
- !value || allowable_values.include?(value)
68
- end
69
- end
70
-
71
- # Attribute mapping from ruby-style variable name to JSON key.
72
- def self.attribute_map
73
- {
74
- :'accounting_code' => :'accounting_code',
75
- :'card_type_icon' => :'card_type_icon',
76
- :'credit_card' => :'credit_card',
77
- :'deposit_to_account' => :'deposit_to_account',
78
- :'enabled' => :'enabled',
79
- :'processing_fee' => :'processing_fee',
80
- :'processing_percentage' => :'processing_percentage',
81
- :'restrictions' => :'restrictions',
82
- :'surcharge_accounting_code' => :'surcharge_accounting_code',
83
- :'transaction_fee' => :'transaction_fee',
84
- :'transaction_percentage' => :'transaction_percentage'
85
- }
86
- end
87
-
88
- # Attribute type mapping.
89
- def self.swagger_types
90
- {
91
- :'accounting_code' => :'String',
92
- :'card_type_icon' => :'String',
93
- :'credit_card' => :'String',
94
- :'deposit_to_account' => :'String',
95
- :'enabled' => :'BOOLEAN',
96
- :'processing_fee' => :'Float',
97
- :'processing_percentage' => :'Float',
98
- :'restrictions' => :'PaymentsConfigurationRestrictions',
99
- :'surcharge_accounting_code' => :'String',
100
- :'transaction_fee' => :'Float',
101
- :'transaction_percentage' => :'Float'
102
- }
103
- end
104
-
105
- # Initializes the object
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- def initialize(attributes = {})
108
- return unless attributes.is_a?(Hash)
109
-
110
- # convert string to symbol for hash key
111
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
112
-
113
- if attributes.has_key?(:'accounting_code')
114
- self.accounting_code = attributes[:'accounting_code']
115
- end
116
-
117
- if attributes.has_key?(:'card_type_icon')
118
- self.card_type_icon = attributes[:'card_type_icon']
119
- end
120
-
121
- if attributes.has_key?(:'credit_card')
122
- self.credit_card = attributes[:'credit_card']
123
- end
124
-
125
- if attributes.has_key?(:'deposit_to_account')
126
- self.deposit_to_account = attributes[:'deposit_to_account']
127
- end
128
-
129
- if attributes.has_key?(:'enabled')
130
- self.enabled = attributes[:'enabled']
131
- end
132
-
133
- if attributes.has_key?(:'processing_fee')
134
- self.processing_fee = attributes[:'processing_fee']
135
- end
136
-
137
- if attributes.has_key?(:'processing_percentage')
138
- self.processing_percentage = attributes[:'processing_percentage']
139
- end
140
-
141
- if attributes.has_key?(:'restrictions')
142
- self.restrictions = attributes[:'restrictions']
143
- end
144
-
145
- if attributes.has_key?(:'surcharge_accounting_code')
146
- self.surcharge_accounting_code = attributes[:'surcharge_accounting_code']
147
- end
148
-
149
- if attributes.has_key?(:'transaction_fee')
150
- self.transaction_fee = attributes[:'transaction_fee']
151
- end
152
-
153
- if attributes.has_key?(:'transaction_percentage')
154
- self.transaction_percentage = attributes[:'transaction_percentage']
155
- end
156
- end
157
-
158
- # Show invalid properties with the reasons. Usually used together with valid?
159
- # @return Array for valid properties with the reasons
160
- def list_invalid_properties
161
- invalid_properties = Array.new
162
- invalid_properties
163
- end
164
-
165
- # Check to see if the all the properties in the model are valid
166
- # @return true if the model is valid
167
- def valid?
168
- credit_card_validator = EnumAttributeValidator.new('String', ['AMEX', 'Diners Club', 'Discover', 'MasterCard', 'JCB', 'VISA'])
169
- return false unless credit_card_validator.valid?(@credit_card)
170
- true
171
- end
172
-
173
- # Custom attribute writer method checking allowed values (enum).
174
- # @param [Object] credit_card Object to be assigned
175
- def credit_card=(credit_card)
176
- validator = EnumAttributeValidator.new('String', ['AMEX', 'Diners Club', 'Discover', 'MasterCard', 'JCB', 'VISA'])
177
- unless validator.valid?(credit_card)
178
- fail ArgumentError, 'invalid value for "credit_card", must be one of #{validator.allowable_values}.'
179
- end
180
- @credit_card = credit_card
181
- end
182
-
183
- # Checks equality by comparing each attribute.
184
- # @param [Object] Object to be compared
185
- def ==(o)
186
- return true if self.equal?(o)
187
- self.class == o.class &&
188
- accounting_code == o.accounting_code &&
189
- card_type_icon == o.card_type_icon &&
190
- credit_card == o.credit_card &&
191
- deposit_to_account == o.deposit_to_account &&
192
- enabled == o.enabled &&
193
- processing_fee == o.processing_fee &&
194
- processing_percentage == o.processing_percentage &&
195
- restrictions == o.restrictions &&
196
- surcharge_accounting_code == o.surcharge_accounting_code &&
197
- transaction_fee == o.transaction_fee &&
198
- transaction_percentage == o.transaction_percentage
199
- end
200
-
201
- # @see the `==` method
202
- # @param [Object] Object to be compared
203
- def eql?(o)
204
- self == o
205
- end
206
-
207
- # Calculates hash code according to all attributes.
208
- # @return [Fixnum] Hash code
209
- def hash
210
- [accounting_code, card_type_icon, credit_card, deposit_to_account, enabled, processing_fee, processing_percentage, restrictions, surcharge_accounting_code, transaction_fee, transaction_percentage].hash
211
- end
212
-
213
- # Builds the object from hash
214
- # @param [Hash] attributes Model attributes in the form of hash
215
- # @return [Object] Returns the model itself
216
- def build_from_hash(attributes)
217
- return nil unless attributes.is_a?(Hash)
218
- self.class.swagger_types.each_pair do |key, type|
219
- if type =~ /\AArray<(.*)>/i
220
- # check to ensure the input is an array given that the attribute
221
- # is documented as an array but the input is not
222
- if attributes[self.class.attribute_map[key]].is_a?(Array)
223
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
- end
225
- elsif !attributes[self.class.attribute_map[key]].nil?
226
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
- end # or else data not found in attributes(hash), not an issue as the data can be optional
228
- end
229
-
230
- self
231
- end
232
-
233
- # Deserializes the data based on type
234
- # @param string type Data type
235
- # @param string value Value to be deserialized
236
- # @return [Object] Deserialized data
237
- def _deserialize(type, value)
238
- case type.to_sym
239
- when :DateTime
240
- DateTime.parse(value)
241
- when :Date
242
- Date.parse(value)
243
- when :String
244
- value.to_s
245
- when :Integer
246
- value.to_i
247
- when :Float
248
- value.to_f
249
- when :BOOLEAN
250
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
- true
252
- else
253
- false
254
- end
255
- when :Object
256
- # generic object (usually a Hash), return directly
257
- value
258
- when /\AArray<(?<inner_type>.+)>\z/
259
- inner_type = Regexp.last_match[:inner_type]
260
- value.map { |v| _deserialize(inner_type, v) }
261
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
- k_type = Regexp.last_match[:k_type]
263
- v_type = Regexp.last_match[:v_type]
264
- {}.tap do |hash|
265
- value.each do |k, v|
266
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
- end
268
- end
269
- else # model
270
- temp_model = UltracartClient.const_get(type).new
271
- temp_model.build_from_hash(value)
272
- end
273
- end
274
-
275
- # Returns the string representation of the object
276
- # @return [String] String presentation of the object
277
- def to_s
278
- to_hash.to_s
279
- end
280
-
281
- # to_body is an alias to to_hash (backward compatibility)
282
- # @return [Hash] Returns the object in the form of hash
283
- def to_body
284
- to_hash
285
- end
286
-
287
- # Returns the object in the form of hash
288
- # @return [Hash] Returns the object in the form of hash
289
- def to_hash
290
- hash = {}
291
- self.class.attribute_map.each_pair do |attr, param|
292
- value = self.send(attr)
293
- next if value.nil?
294
- hash[param] = _to_hash(value)
295
- end
296
- hash
297
- end
298
-
299
- # Outputs non-array value in the form of hash
300
- # For object, use to_hash. Otherwise, just return the value
301
- # @param [Object] value Any valid value
302
- # @return [Hash] Returns the value in the form of hash
303
- def _to_hash(value)
304
- if value.is_a?(Array)
305
- value.compact.map { |v| _to_hash(v) }
306
- elsif value.is_a?(Hash)
307
- {}.tap do |hash|
308
- value.each { |k, v| hash[k] = _to_hash(v) }
309
- end
310
- elsif value.respond_to? :to_hash
311
- value.to_hash
312
- else
313
- value
314
- end
315
- end
316
-
317
- end
318
- end