diff --git a/CHANGES.md b/CHANGES.md index 7a930e0..f5acadb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Change Log +## Version 2.5.1 (2017-11-10) + +* `ordinal` is added to `CatalogItemVariation` +* `website_url` is added to `Location` +* `tip_money` is added to `Tender` +* Changed `object_type` and `placeholder_type` from lists to single values in `V1PageCell` to mirror data model + ## Version 2.5 (2017-11-02) ### New features: Transaction API and Reporting API diff --git a/README.md b/README.md index 18d4463..1d877b4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add this dependency to your project's POM: com.squareup connect - 2.5.0 + 2.5.1 compile ``` @@ -28,7 +28,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.squareup:connect:2.5.0" +compile "com.squareup:connect:2.5.1" ``` ### Build and Install locally @@ -47,7 +47,7 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/connect-2.5.0.jar +* target/connect-2.5.1.jar * target/lib/*.jar ## Getting Started @@ -406,6 +406,13 @@ Authentication schemes defined for the API: - EMPLOYEES_WRITE: POST, PUT, and DELETE endpoints related to employee management - TIMECARDS_READ: GET endpoints related to employee timecards - TIMECARDS_WRITE: POST, PUT, and DELETE endpoints related to employee timecards + - PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS: Allow third party applications to deduct a portion of each transaction amount. + +### oauth2ClientSecret + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header ## Pagination of V1 Endpoints diff --git a/build.gradle b/build.gradle index e44df3c..9b7ba6d 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.squareup' -version = '2.5.0' +version = '2.5.1' buildscript { repositories { diff --git a/docs/AdditionalRecipient.md b/docs/AdditionalRecipient.md index a4ddb3d..5108a97 100644 --- a/docs/AdditionalRecipient.md +++ b/docs/AdditionalRecipient.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **locationId** | **String** | The location ID for a recipient (other than the merchant) receiving a portion of this tender. | **description** | **String** | The description of the additional recipient. | **amountMoney** | [**Money**](Money.md) | The amount of money distributed to the recipient. | -**receivableId** | **String** | The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server. TODO(botros): add required annotations on this, SETL-7263 | [optional] +**receivableId** | **String** | The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server. | [optional] diff --git a/docs/CatalogItemVariation.md b/docs/CatalogItemVariation.md index 50784c4..ab91e60 100644 --- a/docs/CatalogItemVariation.md +++ b/docs/CatalogItemVariation.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **name** | **String** | The item variation's name. Searchable. | [optional] **sku** | **String** | The item variation's SKU, if any. Searchable. | [optional] **upc** | **String** | The item variation's UPC, if any. Searchable. | [optional] +**ordinal** | **Integer** | The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for each item variation within a parent [CatalogItem](#type-catalogitem) is set according to the item variations's position. On reads, the value is not guaranteed to be sequential or unique. | [optional] **pricingType** | [**PricingTypeEnum**](#PricingTypeEnum) | Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. | [optional] **priceMoney** | [**Money**](Money.md) | The item variation's price, if fixed pricing is used. | [optional] **locationOverrides** | [**List<ItemVariationLocationOverrides>**](ItemVariationLocationOverrides.md) | Per-[location](#type-location) price and inventory overrides. | [optional] diff --git a/docs/ChargeRequest.md b/docs/ChargeRequest.md index 5b29a87..b215363 100644 --- a/docs/ChargeRequest.md +++ b/docs/ChargeRequest.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **shippingAddress** | [**Address**](Address.md) | The buyer's shipping address, if available. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor `billing_address` is provided. | [optional] **buyerEmailAddress** | **String** | The buyer's email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. | [optional] **orderId** | **String** | The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the `total_money` value of the order's `order_amounts` field. | [optional] -**additionalRecipients** | [**List<AdditionalRecipient>**](AdditionalRecipient.md) | The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in you charge's request. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox. | [optional] +**additionalRecipients** | [**List<AdditionalRecipient>**](AdditionalRecipient.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 `amount_money` value in you charge's request. 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] diff --git a/docs/CreateCheckoutRequest.md b/docs/CreateCheckoutRequest.md index 6783561..7d606e7 100644 --- a/docs/CreateCheckoutRequest.md +++ b/docs/CreateCheckoutRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **prePopulateBuyerEmail** | **String** | If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default: none; only exists if explicitly set. | [optional] **prePopulateShippingAddress** | [**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] **redirectUrl** | **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] -**additionalRecipients** | [**List<ChargeRequestAdditionalRecipient>**](ChargeRequestAdditionalRecipient.md) | The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited 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` calcualted by Square for your order. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox. | [optional] +**additionalRecipients** | [**List<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] diff --git a/docs/Location.md b/docs/Location.md index 77cfc47..a483538 100644 --- a/docs/Location.md +++ b/docs/Location.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **phoneNumber** | **String** | The location's phone_number. | [optional] **businessName** | **String** | The location's business_name which is shown to its customers. For example, this is the name printed on its customer's receipts. | [optional] **type** | [**TypeEnum**](#TypeEnum) | The location's type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. | [optional] +**websiteUrl** | **String** | The location's website, as set by the account owner in the Square dashboard. Default: none; only exists if explicitly set. | [optional] diff --git a/docs/ReportingApi.md b/docs/ReportingApi.md index 71c7026..f942725 100644 --- a/docs/ReportingApi.md +++ b/docs/ReportingApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description ListAdditionalRecipientReceivableRefunds -Lists Additional Recipient Receivable Refunds for a particular location. Max results per [page](#paginatingresults): 50 +Returns a list of refunded transactions (across all possible originating locations) relating to monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 ### Example ```java @@ -75,7 +75,7 @@ Name | Type | Description | Notes ListAdditionalRecipientReceivables -Lists Additional Recipient Receivables for a particular location. Max results per [page](#paginatingresults): 50 +Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 ### Example ```java diff --git a/docs/Tender.md b/docs/Tender.md index 0d43243..0c8e0c2 100644 --- a/docs/Tender.md +++ b/docs/Tender.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **createdAt** | **String** | The time when the tender was created, in RFC 3339 format. | [optional] **note** | **String** | An optional note associated with the tender at the time of payment. | [optional] **amountMoney** | [**Money**](Money.md) | The amount of the tender. | [optional] +**tipMoney** | [**Money**](Money.md) | The tip's amount of the tender. | [optional] **processingFeeMoney** | [**Money**](Money.md) | The amount of any Square processing fees applied to the tender. This field is not immediately populated when a new transaction is created. It is usually available after about ten seconds. | [optional] **customerId** | **String** | If the tender is associated with a customer or represents a customer's card on file, this is the ID of the associated customer. | [optional] **type** | [**TypeEnum**](#TypeEnum) | The type of tender, such as `CARD` or `CASH`. | diff --git a/docs/V1PageCell.md b/docs/V1PageCell.md index a5057b2..5fffef1 100644 --- a/docs/V1PageCell.md +++ b/docs/V1PageCell.md @@ -7,13 +7,13 @@ Name | Type | Description | Notes **pageId** | **String** | The unique identifier of the page the cell is included on. | [optional] **row** | **Integer** | The row of the cell. Always an integer between 0 and 4, inclusive. | [optional] **column** | **Integer** | The column of the cell. Always an integer between 0 and 4, inclusive. | [optional] -**objectType** | [**List<ObjectTypeEnum>**](#List<ObjectTypeEnum>) | The type of entity represented in the cell (ITEM, DISCOUNT, CATEGORY, or PLACEHOLDER). | [optional] +**objectType** | [**ObjectTypeEnum**](#ObjectTypeEnum) | The type of entity represented in the cell (ITEM, DISCOUNT, CATEGORY, or PLACEHOLDER). | [optional] **objectId** | **String** | The unique identifier of the entity represented in the cell. Not present for cells with an object_type of PLACEHOLDER. | [optional] -**placeholderType** | [**List<PlaceholderTypeEnum>**](#List<PlaceholderTypeEnum>) | For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior. | [optional] +**placeholderType** | [**PlaceholderTypeEnum**](#PlaceholderTypeEnum) | For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior. | [optional] - -## Enum: List<ObjectTypeEnum> + +## Enum: ObjectTypeEnum Name | Value ---- | ----- ITEM | "ITEM" @@ -22,8 +22,8 @@ CATEGORY | "CATEGORY" PLACEHOLDER | "PLACEHOLDER" - -## Enum: List<PlaceholderTypeEnum> + +## Enum: PlaceholderTypeEnum Name | Value ---- | ----- ALL_ITEMS | "ALL_ITEMS" diff --git a/pom.xml b/pom.xml index 980c83e..9becef0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ connect jar connect - 2.5.0 + 2.5.1 https://github.com/square/connect-java-sdk/ Java client library for the Square Connect API diff --git a/src/main/java/com/squareup/connect/ApiClient.java b/src/main/java/com/squareup/connect/ApiClient.java index 3fa8b14..2dda479 100644 --- a/src/main/java/com/squareup/connect/ApiClient.java +++ b/src/main/java/com/squareup/connect/ApiClient.java @@ -73,11 +73,12 @@ public ApiClient() { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("Square-Connect-Java/2.5.0"); + setUserAgent("Square-Connect-Java/2.5.1"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); authentications.put("oauth2", new OAuth()); + authentications.put("oauth2ClientSecret", new ApiKeyAuth("header", "Authorization")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } diff --git a/src/main/java/com/squareup/connect/api/ReportingApi.java b/src/main/java/com/squareup/connect/api/ReportingApi.java index f723852..f411de4 100644 --- a/src/main/java/com/squareup/connect/api/ReportingApi.java +++ b/src/main/java/com/squareup/connect/api/ReportingApi.java @@ -38,7 +38,7 @@ public void setApiClient(ApiClient apiClient) { /** * ListAdditionalRecipientReceivableRefunds - * Lists Additional Recipient Receivable Refunds for a particular location. Max results per [page](#paginatingresults): 50 + * Returns a list of refunded transactions (across all possible originating locations) relating to monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 * @param locationId The ID of the location to list AdditionalRecipientReceivableRefunds for. (required) * @param beginTime The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. (optional) * @param endTime The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. (optional) @@ -90,7 +90,7 @@ public ListAdditionalRecipientReceivableRefundsResponse listAdditionalRecipientR /** * ListAdditionalRecipientReceivableRefunds - * Lists Additional Recipient Receivable Refunds for a particular location. Max results per [page](#paginatingresults): 50 + * Returns a list of refunded transactions (across all possible originating locations) relating to monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 * @param locationId The ID of the location to list AdditionalRecipientReceivableRefunds for. (required) * @param beginTime The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. (optional) * @param endTime The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. (optional) @@ -140,7 +140,7 @@ public ListAdditionalRecipientReceivableRefundsResponse listAdditionalRecipientR } /** * ListAdditionalRecipientReceivables - * Lists Additional Recipient Receivables for a particular location. Max results per [page](#paginatingresults): 50 + * Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 * @param locationId The ID of the location to list AdditionalRecipientReceivables for. (required) * @param beginTime The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. (optional) * @param endTime The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. (optional) @@ -192,7 +192,7 @@ public ListAdditionalRecipientReceivablesResponse listAdditionalRecipientReceiva /** * ListAdditionalRecipientReceivables - * Lists Additional Recipient Receivables for a particular location. Max results per [page](#paginatingresults): 50 + * Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50 * @param locationId The ID of the location to list AdditionalRecipientReceivables for. (required) * @param beginTime The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. (optional) * @param endTime The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. (optional) diff --git a/src/main/java/com/squareup/connect/models/AdditionalRecipient.java b/src/main/java/com/squareup/connect/models/AdditionalRecipient.java index 590c796..65b9a8d 100644 --- a/src/main/java/com/squareup/connect/models/AdditionalRecipient.java +++ b/src/main/java/com/squareup/connect/models/AdditionalRecipient.java @@ -99,10 +99,10 @@ public AdditionalRecipient receivableId(String receivableId) { } /** - * The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server. TODO(botros): add required annotations on this, SETL-7263 + * The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server. * @return receivableId **/ - @ApiModelProperty(value = "The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server. TODO(botros): add required annotations on this, SETL-7263") + @ApiModelProperty(value = "The unique ID for this [AdditionalRecipientReceivable](#type-additionalrecipientreceivable), assigned by the server.") public String getReceivableId() { return receivableId; } diff --git a/src/main/java/com/squareup/connect/models/CatalogItemVariation.java b/src/main/java/com/squareup/connect/models/CatalogItemVariation.java index f62d796..e9ddafa 100644 --- a/src/main/java/com/squareup/connect/models/CatalogItemVariation.java +++ b/src/main/java/com/squareup/connect/models/CatalogItemVariation.java @@ -42,6 +42,9 @@ public class CatalogItemVariation { @JsonProperty("upc") private String upc = null; + @JsonProperty("ordinal") + private Integer ordinal = null; + /** * Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. */ @@ -198,6 +201,24 @@ public void setUpc(String upc) { this.upc = upc; } + public CatalogItemVariation ordinal(Integer ordinal) { + this.ordinal = ordinal; + return this; + } + + /** + * The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for each item variation within a parent [CatalogItem](#type-catalogitem) is set according to the item variations's position. On reads, the value is not guaranteed to be sequential or unique. + * @return ordinal + **/ + @ApiModelProperty(value = "The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for each item variation within a parent [CatalogItem](#type-catalogitem) is set according to the item variations's position. On reads, the value is not guaranteed to be sequential or unique.") + public Integer getOrdinal() { + return ordinal; + } + + public void setOrdinal(Integer ordinal) { + this.ordinal = ordinal; + } + public CatalogItemVariation pricingType(PricingTypeEnum pricingType) { this.pricingType = pricingType; return this; @@ -361,6 +382,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.name, catalogItemVariation.name) && Objects.equals(this.sku, catalogItemVariation.sku) && Objects.equals(this.upc, catalogItemVariation.upc) && + Objects.equals(this.ordinal, catalogItemVariation.ordinal) && Objects.equals(this.pricingType, catalogItemVariation.pricingType) && Objects.equals(this.priceMoney, catalogItemVariation.priceMoney) && Objects.equals(this.locationOverrides, catalogItemVariation.locationOverrides) && @@ -373,7 +395,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(itemId, name, sku, upc, pricingType, priceMoney, locationOverrides, trackInventory, inventoryAlertType, inventoryAlertThreshold, userData, serviceDuration); + return Objects.hash(itemId, name, sku, upc, ordinal, pricingType, priceMoney, locationOverrides, trackInventory, inventoryAlertType, inventoryAlertThreshold, userData, serviceDuration); } @@ -386,6 +408,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" sku: ").append(toIndentedString(sku)).append("\n"); sb.append(" upc: ").append(toIndentedString(upc)).append("\n"); + sb.append(" ordinal: ").append(toIndentedString(ordinal)).append("\n"); sb.append(" pricingType: ").append(toIndentedString(pricingType)).append("\n"); sb.append(" priceMoney: ").append(toIndentedString(priceMoney)).append("\n"); sb.append(" locationOverrides: ").append(toIndentedString(locationOverrides)).append("\n"); diff --git a/src/main/java/com/squareup/connect/models/ChargeRequest.java b/src/main/java/com/squareup/connect/models/ChargeRequest.java index daaa132..aee66db 100644 --- a/src/main/java/com/squareup/connect/models/ChargeRequest.java +++ b/src/main/java/com/squareup/connect/models/ChargeRequest.java @@ -297,10 +297,10 @@ public ChargeRequest addAdditionalRecipientsItem(AdditionalRecipient additionalR } /** - * The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in you charge's request. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox. + * 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 `amount_money` value in you charge's request. 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. * @return additionalRecipients **/ - @ApiModelProperty(value = "The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited from here. If you provide this value, the `amount_money` value in your additional_recipients must not be more than 90% of the `amount_money` value in you charge's request. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox.") + @ApiModelProperty(value = "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 `amount_money` value in you charge's request. 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.") public List getAdditionalRecipients() { return additionalRecipients; } diff --git a/src/main/java/com/squareup/connect/models/CreateCheckoutRequest.java b/src/main/java/com/squareup/connect/models/CreateCheckoutRequest.java index e99e64c..dafe131 100644 --- a/src/main/java/com/squareup/connect/models/CreateCheckoutRequest.java +++ b/src/main/java/com/squareup/connect/models/CreateCheckoutRequest.java @@ -192,10 +192,10 @@ public CreateCheckoutRequest addAdditionalRecipientsItem(ChargeRequestAdditional } /** - * The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited 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` calcualted by Square for your order. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox. + * 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. * @return additionalRecipients **/ - @ApiModelProperty(value = "The basic primitive of multi party settlement. The value is optional. The transation facilitated by you can be splited 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` calcualted by Square for your order. The `location_id` must be the valid location of the app owner merchant. This field is currently not supported in sandbox.") + @ApiModelProperty(value = "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.") public List getAdditionalRecipients() { return additionalRecipients; } diff --git a/src/main/java/com/squareup/connect/models/Location.java b/src/main/java/com/squareup/connect/models/Location.java index 40b316b..8313c68 100644 --- a/src/main/java/com/squareup/connect/models/Location.java +++ b/src/main/java/com/squareup/connect/models/Location.java @@ -1073,6 +1073,9 @@ public static TypeEnum fromValue(String text) { @JsonProperty("type") private TypeEnum type = null; + @JsonProperty("website_url") + private String websiteUrl = null; + public Location id(String id) { this.id = id; return this; @@ -1330,6 +1333,24 @@ public void setType(TypeEnum type) { this.type = type; } + public Location websiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + return this; + } + + /** + * The location's website, as set by the account owner in the Square dashboard. Default: none; only exists if explicitly set. + * @return websiteUrl + **/ + @ApiModelProperty(value = "The location's website, as set by the account owner in the Square dashboard. Default: none; only exists if explicitly set.") + public String getWebsiteUrl() { + return websiteUrl; + } + + public void setWebsiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + } + @Override public boolean equals(java.lang.Object o) { @@ -1353,12 +1374,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.currency, location.currency) && Objects.equals(this.phoneNumber, location.phoneNumber) && Objects.equals(this.businessName, location.businessName) && - Objects.equals(this.type, location.type); + Objects.equals(this.type, location.type) && + Objects.equals(this.websiteUrl, location.websiteUrl); } @Override public int hashCode() { - return Objects.hash(id, name, address, timezone, capabilities, status, createdAt, merchantId, country, languageCode, currency, phoneNumber, businessName, type); + return Objects.hash(id, name, address, timezone, capabilities, status, createdAt, merchantId, country, languageCode, currency, phoneNumber, businessName, type, websiteUrl); } @@ -1381,6 +1403,7 @@ public String toString() { sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); sb.append(" businessName: ").append(toIndentedString(businessName)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" websiteUrl: ").append(toIndentedString(websiteUrl)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/squareup/connect/models/Tender.java b/src/main/java/com/squareup/connect/models/Tender.java index ca0ccfe..2540330 100644 --- a/src/main/java/com/squareup/connect/models/Tender.java +++ b/src/main/java/com/squareup/connect/models/Tender.java @@ -50,6 +50,9 @@ public class Tender { @JsonProperty("amount_money") private Money amountMoney = null; + @JsonProperty("tip_money") + private Money tipMoney = null; + @JsonProperty("processing_fee_money") private Money processingFeeMoney = null; @@ -214,6 +217,24 @@ public void setAmountMoney(Money amountMoney) { this.amountMoney = amountMoney; } + public Tender tipMoney(Money tipMoney) { + this.tipMoney = tipMoney; + return this; + } + + /** + * The tip's amount of the tender. + * @return tipMoney + **/ + @ApiModelProperty(value = "The tip's amount of the tender.") + public Money getTipMoney() { + return tipMoney; + } + + public void setTipMoney(Money tipMoney) { + this.tipMoney = tipMoney; + } + public Tender processingFeeMoney(Money processingFeeMoney) { this.processingFeeMoney = processingFeeMoney; return this; @@ -343,6 +364,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.createdAt, tender.createdAt) && Objects.equals(this.note, tender.note) && Objects.equals(this.amountMoney, tender.amountMoney) && + Objects.equals(this.tipMoney, tender.tipMoney) && Objects.equals(this.processingFeeMoney, tender.processingFeeMoney) && Objects.equals(this.customerId, tender.customerId) && Objects.equals(this.type, tender.type) && @@ -353,7 +375,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, locationId, transactionId, createdAt, note, amountMoney, processingFeeMoney, customerId, type, cardDetails, cashDetails, additionalRecipients); + return Objects.hash(id, locationId, transactionId, createdAt, note, amountMoney, tipMoney, processingFeeMoney, customerId, type, cardDetails, cashDetails, additionalRecipients); } @@ -368,6 +390,7 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" note: ").append(toIndentedString(note)).append("\n"); sb.append(" amountMoney: ").append(toIndentedString(amountMoney)).append("\n"); + sb.append(" tipMoney: ").append(toIndentedString(tipMoney)).append("\n"); sb.append(" processingFeeMoney: ").append(toIndentedString(processingFeeMoney)).append("\n"); sb.append(" customerId: ").append(toIndentedString(customerId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/main/java/com/squareup/connect/models/V1PageCell.java b/src/main/java/com/squareup/connect/models/V1PageCell.java index 75a142b..82cfecf 100644 --- a/src/main/java/com/squareup/connect/models/V1PageCell.java +++ b/src/main/java/com/squareup/connect/models/V1PageCell.java @@ -19,8 +19,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; /** * V1PageCell @@ -37,7 +35,7 @@ public class V1PageCell { private Integer column = null; /** - * Gets or Sets objectType + * The type of entity represented in the cell (ITEM, DISCOUNT, CATEGORY, or PLACEHOLDER). */ public enum ObjectTypeEnum { ITEM("ITEM"), @@ -71,13 +69,13 @@ public static ObjectTypeEnum fromValue(String text) { } @JsonProperty("object_type") - private List objectType = new ArrayList(); + private ObjectTypeEnum objectType = null; @JsonProperty("object_id") private String objectId = null; /** - * Gets or Sets placeholderType + * For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior. */ public enum PlaceholderTypeEnum { ALL_ITEMS("ALL_ITEMS"), @@ -109,7 +107,7 @@ public static PlaceholderTypeEnum fromValue(String text) { } @JsonProperty("placeholder_type") - private List placeholderType = new ArrayList(); + private PlaceholderTypeEnum placeholderType = null; public V1PageCell pageId(String pageId) { this.pageId = pageId; @@ -165,26 +163,21 @@ public void setColumn(Integer column) { this.column = column; } - public V1PageCell objectType(List objectType) { + public V1PageCell objectType(ObjectTypeEnum objectType) { this.objectType = objectType; return this; } - public V1PageCell addObjectTypeItem(ObjectTypeEnum objectTypeItem) { - this.objectType.add(objectTypeItem); - return this; - } - /** * The type of entity represented in the cell (ITEM, DISCOUNT, CATEGORY, or PLACEHOLDER). * @return objectType **/ @ApiModelProperty(value = "The type of entity represented in the cell (ITEM, DISCOUNT, CATEGORY, or PLACEHOLDER).") - public List getObjectType() { + public ObjectTypeEnum getObjectType() { return objectType; } - public void setObjectType(List objectType) { + public void setObjectType(ObjectTypeEnum objectType) { this.objectType = objectType; } @@ -206,26 +199,21 @@ public void setObjectId(String objectId) { this.objectId = objectId; } - public V1PageCell placeholderType(List placeholderType) { + public V1PageCell placeholderType(PlaceholderTypeEnum placeholderType) { this.placeholderType = placeholderType; return this; } - public V1PageCell addPlaceholderTypeItem(PlaceholderTypeEnum placeholderTypeItem) { - this.placeholderType.add(placeholderTypeItem); - return this; - } - /** * For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior. * @return placeholderType **/ @ApiModelProperty(value = "For a cell with an object_type of PLACEHOLDER, this value indicates the cell's special behavior.") - public List getPlaceholderType() { + public PlaceholderTypeEnum getPlaceholderType() { return placeholderType; } - public void setPlaceholderType(List placeholderType) { + public void setPlaceholderType(PlaceholderTypeEnum placeholderType) { this.placeholderType = placeholderType; }