square_connect 2.20190508.0.304 → 2.20190612.0.309
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -4
- data/README.md +13 -1
- data/docs/AggregationStrategy.md +15 -0
- data/docs/ApplePayApi.md +1 -1
- data/docs/BatchRetrieveCatalogObjectsRequest.md +1 -1
- data/docs/Card.md +1 -1
- data/docs/CatalogApi.md +3 -3
- data/docs/CatalogInfoResponse.md +1 -0
- data/docs/CatalogItem.md +1 -1
- data/docs/CatalogItemVariation.md +3 -1
- data/docs/CatalogMeasurementUnit.md +13 -0
- data/docs/CatalogObject.md +1 -0
- data/docs/CatalogObjectType.md +3 -0
- data/docs/CatalogPricingRule.md +24 -0
- data/docs/CatalogProductSet.md +18 -0
- data/docs/CatalogTimePeriod.md +12 -0
- data/docs/Coordinates.md +13 -0
- data/docs/CreateOrderRequest.md +1 -1
- data/docs/DayOfWeek.md +1 -1
- data/docs/ErrorCode.md +1 -0
- data/docs/Location.md +6 -0
- data/docs/MeasurementUnit.md +1 -0
- data/docs/MeasurementUnitGeneric.md +13 -0
- data/docs/OAuthApi.md +1 -1
- data/docs/ObtainTokenResponse.md +2 -2
- data/docs/Order.md +13 -11
- data/docs/OrderLineItem.md +5 -5
- data/docs/OrderLineItemDiscount.md +1 -1
- data/docs/OrderLineItemModifier.md +1 -1
- data/docs/OrderLineItemTax.md +1 -1
- data/docs/OrderReturn.md +2 -1
- data/docs/OrderReturnDiscount.md +1 -1
- data/docs/OrderReturnLineItem.md +4 -4
- data/docs/OrderReturnLineItemModifier.md +1 -1
- data/docs/OrderReturnServiceCharge.md +23 -0
- data/docs/OrderReturnTax.md +1 -1
- data/docs/OrderRoundingAdjustment.md +1 -1
- data/docs/OrderServiceCharge.md +22 -0
- data/docs/OrderServiceChargeCalculationPhase.md +13 -0
- data/docs/OrdersApi.md +1 -1
- data/docs/RenewTokenResponse.md +2 -2
- data/docs/RetrieveCatalogObjectRequest.md +1 -1
- data/docs/SearchCatalogObjectsRequest.md +1 -1
- data/docs/StandardUnitDescription.md +14 -0
- data/docs/StandardUnitDescriptionGroup.md +13 -0
- data/lib/square_connect.rb +12 -0
- data/lib/square_connect/api/apple_pay_api.rb +3 -3
- data/lib/square_connect/api/catalog_api.rb +15 -15
- data/lib/square_connect/api/checkout_api.rb +1 -1
- data/lib/square_connect/api/customers_api.rb +8 -8
- data/lib/square_connect/api/employees_api.rb +2 -2
- data/lib/square_connect/api/inventory_api.rb +7 -7
- data/lib/square_connect/api/labor_api.rb +14 -14
- data/lib/square_connect/api/locations_api.rb +1 -1
- data/lib/square_connect/api/mobile_authorization_api.rb +1 -1
- data/lib/square_connect/api/o_auth_api.rb +5 -5
- data/lib/square_connect/api/orders_api.rb +5 -5
- data/lib/square_connect/api/reporting_api.rb +2 -2
- data/lib/square_connect/api/transactions_api.rb +7 -7
- data/lib/square_connect/api/v1_employees_api.rb +16 -16
- data/lib/square_connect/api/v1_items_api.rb +40 -40
- data/lib/square_connect/api/v1_locations_api.rb +2 -2
- data/lib/square_connect/api/v1_transactions_api.rb +11 -11
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/aggregation_strategy.rb +21 -0
- data/lib/square_connect/models/batch_retrieve_catalog_objects_request.rb +1 -1
- data/lib/square_connect/models/card.rb +1 -1
- data/lib/square_connect/models/catalog_info_response.rb +14 -4
- data/lib/square_connect/models/catalog_item.rb +1 -1
- data/lib/square_connect/models/catalog_item_variation.rb +25 -5
- data/lib/square_connect/models/catalog_measurement_unit.rb +196 -0
- data/lib/square_connect/models/catalog_object.rb +16 -6
- data/lib/square_connect/models/catalog_object_type.rb +3 -0
- data/lib/square_connect/models/catalog_pricing_rule.rb +341 -0
- data/lib/square_connect/models/catalog_product_set.rb +250 -0
- data/lib/square_connect/models/catalog_time_period.rb +186 -0
- data/lib/square_connect/models/coordinates.rb +196 -0
- data/lib/square_connect/models/create_order_request.rb +1 -1
- data/lib/square_connect/models/error.rb +2 -2
- data/lib/square_connect/models/error_code.rb +1 -0
- data/lib/square_connect/models/location.rb +64 -4
- data/lib/square_connect/models/measurement_unit.rb +26 -4
- data/lib/square_connect/models/measurement_unit_generic.rb +19 -0
- data/lib/square_connect/models/money.rb +0 -16
- data/lib/square_connect/models/obtain_token_response.rb +2 -2
- data/lib/square_connect/models/order.rb +37 -15
- data/lib/square_connect/models/order_line_item.rb +5 -5
- data/lib/square_connect/models/order_line_item_discount.rb +1 -1
- data/lib/square_connect/models/order_line_item_modifier.rb +1 -1
- data/lib/square_connect/models/order_line_item_tax.rb +1 -1
- data/lib/square_connect/models/order_return.rb +14 -2
- data/lib/square_connect/models/order_return_discount.rb +1 -1
- data/lib/square_connect/models/order_return_line_item.rb +4 -4
- data/lib/square_connect/models/order_return_line_item_modifier.rb +1 -1
- data/lib/square_connect/models/order_return_service_charge.rb +411 -0
- data/lib/square_connect/models/order_return_tax.rb +1 -1
- data/lib/square_connect/models/order_rounding_adjustment.rb +1 -1
- data/lib/square_connect/models/order_service_charge.rb +385 -0
- data/lib/square_connect/models/order_service_charge_calculation_phase.rb +19 -0
- data/lib/square_connect/models/renew_token_response.rb +2 -2
- data/lib/square_connect/models/retrieve_catalog_object_request.rb +1 -1
- data/lib/square_connect/models/search_catalog_objects_request.rb +1 -1
- data/lib/square_connect/models/standard_unit_description.rb +206 -0
- data/lib/square_connect/models/standard_unit_description_group.rb +198 -0
- data/lib/square_connect/version.rb +1 -1
- data/spec/models/aggregation_strategy_spec.rb +33 -0
- data/spec/models/catalog_measurement_unit_spec.rb +45 -0
- data/spec/models/catalog_pricing_rule_spec.rb +115 -0
- data/spec/models/catalog_product_set_spec.rb +75 -0
- data/spec/models/catalog_time_period_spec.rb +39 -0
- data/spec/models/coordinates_spec.rb +45 -0
- data/spec/models/measurement_unit_generic_spec.rb +33 -0
- data/spec/models/order_return_service_charge_spec.rb +109 -0
- data/spec/models/order_service_charge_calculation_phase_spec.rb +33 -0
- data/spec/models/order_service_charge_spec.rb +103 -0
- data/spec/models/standard_unit_description_group_spec.rb +45 -0
- data/spec/models/standard_unit_description_spec.rb +51 -0
- metadata +50 -2
@@ -27,6 +27,9 @@ module SquareConnect
|
|
27
27
|
# Represents a standard unit of weight or mass. See [MeasurementUnitWeight](#type-measurementunitweight) for possible values
|
28
28
|
attr_accessor :weight_unit
|
29
29
|
|
30
|
+
# Reserved for API integrations that lack the ability to specify a real measurement unit See [MeasurementUnitGeneric](#type-measurementunitgeneric) for possible values
|
31
|
+
attr_accessor :generic_unit
|
32
|
+
|
30
33
|
class EnumAttributeValidator
|
31
34
|
attr_reader :datatype
|
32
35
|
attr_reader :allowable_values
|
@@ -56,7 +59,8 @@ module SquareConnect
|
|
56
59
|
:'area_unit' => :'area_unit',
|
57
60
|
:'length_unit' => :'length_unit',
|
58
61
|
:'volume_unit' => :'volume_unit',
|
59
|
-
:'weight_unit' => :'weight_unit'
|
62
|
+
:'weight_unit' => :'weight_unit',
|
63
|
+
:'generic_unit' => :'generic_unit'
|
60
64
|
}
|
61
65
|
end
|
62
66
|
|
@@ -67,7 +71,8 @@ module SquareConnect
|
|
67
71
|
:'area_unit' => :'String',
|
68
72
|
:'length_unit' => :'String',
|
69
73
|
:'volume_unit' => :'String',
|
70
|
-
:'weight_unit' => :'String'
|
74
|
+
:'weight_unit' => :'String',
|
75
|
+
:'generic_unit' => :'String'
|
71
76
|
}
|
72
77
|
end
|
73
78
|
|
@@ -99,6 +104,10 @@ module SquareConnect
|
|
99
104
|
self.weight_unit = attributes[:'weight_unit']
|
100
105
|
end
|
101
106
|
|
107
|
+
if attributes.has_key?(:'generic_unit')
|
108
|
+
self.generic_unit = attributes[:'generic_unit']
|
109
|
+
end
|
110
|
+
|
102
111
|
end
|
103
112
|
|
104
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -119,6 +128,8 @@ module SquareConnect
|
|
119
128
|
return false unless volume_unit_validator.valid?(@volume_unit)
|
120
129
|
weight_unit_validator = EnumAttributeValidator.new('String', ["IMPERIAL_WEIGHT_OUNCE", "IMPERIAL_POUND", "IMPERIAL_STONE", "METRIC_MILLIGRAM", "METRIC_GRAM", "METRIC_KILOGRAM"])
|
121
130
|
return false unless weight_unit_validator.valid?(@weight_unit)
|
131
|
+
generic_unit_validator = EnumAttributeValidator.new('String', ["INVALID_GENERIC_UNIT", "UNIT"])
|
132
|
+
return false unless generic_unit_validator.valid?(@generic_unit)
|
122
133
|
return true
|
123
134
|
end
|
124
135
|
|
@@ -162,6 +173,16 @@ module SquareConnect
|
|
162
173
|
@weight_unit = weight_unit
|
163
174
|
end
|
164
175
|
|
176
|
+
# Custom attribute writer method checking allowed values (enum).
|
177
|
+
# @param [Object] generic_unit Object to be assigned
|
178
|
+
def generic_unit=(generic_unit)
|
179
|
+
validator = EnumAttributeValidator.new('String', ["INVALID_GENERIC_UNIT", "UNIT"])
|
180
|
+
unless validator.valid?(generic_unit)
|
181
|
+
fail ArgumentError, "invalid value for 'generic_unit', must be one of #{validator.allowable_values}."
|
182
|
+
end
|
183
|
+
@generic_unit = generic_unit
|
184
|
+
end
|
185
|
+
|
165
186
|
# Checks equality by comparing each attribute.
|
166
187
|
# @param [Object] Object to be compared
|
167
188
|
def ==(o)
|
@@ -171,7 +192,8 @@ module SquareConnect
|
|
171
192
|
area_unit == o.area_unit &&
|
172
193
|
length_unit == o.length_unit &&
|
173
194
|
volume_unit == o.volume_unit &&
|
174
|
-
weight_unit == o.weight_unit
|
195
|
+
weight_unit == o.weight_unit &&
|
196
|
+
generic_unit == o.generic_unit
|
175
197
|
end
|
176
198
|
|
177
199
|
# @see the `==` method
|
@@ -183,7 +205,7 @@ module SquareConnect
|
|
183
205
|
# Calculates hash code according to all attributes.
|
184
206
|
# @return [Fixnum] Hash code
|
185
207
|
def hash
|
186
|
-
[custom_unit, area_unit, length_unit, volume_unit, weight_unit].hash
|
208
|
+
[custom_unit, area_unit, length_unit, volume_unit, weight_unit, generic_unit].hash
|
187
209
|
end
|
188
210
|
|
189
211
|
# Builds the object from hash
|
@@ -0,0 +1,19 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
class MeasurementUnitGeneric
|
14
|
+
|
15
|
+
INVALID_GENERIC_UNIT = "INVALID_GENERIC_UNIT".freeze
|
16
|
+
UNIT = "UNIT".freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -78,33 +78,17 @@ module SquareConnect
|
|
78
78
|
# @return Array for valid properies with the reasons
|
79
79
|
def list_invalid_properties
|
80
80
|
invalid_properties = Array.new
|
81
|
-
if !@amount.nil? && @amount < 0
|
82
|
-
invalid_properties.push("invalid value for 'amount', must be greater than or equal to 0.")
|
83
|
-
end
|
84
|
-
|
85
81
|
return invalid_properties
|
86
82
|
end
|
87
83
|
|
88
84
|
# Check to see if the all the properties in the model are valid
|
89
85
|
# @return true if the model is valid
|
90
86
|
def valid?
|
91
|
-
return false if !@amount.nil? && @amount < 0
|
92
87
|
currency_validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
|
93
88
|
return false unless currency_validator.valid?(@currency)
|
94
89
|
return true
|
95
90
|
end
|
96
91
|
|
97
|
-
# Custom attribute writer method with validation
|
98
|
-
# @param [Object] amount Value to be assigned
|
99
|
-
def amount=(amount)
|
100
|
-
|
101
|
-
if !amount.nil? && amount < 0
|
102
|
-
fail ArgumentError, "invalid value for 'amount', must be greater than or equal to 0."
|
103
|
-
end
|
104
|
-
|
105
|
-
@amount = amount
|
106
|
-
end
|
107
|
-
|
108
92
|
# Custom attribute writer method checking allowed values (enum).
|
109
93
|
# @param [Object] currency Object to be assigned
|
110
94
|
def currency=(currency)
|
@@ -24,10 +24,10 @@ module SquareConnect
|
|
24
24
|
# The ID of the authorizing merchant's business.
|
25
25
|
attr_accessor :merchant_id
|
26
26
|
|
27
|
-
#
|
27
|
+
# __LEGACY FIELD__. The ID of a subscription plan the merchant signed up for. Only present if the merchant signed up for a subscription during authorization.
|
28
28
|
attr_accessor :subscription_id
|
29
29
|
|
30
|
-
# The ID of the
|
30
|
+
# __LEGACY FIELD__. The ID of the subscription plan the merchant signed up for. Only present if the merchant signed up for a subscription during authorization.
|
31
31
|
attr_accessor :plan_id
|
32
32
|
|
33
33
|
# Then OpenID token belonging to this this person. Only present if the OPENID scope is included in the authorize request.
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# Contains all information related to a single order to process with Square, including line items that specify the products to purchase. Order objects also include information on any associated tenders, refunds, and returns. All Connect V2 Transactions have all been converted to Orders including all associated itemization data.
|
14
14
|
class Order
|
15
|
-
# The order's unique ID. This
|
15
|
+
# The order's unique ID. This field is read-only.
|
16
16
|
attr_accessor :id
|
17
17
|
|
18
18
|
# The ID of the merchant location this order is associated with.
|
@@ -36,19 +36,22 @@ module SquareConnect
|
|
36
36
|
# A list of discounts applied to this order. On read or retrieve, this list includes both order-level and item-level discounts. When creating an Order, set your order-level discounts in this list.
|
37
37
|
attr_accessor :discounts
|
38
38
|
|
39
|
+
# A list of service charges applied to the order.
|
40
|
+
attr_accessor :service_charges
|
41
|
+
|
39
42
|
# Details on order fulfillment. Orders can only be created with at most one fulfillment. However, orders returned by the API may contain multiple fulfillments.
|
40
43
|
attr_accessor :fulfillments
|
41
44
|
|
42
|
-
# Collection of items from sale Orders being returned in this one. Normally part of an Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being referenced.
|
45
|
+
# Collection of items from sale Orders being returned in this one. Normally part of an Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being referenced. This field is read-only.
|
43
46
|
attr_accessor :returns
|
44
47
|
|
45
|
-
# Rollup of returned money amounts.
|
48
|
+
# Rollup of returned money amounts. This field is read-only.
|
46
49
|
attr_accessor :return_amounts
|
47
50
|
|
48
|
-
# Net money amounts (sale money - return money).
|
51
|
+
# Net money amounts (sale money - return money). This field is read-only.
|
49
52
|
attr_accessor :net_amounts
|
50
53
|
|
51
|
-
# A positive or negative rounding adjustment to the total of the order, commonly used to apply Cash Rounding when the minimum unit of account is smaller than the lowest physical denomination of currency.
|
54
|
+
# A positive or negative rounding adjustment to the total of the order, commonly used to apply Cash Rounding when the minimum unit of account is smaller than the lowest physical denomination of currency. This field is read-only.
|
52
55
|
attr_accessor :rounding_adjustment
|
53
56
|
|
54
57
|
# The Tenders which were used to pay for the Order. This field is read-only.
|
@@ -57,27 +60,30 @@ module SquareConnect
|
|
57
60
|
# The Refunds that are part of this Order. This field is read-only.
|
58
61
|
attr_accessor :refunds
|
59
62
|
|
60
|
-
# Timestamp for when the order was created. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\".
|
63
|
+
# Timestamp for when the order was created. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This field is read-only.
|
61
64
|
attr_accessor :created_at
|
62
65
|
|
63
|
-
# Timestamp for when the order was last updated. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\".
|
66
|
+
# Timestamp for when the order was last updated. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This field is read-only.
|
64
67
|
attr_accessor :updated_at
|
65
68
|
|
66
|
-
# Timestamp for when the order was closed. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\".
|
69
|
+
# Timestamp for when the order was closed. In RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This field is read-only.
|
67
70
|
attr_accessor :closed_at
|
68
71
|
|
69
72
|
# The current state of the order. `OPEN`,`COMPLETED`,`CANCELED` See [OrderState](#type-orderstate) for possible values
|
70
73
|
attr_accessor :state
|
71
74
|
|
72
|
-
# The total amount of money to collect for the order.
|
75
|
+
# The total amount of money to collect for the order. This field is read-only.
|
73
76
|
attr_accessor :total_money
|
74
77
|
|
75
|
-
# The total tax amount of money to collect for the order.
|
78
|
+
# The total tax amount of money to collect for the order. This field is read-only.
|
76
79
|
attr_accessor :total_tax_money
|
77
80
|
|
78
|
-
# The total discount amount of money to collect for the order.
|
81
|
+
# The total discount amount of money to collect for the order. This field is read-only.
|
79
82
|
attr_accessor :total_discount_money
|
80
83
|
|
84
|
+
# The total amount of money collected in service charges for the order. Note: `total_service_charge_money` is the sum of `applied_money` fields for each individual service charge. Therefore, `total_service_charge_money` will only include inclusive tax amounts, not additive tax amounts. This field is read-only.
|
85
|
+
attr_accessor :total_service_charge_money
|
86
|
+
|
81
87
|
class EnumAttributeValidator
|
82
88
|
attr_reader :datatype
|
83
89
|
attr_reader :allowable_values
|
@@ -111,6 +117,7 @@ module SquareConnect
|
|
111
117
|
:'line_items' => :'line_items',
|
112
118
|
:'taxes' => :'taxes',
|
113
119
|
:'discounts' => :'discounts',
|
120
|
+
:'service_charges' => :'service_charges',
|
114
121
|
:'fulfillments' => :'fulfillments',
|
115
122
|
:'returns' => :'returns',
|
116
123
|
:'return_amounts' => :'return_amounts',
|
@@ -124,7 +131,8 @@ module SquareConnect
|
|
124
131
|
:'state' => :'state',
|
125
132
|
:'total_money' => :'total_money',
|
126
133
|
:'total_tax_money' => :'total_tax_money',
|
127
|
-
:'total_discount_money' => :'total_discount_money'
|
134
|
+
:'total_discount_money' => :'total_discount_money',
|
135
|
+
:'total_service_charge_money' => :'total_service_charge_money'
|
128
136
|
}
|
129
137
|
end
|
130
138
|
|
@@ -139,6 +147,7 @@ module SquareConnect
|
|
139
147
|
:'line_items' => :'Array<OrderLineItem>',
|
140
148
|
:'taxes' => :'Array<OrderLineItemTax>',
|
141
149
|
:'discounts' => :'Array<OrderLineItemDiscount>',
|
150
|
+
:'service_charges' => :'Array<OrderServiceCharge>',
|
142
151
|
:'fulfillments' => :'Array<OrderFulfillment>',
|
143
152
|
:'returns' => :'Array<OrderReturn>',
|
144
153
|
:'return_amounts' => :'OrderMoneyAmounts',
|
@@ -152,7 +161,8 @@ module SquareConnect
|
|
152
161
|
:'state' => :'String',
|
153
162
|
:'total_money' => :'Money',
|
154
163
|
:'total_tax_money' => :'Money',
|
155
|
-
:'total_discount_money' => :'Money'
|
164
|
+
:'total_discount_money' => :'Money',
|
165
|
+
:'total_service_charge_money' => :'Money'
|
156
166
|
}
|
157
167
|
end
|
158
168
|
|
@@ -202,6 +212,12 @@ module SquareConnect
|
|
202
212
|
end
|
203
213
|
end
|
204
214
|
|
215
|
+
if attributes.has_key?(:'service_charges')
|
216
|
+
if (value = attributes[:'service_charges']).is_a?(Array)
|
217
|
+
self.service_charges = value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
205
221
|
if attributes.has_key?(:'fulfillments')
|
206
222
|
if (value = attributes[:'fulfillments']).is_a?(Array)
|
207
223
|
self.fulfillments = value
|
@@ -266,6 +282,10 @@ module SquareConnect
|
|
266
282
|
self.total_discount_money = attributes[:'total_discount_money']
|
267
283
|
end
|
268
284
|
|
285
|
+
if attributes.has_key?(:'total_service_charge_money')
|
286
|
+
self.total_service_charge_money = attributes[:'total_service_charge_money']
|
287
|
+
end
|
288
|
+
|
269
289
|
end
|
270
290
|
|
271
291
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -346,6 +366,7 @@ module SquareConnect
|
|
346
366
|
line_items == o.line_items &&
|
347
367
|
taxes == o.taxes &&
|
348
368
|
discounts == o.discounts &&
|
369
|
+
service_charges == o.service_charges &&
|
349
370
|
fulfillments == o.fulfillments &&
|
350
371
|
returns == o.returns &&
|
351
372
|
return_amounts == o.return_amounts &&
|
@@ -359,7 +380,8 @@ module SquareConnect
|
|
359
380
|
state == o.state &&
|
360
381
|
total_money == o.total_money &&
|
361
382
|
total_tax_money == o.total_tax_money &&
|
362
|
-
total_discount_money == o.total_discount_money
|
383
|
+
total_discount_money == o.total_discount_money &&
|
384
|
+
total_service_charge_money == o.total_service_charge_money
|
363
385
|
end
|
364
386
|
|
365
387
|
# @see the `==` method
|
@@ -371,7 +393,7 @@ module SquareConnect
|
|
371
393
|
# Calculates hash code according to all attributes.
|
372
394
|
# @return [Fixnum] Hash code
|
373
395
|
def hash
|
374
|
-
[id, location_id, reference_id, source, customer_id, line_items, taxes, discounts, fulfillments, returns, return_amounts, net_amounts, rounding_adjustment, tenders, refunds, created_at, updated_at, closed_at, state, total_money, total_tax_money, total_discount_money].hash
|
396
|
+
[id, location_id, reference_id, source, customer_id, line_items, taxes, discounts, service_charges, fulfillments, returns, return_amounts, net_amounts, rounding_adjustment, tenders, refunds, created_at, updated_at, closed_at, state, total_money, total_tax_money, total_discount_money, total_service_charge_money].hash
|
375
397
|
end
|
376
398
|
|
377
399
|
# Builds the object from hash
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# Represents a line item in an order. Each line item describes a different product to purchase, with its own quantity and price details.
|
14
14
|
class OrderLineItem
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the line item only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# The name of the line item.
|
@@ -48,16 +48,16 @@ module SquareConnect
|
|
48
48
|
# The total price of all item variations sold in this line item. Calculated as `base_price_money` multiplied by `quantity`. Does not include modifiers.
|
49
49
|
attr_accessor :variation_total_price_money
|
50
50
|
|
51
|
-
# The amount of money made in gross sales for this line item. Calculated as the sum of the variation's total price and each modifier's total price.
|
51
|
+
# The amount of money made in gross sales for this line item. Calculated as the sum of the variation's total price and each modifier's total price. This field is read-only.
|
52
52
|
attr_accessor :gross_sales_money
|
53
53
|
|
54
|
-
# The total tax amount of money to collect for the line item.
|
54
|
+
# The total tax amount of money to collect for the line item. This field is read-only.
|
55
55
|
attr_accessor :total_tax_money
|
56
56
|
|
57
|
-
# The total discount amount of money to collect for the line item.
|
57
|
+
# The total discount amount of money to collect for the line item. This field is read-only.
|
58
58
|
attr_accessor :total_discount_money
|
59
59
|
|
60
|
-
# The total amount of money to collect for this line item.
|
60
|
+
# The total amount of money to collect for this line item. This field is read-only.
|
61
61
|
attr_accessor :total_money
|
62
62
|
|
63
63
|
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# Represents a discount that applies to one or more line items in an order. Fixed-amount, order-level discounts are distributed across all non-zero line item totals. The amount distributed to each line item is relative to that item’s contribution to the order subtotal.
|
14
14
|
class OrderLineItemDiscount
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the discount only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# The catalog object id referencing [CatalogDiscount](#type-catalogdiscount).
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# A [CatalogModifier](#type-catalogmodifier).
|
14
14
|
class OrderLineItemModifier
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the modifier only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# The catalog object id referencing [CatalogModifier](#type-catalogmodifier).
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# Represents a tax that applies to one or more line items in an order.
|
14
14
|
class OrderLineItemTax
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the tax only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# The catalog object id referencing [CatalogTax](#type-catalogtax).
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# The set of line items, service charges, taxes, discounts, tips, etc. being returned in an Order.
|
14
14
|
class OrderReturn
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the return only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# Order which contains the original sale of these returned line items. This will be unset for unlinked returns.
|
@@ -21,6 +21,9 @@ module SquareConnect
|
|
21
21
|
# Collection of line items which are being returned.
|
22
22
|
attr_accessor :return_line_items
|
23
23
|
|
24
|
+
# Collection of service charges which are being returned. This field is read-only.
|
25
|
+
attr_accessor :return_service_charges
|
26
|
+
|
24
27
|
# Collection of taxes which are being returned.
|
25
28
|
attr_accessor :return_taxes
|
26
29
|
|
@@ -40,6 +43,7 @@ module SquareConnect
|
|
40
43
|
:'uid' => :'uid',
|
41
44
|
:'source_order_id' => :'source_order_id',
|
42
45
|
:'return_line_items' => :'return_line_items',
|
46
|
+
:'return_service_charges' => :'return_service_charges',
|
43
47
|
:'return_taxes' => :'return_taxes',
|
44
48
|
:'return_discounts' => :'return_discounts',
|
45
49
|
:'rounding_adjustment' => :'rounding_adjustment',
|
@@ -53,6 +57,7 @@ module SquareConnect
|
|
53
57
|
:'uid' => :'String',
|
54
58
|
:'source_order_id' => :'String',
|
55
59
|
:'return_line_items' => :'Array<OrderReturnLineItem>',
|
60
|
+
:'return_service_charges' => :'Array<OrderReturnServiceCharge>',
|
56
61
|
:'return_taxes' => :'Array<OrderReturnTax>',
|
57
62
|
:'return_discounts' => :'Array<OrderReturnDiscount>',
|
58
63
|
:'rounding_adjustment' => :'OrderRoundingAdjustment',
|
@@ -82,6 +87,12 @@ module SquareConnect
|
|
82
87
|
end
|
83
88
|
end
|
84
89
|
|
90
|
+
if attributes.has_key?(:'return_service_charges')
|
91
|
+
if (value = attributes[:'return_service_charges']).is_a?(Array)
|
92
|
+
self.return_service_charges = value
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
85
96
|
if attributes.has_key?(:'return_taxes')
|
86
97
|
if (value = attributes[:'return_taxes']).is_a?(Array)
|
87
98
|
self.return_taxes = value
|
@@ -141,6 +152,7 @@ module SquareConnect
|
|
141
152
|
uid == o.uid &&
|
142
153
|
source_order_id == o.source_order_id &&
|
143
154
|
return_line_items == o.return_line_items &&
|
155
|
+
return_service_charges == o.return_service_charges &&
|
144
156
|
return_taxes == o.return_taxes &&
|
145
157
|
return_discounts == o.return_discounts &&
|
146
158
|
rounding_adjustment == o.rounding_adjustment &&
|
@@ -156,7 +168,7 @@ module SquareConnect
|
|
156
168
|
# Calculates hash code according to all attributes.
|
157
169
|
# @return [Fixnum] Hash code
|
158
170
|
def hash
|
159
|
-
[uid, source_order_id, return_line_items, return_taxes, return_discounts, rounding_adjustment, return_amounts].hash
|
171
|
+
[uid, source_order_id, return_line_items, return_service_charges, return_taxes, return_discounts, rounding_adjustment, return_amounts].hash
|
160
172
|
end
|
161
173
|
|
162
174
|
# Builds the object from hash
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# The line item discount being returned.
|
14
14
|
class OrderReturnDiscount
|
15
|
-
#
|
15
|
+
# Unique ID that identifies the return discount only within this order. This field is read-only.
|
16
16
|
attr_accessor :uid
|
17
17
|
|
18
18
|
# `uid` of the Discount from the Order which contains the original application of this discount.
|
@@ -51,16 +51,16 @@ module SquareConnect
|
|
51
51
|
# The total price of all item variations returned in this line item. Calculated as `base_price_money` multiplied by `quantity`. Does not include modifiers.
|
52
52
|
attr_accessor :variation_total_price_money
|
53
53
|
|
54
|
-
# The gross return amount of money calculated as (item base price + modifiers price) * quantity.
|
54
|
+
# The gross return amount of money calculated as (item base price + modifiers price) * quantity. This field is read-only.
|
55
55
|
attr_accessor :gross_return_money
|
56
56
|
|
57
|
-
# The total tax amount of money to return for the line item.
|
57
|
+
# The total tax amount of money to return for the line item. This field is read-only.
|
58
58
|
attr_accessor :total_tax_money
|
59
59
|
|
60
|
-
# The total discount amount of money to return for the line item.
|
60
|
+
# The total discount amount of money to return for the line item. This field is read-only.
|
61
61
|
attr_accessor :total_discount_money
|
62
62
|
|
63
|
-
# The total amount of money to return for this line item.
|
63
|
+
# The total amount of money to return for this line item. This field is read-only.
|
64
64
|
attr_accessor :total_money
|
65
65
|
|
66
66
|
|