square_connect 2.7.0.202 → 2.8.0.208
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +38 -0
- data/README.md +3 -1
- data/docs/CreateCheckoutRequest.md +1 -0
- data/docs/CreateOrderRequestLineItem.md +1 -1
- data/docs/CreateOrderRequestModifier.md +1 -1
- data/docs/CustomerSortField.md +13 -0
- data/docs/CustomersApi.md +5 -1
- data/docs/ListCustomersRequest.md +2 -0
- data/docs/OrderLineItemModifier.md +1 -1
- data/docs/V1Item.md +2 -0
- data/docs/V1Page.md +1 -1
- data/docs/V1Payment.md +2 -0
- data/docs/V1PaymentSurcharge.md +17 -0
- data/lib/square_connect.rb +2 -0
- data/lib/square_connect/api/customers_api.rb +12 -0
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/create_checkout_request.rb +30 -4
- data/lib/square_connect/models/create_order_request_line_item.rb +6 -6
- data/lib/square_connect/models/create_order_request_modifier.rb +1 -1
- data/lib/square_connect/models/customer_sort_field.rb +19 -0
- data/lib/square_connect/models/list_customers_request.rb +69 -4
- data/lib/square_connect/models/order_line_item.rb +5 -5
- data/lib/square_connect/models/order_line_item_modifier.rb +1 -1
- data/lib/square_connect/models/v1_item.rb +24 -4
- data/lib/square_connect/models/v1_page.rb +26 -1
- data/lib/square_connect/models/v1_payment.rb +26 -4
- data/lib/square_connect/models/v1_payment_surcharge.rb +290 -0
- data/lib/square_connect/version.rb +1 -1
- data/spec/models/customer_sort_field_spec.rb +33 -0
- data/spec/models/v1_payment_surcharge_spec.rb +85 -0
- metadata +12 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a96a92b1da67c165de9313bfd2ad475f1e4421c6e886654b5a8b55cbdf5bf93a
|
4
|
+
data.tar.gz: a6dbe515f9458f489f9e4751f5c59d8780df118cc17ace5e53d4339516b673b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9071c135e882735a0a7fc8cff84fae9362d2786058e40d082f44c4a9b6aeb7438dad4bad5f1591de777efc04305703c4bb20ffaae1075706f27a51a55202747a
|
7
|
+
data.tar.gz: 9ca67712bebf85bd22dfd90c58ee9cfdb74388a78cf0af600a8cfb94d3d6bc7f494d7c2578a3c53915fcbd3c3a213488efcbb0f14c58a5fc7868f4fcd5ce6872
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## Version 2.8.0 (2018-05-24)
|
4
|
+
|
5
|
+
We have added sorting functionality to the Connect v2 Customer API, updated
|
6
|
+
the Connect v1 Payments API to include information about surcharges and
|
7
|
+
improvements to the Item data type.
|
8
|
+
|
9
|
+
### New feature: Customer API (Connect v2)
|
10
|
+
|
11
|
+
* **ListCustomers** endpoint — now provides the ability to sort
|
12
|
+
customers by their creation date using the `sort_field` and
|
13
|
+
`sort_order` parameters.
|
14
|
+
|
15
|
+
### New features: Payments API (Connect v1)
|
16
|
+
|
17
|
+
The Payments API now returns information about surcharges applied to payments.
|
18
|
+
The new functionality introduces the following new data types:
|
19
|
+
|
20
|
+
* **SurchargeMoney** datatype — The total of all surcharges applied
|
21
|
+
to the payment.
|
22
|
+
* **Surcharges** datatype — A list of all surcharges associated with
|
23
|
+
the payment.
|
24
|
+
* **Surcharge** datatype — A surcharge that is applied to the payment.
|
25
|
+
One example of a surcharge is auto-gratuity, which is a fixed-rate surcharge
|
26
|
+
applied to every payment, often based on party size.
|
27
|
+
|
28
|
+
We are constantly evaluating new languages to add. In the meantime, if the
|
29
|
+
language you need is not supported, you can use our
|
30
|
+
[Swagger pipeline](<%= articles__client_libraries_path%>#generatingwithswagger)
|
31
|
+
to generate a custom SDK or continue sending JSON to the endpoint URLs directly.
|
32
|
+
|
33
|
+
### Improvement: Item (Connect v1)
|
34
|
+
|
35
|
+
**Item** will now provide two new properties:
|
36
|
+
|
37
|
+
* `category_id` — indicates if an item can be added to pickup orders
|
38
|
+
from the merchant's online store
|
39
|
+
* `available_for_pickup` — indicates the item's category (if any).
|
40
|
+
|
3
41
|
## Version 2.7.0 (2018-04-26)
|
4
42
|
|
5
43
|
### New features: Transactions API and Payments API
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ for the specification and template files we used to generate this.
|
|
10
10
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
11
11
|
|
12
12
|
- API version: 2.0
|
13
|
-
- Package version: 2.
|
13
|
+
- Package version: 2.8.0
|
14
14
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
15
15
|
|
16
16
|
For more information, please visit [https://squareup.com/developers](https://squareup.com/developers)
|
@@ -246,6 +246,7 @@ Class | Method | HTTP request | Description
|
|
246
246
|
- [SquareConnect::Customer](docs/Customer.md)
|
247
247
|
- [SquareConnect::CustomerGroupInfo](docs/CustomerGroupInfo.md)
|
248
248
|
- [SquareConnect::CustomerPreferences](docs/CustomerPreferences.md)
|
249
|
+
- [SquareConnect::CustomerSortField](docs/CustomerSortField.md)
|
249
250
|
- [SquareConnect::DeleteCatalogObjectRequest](docs/DeleteCatalogObjectRequest.md)
|
250
251
|
- [SquareConnect::DeleteCatalogObjectResponse](docs/DeleteCatalogObjectResponse.md)
|
251
252
|
- [SquareConnect::DeleteCustomerCardRequest](docs/DeleteCustomerCardRequest.md)
|
@@ -344,6 +345,7 @@ Class | Method | HTTP request | Description
|
|
344
345
|
- [SquareConnect::V1PaymentItemDetail](docs/V1PaymentItemDetail.md)
|
345
346
|
- [SquareConnect::V1PaymentItemization](docs/V1PaymentItemization.md)
|
346
347
|
- [SquareConnect::V1PaymentModifier](docs/V1PaymentModifier.md)
|
348
|
+
- [SquareConnect::V1PaymentSurcharge](docs/V1PaymentSurcharge.md)
|
347
349
|
- [SquareConnect::V1PaymentTax](docs/V1PaymentTax.md)
|
348
350
|
- [SquareConnect::V1PhoneNumber](docs/V1PhoneNumber.md)
|
349
351
|
- [SquareConnect::V1Refund](docs/V1Refund.md)
|
@@ -15,5 +15,6 @@ Name | Type | Description | Notes
|
|
15
15
|
**pre_populate_shipping_address** | [**Address**](Address.md) | If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. Default: none; only exists if explicitly set. | [optional]
|
16
16
|
**redirect_url** | **String** | The URL to redirect to after checkout is completed with `checkoutId`, Square's `orderId`, `transactionId`, and `referenceId` appended as URL parameters. For example, if the provided redirect_url is `http://www.example.com/order-complete`, a successful transaction redirects the customer to: `http://www.example.com/order-complete?checkoutId=xxxxxx&orderId=xxxxxx&referenceId=xxxxxx&transactionId=xxxxxx` If you do not provide a redirect URL, Square Checkout will display an order confirmation page on your behalf; however Square strongly recommends that you provide a redirect URL so you can verify the transaction results and finalize the order through your existing/normal confirmation workflow. Default: none; only exists if explicitly set. | [optional]
|
17
17
|
**additional_recipients** | [**Array<ChargeRequestAdditionalRecipient>**](ChargeRequestAdditionalRecipient.md) | The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `total_money` calculated by Square for your order. The `location_id` must be the valid location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox. | [optional]
|
18
|
+
**note** | **String** | An optional note to associate with the checkout object. This value cannot exceed 60 characters. | [optional]
|
18
19
|
|
19
20
|
|
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
|
11
11
|
**quantity** | **String** | The quantity to purchase, as a string representation of a number. This string must have a positive integer value. |
|
12
12
|
**base_price_money** | [**Money**](Money.md) | The base price for a single unit of the line item. `base_price_money` is required for ad hoc line items and variable priced [CatalogItemVariation](#type-catalogitemvariation)s. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the CatalogItemVariation's price. | [optional]
|
13
13
|
**variation_name** | **String** | Only used for ad hoc line items. The variation name of the line item. This value cannot exceed 255 characters. If this value is not set for an ad hoc line item, the default value of `Regular` is used. Do not provide a value for this field if you provide a value for the `catalog_object_id`. | [optional]
|
14
|
-
**note** | **String** | The note of the line item. This value cannot exceed
|
14
|
+
**note** | **String** | The note of the line item. This value cannot exceed 500 characters. | [optional]
|
15
15
|
**catalog_object_id** | **String** | Only used for Catalog line items. The catalog object ID for an existing [CatalogItemVariation](#type-catalogitemvariation). Do not provide a value for this field if you provide a value for `name` and `base_price_money`. | [optional]
|
16
16
|
**modifiers** | [**Array<CreateOrderRequestModifier>**](CreateOrderRequestModifier.md) | Only used for Catalog line items. The modifiers to include on the line item. | [optional]
|
17
17
|
**taxes** | [**Array<CreateOrderRequestTax>**](CreateOrderRequestTax.md) | The taxes to include on the line item. | [optional]
|
@@ -9,6 +9,6 @@ Name | Type | Description | Notes
|
|
9
9
|
------------ | ------------- | ------------- | -------------
|
10
10
|
**catalog_object_id** | **String** | The catalog object ID of a [CatalogModifier](#type-catalogmodifier). | [optional]
|
11
11
|
**name** | **String** | Only used for ad hoc modifiers. The name of the modifier. `name` cannot exceed 255 characters. Do not provide a value for `name` if you provide a value for `catalog_object_id`. | [optional]
|
12
|
-
**base_price_money** | [**Money**](Money.md) |
|
12
|
+
**base_price_money** | [**Money**](Money.md) | The base price for the modifier. `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined [CatalogModifier](#type-catalogmodifier) price. | [optional]
|
13
13
|
|
14
14
|
|
data/docs/CustomersApi.md
CHANGED
@@ -247,7 +247,9 @@ end
|
|
247
247
|
api_instance = SquareConnect::CustomersApi.new
|
248
248
|
|
249
249
|
opts = {
|
250
|
-
cursor: "cursor_example" # String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
250
|
+
cursor: "cursor_example", # String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
251
|
+
sort_field: "sort_field_example", # String | Indicates how Customers should be sorted. Default: `DEFAULT`.
|
252
|
+
sort_order: "sort_order_example" # String | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
|
251
253
|
}
|
252
254
|
|
253
255
|
begin
|
@@ -264,6 +266,8 @@ end
|
|
264
266
|
Name | Type | Description | Notes
|
265
267
|
------------- | ------------- | ------------- | -------------
|
266
268
|
**cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional]
|
269
|
+
**sort_field** | **String**| Indicates how Customers should be sorted. Default: `DEFAULT`. | [optional]
|
270
|
+
**sort_order** | **String**| Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. | [optional]
|
267
271
|
|
268
272
|
### Return type
|
269
273
|
|
@@ -8,5 +8,7 @@ Defines the query parameters that can be provided in a request to the [ListCusto
|
|
8
8
|
Name | Type | Description | Notes
|
9
9
|
------------ | ------------- | ------------- | -------------
|
10
10
|
**cursor** | **String** | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional]
|
11
|
+
**sort_field** | **String** | Indicates how Customers should be sorted. Default: `DEFAULT`. | [optional]
|
12
|
+
**sort_order** | **String** | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. | [optional]
|
11
13
|
|
12
14
|
|
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
|
|
9
9
|
------------ | ------------- | ------------- | -------------
|
10
10
|
**catalog_object_id** | **String** | The catalog object id referencing [CatalogModifier](#type-catalogmodifier). | [optional]
|
11
11
|
**name** | **String** | The name of the item modifier. | [optional]
|
12
|
-
**base_price_money** | [**Money**](Money.md) | The base price
|
12
|
+
**base_price_money** | [**Money**](Money.md) | The base price for the modifier. `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined [CatalogModifier](#type-catalogmodifier) price. | [optional]
|
13
13
|
**total_price_money** | [**Money**](Money.md) | The total price of the item modifier for its line item. This is the modifier's base_price_money multiplied by the line item's quantity. | [optional]
|
14
14
|
|
15
15
|
|
data/docs/V1Item.md
CHANGED
@@ -19,5 +19,7 @@ Name | Type | Description | Notes
|
|
19
19
|
**modifier_lists** | [**Array<V1Variation>**](V1Variation.md) | The modifier lists that apply to the item, if any. | [optional]
|
20
20
|
**fees** | [**Array<V1Fee>**](V1Fee.md) | The fees that apply to the item, if any. | [optional]
|
21
21
|
**taxable** | **BOOLEAN** | Deprecated. This field is not used. | [optional]
|
22
|
+
**category_id** | **String** | The ID of the item's category, if any. | [optional]
|
23
|
+
**available_for_pickup** | **BOOLEAN** | If true, the item can be added to pickup orders from the merchant's online store. Default value: false | [optional]
|
22
24
|
|
23
25
|
|
data/docs/V1Page.md
CHANGED
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
8
8
|
**id** | **String** | The page's unique identifier. | [optional]
|
9
9
|
**name** | **String** | The page's name, if any. | [optional]
|
10
|
-
**page_index** | **Integer** | The page's position in the merchant's list of pages. Always an integer between 0 and
|
10
|
+
**page_index** | **Integer** | The page's position in the merchant's list of pages. Always an integer between 0 and 6, inclusive. | [optional]
|
11
11
|
**cells** | [**Array<V1PageCell>**](V1PageCell.md) | The cells included on the page. | [optional]
|
12
12
|
|
13
13
|
|
data/docs/V1Payment.md
CHANGED
@@ -29,5 +29,7 @@ Name | Type | Description | Notes
|
|
29
29
|
**tender** | [**Array<V1Tender>**](V1Tender.md) | All of the additive taxes associated with the payment. | [optional]
|
30
30
|
**refunds** | [**Array<V1Refund>**](V1Refund.md) | All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. | [optional]
|
31
31
|
**itemizations** | [**Array<V1PaymentItemization>**](V1PaymentItemization.md) | The items purchased in the payment. | [optional]
|
32
|
+
**surcharge_money** | [**V1Money**](V1Money.md) | The total of all surcharges applied to the payment. | [optional]
|
33
|
+
**surcharges** | [**Array<V1PaymentSurcharge>**](V1PaymentSurcharge.md) | A list of all surcharges associated with the payment. | [optional]
|
32
34
|
|
33
35
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# SquareConnect::V1PaymentSurcharge
|
2
|
+
|
3
|
+
### Description
|
4
|
+
|
5
|
+
## Properties
|
6
|
+
Name | Type | Description | Notes
|
7
|
+
------------ | ------------- | ------------- | -------------
|
8
|
+
**name** | **String** | The name of the surcharge. | [optional]
|
9
|
+
**applied_money** | [**V1Money**](V1Money.md) | The amount of money applied to the order as a result of the surcharge. | [optional]
|
10
|
+
**rate** | **String** | The amount of the surcharge as a percentage. The percentage is provided as a string representing the decimal equivalent of the percentage. For example, \"0.7\" corresponds to a 7% surcharge. Exactly one of rate or amount_money should be set. | [optional]
|
11
|
+
**amount_money** | [**V1Money**](V1Money.md) | The amount of the surcharge as a Money object. Exactly one of rate or amount_money should be set. | [optional]
|
12
|
+
**type** | **String** | Indicates the source of the surcharge. For example, if it was applied as an automatic gratuity for a large group. | [optional]
|
13
|
+
**taxable** | **BOOLEAN** | Indicates whether the surcharge is taxable. | [optional]
|
14
|
+
**taxes** | [**Array<V1PaymentTax>**](V1PaymentTax.md) | The list of taxes that should be applied to the surcharge. | [optional]
|
15
|
+
**surcharge_id** | **String** | | [optional]
|
16
|
+
|
17
|
+
|
data/lib/square_connect.rb
CHANGED
@@ -82,6 +82,7 @@ require 'square_connect/models/currency'
|
|
82
82
|
require 'square_connect/models/customer'
|
83
83
|
require 'square_connect/models/customer_group_info'
|
84
84
|
require 'square_connect/models/customer_preferences'
|
85
|
+
require 'square_connect/models/customer_sort_field'
|
85
86
|
require 'square_connect/models/delete_catalog_object_request'
|
86
87
|
require 'square_connect/models/delete_catalog_object_response'
|
87
88
|
require 'square_connect/models/delete_customer_card_request'
|
@@ -180,6 +181,7 @@ require 'square_connect/models/v1_payment_discount'
|
|
180
181
|
require 'square_connect/models/v1_payment_item_detail'
|
181
182
|
require 'square_connect/models/v1_payment_itemization'
|
182
183
|
require 'square_connect/models/v1_payment_modifier'
|
184
|
+
require 'square_connect/models/v1_payment_surcharge'
|
183
185
|
require 'square_connect/models/v1_payment_tax'
|
184
186
|
require 'square_connect/models/v1_phone_number'
|
185
187
|
require 'square_connect/models/v1_refund'
|
@@ -241,6 +241,8 @@ module SquareConnect
|
|
241
241
|
# Lists a business's customers.
|
242
242
|
# @param [Hash] opts the optional parameters
|
243
243
|
# @option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
244
|
+
# @option opts [String] :sort_field Indicates how Customers should be sorted. Default: `DEFAULT`.
|
245
|
+
# @option opts [String] :sort_order Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
|
244
246
|
# @return [ListCustomersResponse]
|
245
247
|
def list_customers(opts = {})
|
246
248
|
data, _status_code, _headers = list_customers_with_http_info(opts)
|
@@ -251,17 +253,27 @@ module SquareConnect
|
|
251
253
|
# Lists a business's customers.
|
252
254
|
# @param [Hash] opts the optional parameters
|
253
255
|
# @option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
256
|
+
# @option opts [String] :sort_field Indicates how Customers should be sorted. Default: `DEFAULT`.
|
257
|
+
# @option opts [String] :sort_order Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
|
254
258
|
# @return [Array<(ListCustomersResponse, Fixnum, Hash)>] ListCustomersResponse data, response status code and response headers
|
255
259
|
def list_customers_with_http_info(opts = {})
|
256
260
|
if @api_client.config.debugging
|
257
261
|
@api_client.config.logger.debug "Calling API: CustomersApi.list_customers ..."
|
258
262
|
end
|
263
|
+
if opts[:'sort_field'] && !['DEFAULT', 'CREATED_AT'].include?(opts[:'sort_field'])
|
264
|
+
fail ArgumentError, 'invalid value for "sort_field", must be one of DEFAULT, CREATED_AT'
|
265
|
+
end
|
266
|
+
if opts[:'sort_order'] && !['DESC', 'ASC'].include?(opts[:'sort_order'])
|
267
|
+
fail ArgumentError, 'invalid value for "sort_order", must be one of DESC, ASC'
|
268
|
+
end
|
259
269
|
# resource path
|
260
270
|
local_var_path = "/v2/customers".sub('{format}','json')
|
261
271
|
|
262
272
|
# query parameters
|
263
273
|
query_params = {}
|
264
274
|
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
275
|
+
query_params[:'sort_field'] = opts[:'sort_field'] if !opts[:'sort_field'].nil?
|
276
|
+
query_params[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
|
265
277
|
|
266
278
|
# header parameters
|
267
279
|
header_params = {}
|
@@ -30,7 +30,7 @@ module SquareConnect
|
|
30
30
|
@config = config
|
31
31
|
|
32
32
|
# Construct user agent string. Returns slightly different string for JRuby
|
33
|
-
@user_agent = "Square-Connect-Ruby/2.
|
33
|
+
@user_agent = "Square-Connect-Ruby/2.8.0"
|
34
34
|
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => "application/json",
|
@@ -36,6 +36,9 @@ module SquareConnect
|
|
36
36
|
# The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `total_money` calculated by Square for your order. The `location_id` must be the valid location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. This field is currently not supported in sandbox.
|
37
37
|
attr_accessor :additional_recipients
|
38
38
|
|
39
|
+
# An optional note to associate with the checkout object. This value cannot exceed 60 characters.
|
40
|
+
attr_accessor :note
|
41
|
+
|
39
42
|
|
40
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
41
44
|
def self.attribute_map
|
@@ -47,7 +50,8 @@ module SquareConnect
|
|
47
50
|
:'pre_populate_buyer_email' => :'pre_populate_buyer_email',
|
48
51
|
:'pre_populate_shipping_address' => :'pre_populate_shipping_address',
|
49
52
|
:'redirect_url' => :'redirect_url',
|
50
|
-
:'additional_recipients' => :'additional_recipients'
|
53
|
+
:'additional_recipients' => :'additional_recipients',
|
54
|
+
:'note' => :'note'
|
51
55
|
}
|
52
56
|
end
|
53
57
|
|
@@ -61,7 +65,8 @@ module SquareConnect
|
|
61
65
|
:'pre_populate_buyer_email' => :'String',
|
62
66
|
:'pre_populate_shipping_address' => :'Address',
|
63
67
|
:'redirect_url' => :'String',
|
64
|
-
:'additional_recipients' => :'Array<ChargeRequestAdditionalRecipient>'
|
68
|
+
:'additional_recipients' => :'Array<ChargeRequestAdditionalRecipient>',
|
69
|
+
:'note' => :'String'
|
65
70
|
}
|
66
71
|
end
|
67
72
|
|
@@ -107,6 +112,10 @@ module SquareConnect
|
|
107
112
|
end
|
108
113
|
end
|
109
114
|
|
115
|
+
if attributes.has_key?(:'note')
|
116
|
+
self.note = attributes[:'note']
|
117
|
+
end
|
118
|
+
|
110
119
|
end
|
111
120
|
|
112
121
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -141,6 +150,10 @@ module SquareConnect
|
|
141
150
|
invalid_properties.push("invalid value for 'redirect_url', the character length must be smaller than or equal to 800.")
|
142
151
|
end
|
143
152
|
|
153
|
+
if !@note.nil? && @note.to_s.length > 60
|
154
|
+
invalid_properties.push("invalid value for 'note', the character length must be smaller than or equal to 60.")
|
155
|
+
end
|
156
|
+
|
144
157
|
return invalid_properties
|
145
158
|
end
|
146
159
|
|
@@ -154,6 +167,7 @@ module SquareConnect
|
|
154
167
|
return false if !@merchant_support_email.nil? && @merchant_support_email.to_s.length > 254
|
155
168
|
return false if !@pre_populate_buyer_email.nil? && @pre_populate_buyer_email.to_s.length > 254
|
156
169
|
return false if !@redirect_url.nil? && @redirect_url.to_s.length > 800
|
170
|
+
return false if !@note.nil? && @note.to_s.length > 60
|
157
171
|
return true
|
158
172
|
end
|
159
173
|
|
@@ -208,6 +222,17 @@ module SquareConnect
|
|
208
222
|
@redirect_url = redirect_url
|
209
223
|
end
|
210
224
|
|
225
|
+
# Custom attribute writer method with validation
|
226
|
+
# @param [Object] note Value to be assigned
|
227
|
+
def note=(note)
|
228
|
+
|
229
|
+
if !note.nil? && note.to_s.length > 60
|
230
|
+
fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to 60."
|
231
|
+
end
|
232
|
+
|
233
|
+
@note = note
|
234
|
+
end
|
235
|
+
|
211
236
|
# Checks equality by comparing each attribute.
|
212
237
|
# @param [Object] Object to be compared
|
213
238
|
def ==(o)
|
@@ -220,7 +245,8 @@ module SquareConnect
|
|
220
245
|
pre_populate_buyer_email == o.pre_populate_buyer_email &&
|
221
246
|
pre_populate_shipping_address == o.pre_populate_shipping_address &&
|
222
247
|
redirect_url == o.redirect_url &&
|
223
|
-
additional_recipients == o.additional_recipients
|
248
|
+
additional_recipients == o.additional_recipients &&
|
249
|
+
note == o.note
|
224
250
|
end
|
225
251
|
|
226
252
|
# @see the `==` method
|
@@ -232,7 +258,7 @@ module SquareConnect
|
|
232
258
|
# Calculates hash code according to all attributes.
|
233
259
|
# @return [Fixnum] Hash code
|
234
260
|
def hash
|
235
|
-
[idempotency_key, order, ask_for_shipping_address, merchant_support_email, pre_populate_buyer_email, pre_populate_shipping_address, redirect_url, additional_recipients].hash
|
261
|
+
[idempotency_key, order, ask_for_shipping_address, merchant_support_email, pre_populate_buyer_email, pre_populate_shipping_address, redirect_url, additional_recipients, note].hash
|
236
262
|
end
|
237
263
|
|
238
264
|
# Builds the object from hash
|
@@ -24,7 +24,7 @@ module SquareConnect
|
|
24
24
|
# Only used for ad hoc line items. The variation name of the line item. This value cannot exceed 255 characters. If this value is not set for an ad hoc line item, the default value of `Regular` is used. Do not provide a value for this field if you provide a value for the `catalog_object_id`.
|
25
25
|
attr_accessor :variation_name
|
26
26
|
|
27
|
-
# The note of the line item. This value cannot exceed
|
27
|
+
# The note of the line item. This value cannot exceed 500 characters.
|
28
28
|
attr_accessor :note
|
29
29
|
|
30
30
|
# Only used for Catalog line items. The catalog object ID for an existing [CatalogItemVariation](#type-catalogitemvariation). Do not provide a value for this field if you provide a value for `name` and `base_price_money`.
|
@@ -146,8 +146,8 @@ module SquareConnect
|
|
146
146
|
invalid_properties.push("invalid value for 'variation_name', the character length must be smaller than or equal to 255.")
|
147
147
|
end
|
148
148
|
|
149
|
-
if !@note.nil? && @note.to_s.length >
|
150
|
-
invalid_properties.push("invalid value for 'note', the character length must be smaller than or equal to
|
149
|
+
if !@note.nil? && @note.to_s.length > 500
|
150
|
+
invalid_properties.push("invalid value for 'note', the character length must be smaller than or equal to 500.")
|
151
151
|
end
|
152
152
|
|
153
153
|
if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
@@ -165,7 +165,7 @@ module SquareConnect
|
|
165
165
|
return false if @quantity.to_s.length > 5
|
166
166
|
return false if @quantity.to_s.length < 1
|
167
167
|
return false if !@variation_name.nil? && @variation_name.to_s.length > 255
|
168
|
-
return false if !@note.nil? && @note.to_s.length >
|
168
|
+
return false if !@note.nil? && @note.to_s.length > 500
|
169
169
|
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
|
170
170
|
return true
|
171
171
|
end
|
@@ -214,8 +214,8 @@ module SquareConnect
|
|
214
214
|
# @param [Object] note Value to be assigned
|
215
215
|
def note=(note)
|
216
216
|
|
217
|
-
if !note.nil? && note.to_s.length >
|
218
|
-
fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to
|
217
|
+
if !note.nil? && note.to_s.length > 500
|
218
|
+
fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to 500."
|
219
219
|
end
|
220
220
|
|
221
221
|
@note = note
|
@@ -18,7 +18,7 @@ module SquareConnect
|
|
18
18
|
# Only used for ad hoc modifiers. The name of the modifier. `name` cannot exceed 255 characters. Do not provide a value for `name` if you provide a value for `catalog_object_id`.
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
|
-
#
|
21
|
+
# The base price for the modifier. `base_price_money` is required for ad hoc modifiers. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the predefined [CatalogModifier](#type-catalogmodifier) price.
|
22
22
|
attr_accessor :base_price_money
|
23
23
|
|
24
24
|
|
@@ -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 CustomerSortField
|
14
|
+
|
15
|
+
DEFAULT = "DEFAULT".freeze
|
16
|
+
CREATED_AT = "CREATED_AT".freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -15,18 +15,49 @@ module SquareConnect
|
|
15
15
|
# A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information.
|
16
16
|
attr_accessor :cursor
|
17
17
|
|
18
|
+
# Indicates how Customers should be sorted. Default: `DEFAULT`.
|
19
|
+
attr_accessor :sort_field
|
20
|
+
|
21
|
+
# Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
|
22
|
+
attr_accessor :sort_order
|
23
|
+
|
24
|
+
class EnumAttributeValidator
|
25
|
+
attr_reader :datatype
|
26
|
+
attr_reader :allowable_values
|
27
|
+
|
28
|
+
def initialize(datatype, allowable_values)
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
30
|
+
case datatype.to_s
|
31
|
+
when /Integer/i
|
32
|
+
value.to_i
|
33
|
+
when /Float/i
|
34
|
+
value.to_f
|
35
|
+
else
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def valid?(value)
|
42
|
+
!value || allowable_values.include?(value)
|
43
|
+
end
|
44
|
+
end
|
18
45
|
|
19
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
47
|
def self.attribute_map
|
21
48
|
{
|
22
|
-
:'cursor' => :'cursor'
|
49
|
+
:'cursor' => :'cursor',
|
50
|
+
:'sort_field' => :'sort_field',
|
51
|
+
:'sort_order' => :'sort_order'
|
23
52
|
}
|
24
53
|
end
|
25
54
|
|
26
55
|
# Attribute type mapping.
|
27
56
|
def self.swagger_types
|
28
57
|
{
|
29
|
-
:'cursor' => :'String'
|
58
|
+
:'cursor' => :'String',
|
59
|
+
:'sort_field' => :'String',
|
60
|
+
:'sort_order' => :'String'
|
30
61
|
}
|
31
62
|
end
|
32
63
|
|
@@ -42,6 +73,14 @@ module SquareConnect
|
|
42
73
|
self.cursor = attributes[:'cursor']
|
43
74
|
end
|
44
75
|
|
76
|
+
if attributes.has_key?(:'sort_field')
|
77
|
+
self.sort_field = attributes[:'sort_field']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'sort_order')
|
81
|
+
self.sort_order = attributes[:'sort_order']
|
82
|
+
end
|
83
|
+
|
45
84
|
end
|
46
85
|
|
47
86
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -54,15 +93,41 @@ module SquareConnect
|
|
54
93
|
# Check to see if the all the properties in the model are valid
|
55
94
|
# @return true if the model is valid
|
56
95
|
def valid?
|
96
|
+
sort_field_validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
|
97
|
+
return false unless sort_field_validator.valid?(@sort_field)
|
98
|
+
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
99
|
+
return false unless sort_order_validator.valid?(@sort_order)
|
57
100
|
return true
|
58
101
|
end
|
59
102
|
|
103
|
+
# Custom attribute writer method checking allowed values (enum).
|
104
|
+
# @param [Object] sort_field Object to be assigned
|
105
|
+
def sort_field=(sort_field)
|
106
|
+
validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
|
107
|
+
unless validator.valid?(sort_field)
|
108
|
+
fail ArgumentError, "invalid value for 'sort_field', must be one of #{validator.allowable_values}."
|
109
|
+
end
|
110
|
+
@sort_field = sort_field
|
111
|
+
end
|
112
|
+
|
113
|
+
# Custom attribute writer method checking allowed values (enum).
|
114
|
+
# @param [Object] sort_order Object to be assigned
|
115
|
+
def sort_order=(sort_order)
|
116
|
+
validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
|
117
|
+
unless validator.valid?(sort_order)
|
118
|
+
fail ArgumentError, "invalid value for 'sort_order', must be one of #{validator.allowable_values}."
|
119
|
+
end
|
120
|
+
@sort_order = sort_order
|
121
|
+
end
|
122
|
+
|
60
123
|
# Checks equality by comparing each attribute.
|
61
124
|
# @param [Object] Object to be compared
|
62
125
|
def ==(o)
|
63
126
|
return true if self.equal?(o)
|
64
127
|
self.class == o.class &&
|
65
|
-
cursor == o.cursor
|
128
|
+
cursor == o.cursor &&
|
129
|
+
sort_field == o.sort_field &&
|
130
|
+
sort_order == o.sort_order
|
66
131
|
end
|
67
132
|
|
68
133
|
# @see the `==` method
|
@@ -74,7 +139,7 @@ module SquareConnect
|
|
74
139
|
# Calculates hash code according to all attributes.
|
75
140
|
# @return [Fixnum] Hash code
|
76
141
|
def hash
|
77
|
-
[cursor].hash
|
142
|
+
[cursor, sort_field, sort_order].hash
|
78
143
|
end
|
79
144
|
|
80
145
|
# Builds the object from hash
|