From b3c10d1a0d93b82a7631518cc1f7d70901b2067e Mon Sep 17 00:00:00 2001 From: Jenkins Square SDK Update Date: Wed, 23 Sep 2020 18:08:32 +0000 Subject: [PATCH] release --- CHANGELOG.md | 16 +++++++- README.md | 4 +- doc/disputes.md | 20 +++++---- doc/invoices.md | 33 +++++++++------ doc/models/create-payment-request.md | 2 +- doc/models/device-details.md | 2 + doc/models/invoice-status.md | 5 ++- doc/models/list-payment-refunds-request.md | 1 + doc/models/list-payments-request.md | 3 +- doc/models/order-line-item.md | 2 +- doc/orders.md | 16 ++++---- doc/payments.md | 25 ++++++----- doc/refunds.md | 16 +++++--- pom.xml | 2 +- .../com/squareup/square/SquareClient.java | 4 +- .../java/com/squareup/square/api/BaseApi.java | 2 +- .../square/api/DefaultDisputesApi.java | 16 ++------ .../square/api/DefaultInvoicesApi.java | 24 +++-------- .../squareup/square/api/DefaultOrdersApi.java | 10 ----- .../square/api/DefaultPaymentsApi.java | 36 ++++++++-------- .../square/api/DefaultRefundsApi.java | 22 ++++++---- .../com/squareup/square/api/DisputesApi.java | 16 ++------ .../com/squareup/square/api/InvoicesApi.java | 24 +++-------- .../com/squareup/square/api/OrdersApi.java | 10 ----- .../com/squareup/square/api/PaymentsApi.java | 28 ++++++------- .../com/squareup/square/api/RefundsApi.java | 14 ++++--- .../square/models/CreatePaymentRequest.java | 2 + .../squareup/square/models/DeviceDetails.java | 28 ++++++++++++- .../models/ListPaymentRefundsRequest.java | 40 +++++++++++++++--- .../square/models/ListPaymentsRequest.java | 41 ++++++++++++++++--- .../squareup/square/models/OrderLineItem.java | 2 + .../java/com/squareup/square/SanityTest.java | 6 +-- 32 files changed, 274 insertions(+), 198 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bae334b..a0fc09c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## Version 6.4.0.20200923 (2020-09-23) +## Existing API updates +* Invoices API (beta) + * [InvoiceStatus](https://developer.squareup.com/reference/square_2020-09-23/enums/InvoiceStatus) enum. Added the `PAYMENT_PENDING` value. Previously, the Invoices API returned a `PAID` or `PARTIALLY_PAID` status for invoices in a payment pending state. Now, the Invoices API returns a `PAYMENT_PENDING` status for all invoices in a payment pending state, including those previously returned as `PAID` or `PARTIALLY_PAID`. +* Payments API + * [ListPayment](https://developer.squareup.com/reference/square_2020-09-23/payments-api/list-payments). The endpoint now supports the `limit` parameter. +* Refunds API + * [ListPaymentRefunds](https://developer.squareup.com/reference/square_2020-09-23/refunds-api/list-payment-refunds). The endpoint now supports the `limit` parameter. +* [DeviceDetails](https://developer.squareup.com/reference/square_2020-09-23/objects/DeviceDetails#definition__property-device_installation_id). The object now includes the `device_installation_id` field. +## Documentation updates +* [Payment status.](https://developer.squareup.com/docs/payments-api/take-payments#payment-status) Added details about the `Payment.status` changes and how the status relates to the seller receiving the funds. +* [Refund status.](https://developer.squareup.com/docs/payments-api/refund-payments#refund-status) Added details about the `PaymentRefund.status` changes and how the status relates to the cardholder receiving the funds. +* [CreateRefund errors.](https://developer.squareup.com/docs/payments-api/error-codes#createrefund-errors) Added documentation for the `REFUND_DECLINED` error code. + ## Version 6.3.0.20200826 (2020-08-26) ## Existing API updates * Orders API @@ -254,4 +268,4 @@ All SDKs have been updated to support the following changes: * __Beta release:__ SDKs updated to support the new [CashDrawerShifts](cashdrawershift-api/reporting) API. * Square now follows the semantic versioning scheme for all SDKs except PHP and Node.js. This versioning scheme uses three numbers to delineate MAJOR, MINOR, and PATCH versions of our SDK. In addition, the SDK version also includes the API version so you know what Square API version the SDK is related to. For more information, see [Versioning and SDKs](build-basics/versioning-overview#versioning-and-sdks). -* Java, .Net, Python, and Ruby SDKs are now version 4.0.0. Java and .Net SDKs have breaking changes in version 4.0.0. Ruby and Python do not have breaking changes. \ No newline at end of file +* Java, .Net, Python, and Ruby SDKs are now version 4.0.0. Java and .Net SDKs have breaking changes in version 4.0.0. Ruby and Python do not have breaking changes. diff --git a/README.md b/README.md index 0654345a..1348f06b 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Install the client dynamically by adding a dependency to the POM for your projec com.squareup square - 6.3.0.20200826 + 6.4.0.20200923 ``` @@ -330,4 +330,4 @@ You can also use the Square API to create applications or services that work wit [V1 Items]: doc/v1-items.md [Team]: doc/team.md [Transactions]: doc/transactions.md -[Subscriptions]: doc/subscriptions.md \ No newline at end of file +[Subscriptions]: doc/subscriptions.md diff --git a/doc/disputes.md b/doc/disputes.md index 5d768d4a..051f414f 100644 --- a/doc/disputes.md +++ b/doc/disputes.md @@ -23,7 +23,9 @@ DisputesApi disputesApi = client.getDisputesApi(); ## List Disputes Returns a list of disputes associated -with a particular account. +with a particular account. + +Access dispute information: [https://developer.squareup.com/docs/disputes-api/process-disputes#access-dispute-information](https://developer.squareup.com/docs/disputes-api/process-disputes#access-dispute-information) ```java CompletableFuture listDisputesAsync( @@ -100,7 +102,8 @@ dispute state to ACCEPTED. Square debits the disputed amount from the seller’s Square account. If the Square account balance does not have sufficient funds, Square debits the associated bank account. -For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). + +Accept a dispute: [https://developer.squareup.com/docs/disputes-api/process-disputes#accept-a-dispute](https://developer.squareup.com/docs/disputes-api/process-disputes#accept-a-dispute) ```java CompletableFuture acceptDisputeAsync( @@ -245,7 +248,8 @@ disputesApi.retrieveDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(resul Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. -For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + +Challenge a dispute: [https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute](https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute) ```java CompletableFuture createDisputeEvidenceFileAsync( @@ -287,8 +291,9 @@ disputesApi.createDisputeEvidenceFileAsync(disputeId, request, imageFile).thenAc ## Create Dispute Evidence Text -Uploads text to use as evidence for a dispute challenge. For more information, see -[Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). +Uploads text to use as evidence for a dispute challenge. + +Challenge a dispute: [https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute](https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute) ```java CompletableFuture createDisputeEvidenceTextAsync( @@ -334,8 +339,9 @@ evidence uploaded using the [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, and evidence automatically provided by Square, when -available. For more information, see -[Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). +available. + +Challenge a dispute: [https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute](https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute) ```java CompletableFuture submitEvidenceAsync( diff --git a/doc/invoices.md b/doc/invoices.md index 21a4270f..995ce389 100644 --- a/doc/invoices.md +++ b/doc/invoices.md @@ -24,7 +24,8 @@ InvoicesApi invoicesApi = client.getInvoicesApi(); Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you use in a subsequent request to fetch the next set of invoices. -For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). + +Retrieve an invoice: [https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice) ```java CompletableFuture listInvoicesAsync( @@ -66,8 +67,9 @@ Creates a draft [invoice](#type-invoice) for an order created using the Orders API. A draft invoice remains in your account and no action is taken. -You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). -For more information, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/docs/invoices-api/overview). +You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). + +Create and publish an invoice: [https://developer.squareup.com/docs/invoices-api/overview#create-and-publish-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#create-and-publish-an-invoice) ```java CompletableFuture createInvoiceAsync( @@ -162,8 +164,9 @@ retrieve invoices. In the current implementation, you can only specify one locat optionally one customer. The response is paginated. If truncated, the response includes a `cursor` -that you use in a subsequent request to fetch the next set of invoices. -For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). +that you use in a subsequent request to fetch the next set of invoices. + +Retrieve an invoice: [https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice) ```java CompletableFuture searchInvoicesAsync( @@ -218,7 +221,9 @@ invoicesApi.searchInvoicesAsync(body).thenAccept(result -> { Deletes the specified invoice. When an invoice is deleted, the associated Order status changes to CANCELED. You can only delete a draft invoice (you cannot delete an invoice scheduled for publication, or a -published invoice). +published invoice). + +Delete an invoice: [https://developer.squareup.com/docs/invoices-api/overview#delete-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#delete-an-invoice) ```java CompletableFuture deleteInvoiceAsync( @@ -253,7 +258,9 @@ invoicesApi.deleteInvoiceAsync(invoiceId, version).thenAccept(result -> { ## Get Invoice -Retrieves an invoice by invoice ID. +Retrieves an invoice by invoice ID. + +Retrieve an invoice: [https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#retrieve-an-invoice) ```java CompletableFuture getInvoiceAsync( @@ -288,8 +295,9 @@ invoicesApi.getInvoiceAsync(invoiceId).thenAccept(result -> { Updates an invoice by modifying field values, clearing field values, or both as specified in the request. There are no restrictions to updating an invoice in a draft state. -However, there are guidelines for updating a published invoice. -For more information, see [Update an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#update-an-invoice). +However, there are guidelines for updating a published invoice. + +Update an invoice: [https://developer.squareup.com/docs/invoices-api/overview#update-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#update-an-invoice) ```java CompletableFuture updateInvoiceAsync( @@ -371,7 +379,9 @@ invoicesApi.updateInvoiceAsync(invoiceId, body).thenAccept(result -> { Cancels an invoice. The seller cannot collect payments for the canceled invoice. -You cannot cancel an invoice in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. +You cannot cancel an invoice in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. + +Cancel an invoice: [https://developer.squareup.com/docs/invoices-api/overview#cancel-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#cancel-an-invoice) ```java CompletableFuture cancelInvoiceAsync( @@ -420,8 +430,7 @@ based on the invoice configuration. For example, the status changes to `UNPAID` Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the invoice amount). -For more information, see -[Create and publish an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#create-and-publish-an-invoice). +Create and publish an invoice: [https://developer.squareup.com/docs/invoices-api/overview#create-and-publish-an-invoice](https://developer.squareup.com/docs/invoices-api/overview#create-and-publish-an-invoice) ```java CompletableFuture publishInvoiceAsync( diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 61b3ecd4..b7732d13 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -19,7 +19,7 @@ For information about application fees in a payment, see | Name | Type | Tags | Description | Getter | | --- | --- | --- | --- | --- | | `SourceId` | `String` | | The ID for the source of funds for this payment. This can be a nonce
generated by the Payment Form or a card on file made with the Customers API. | String getSourceId() | -| `IdempotencyKey` | `String` | | A unique string that identifies this CreatePayment request. Keys can be any valid string
but must be unique for every CreatePayment request.

Max: 45 characters

See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. | String getIdempotencyKey() | +| `IdempotencyKey` | `String` | | A unique string that identifies this CreatePayment request. Keys can be any valid string
but must be unique for every CreatePayment request.

Max: 45 characters

Note: The number of allowed characters might be less than the stated maximum, if multi-byte
characters are used.

See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. | String getIdempotencyKey() | | `AmountMoney` | [`Money`](/doc/models/money.md) | | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | Money getAmountMoney() | | `TipMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | Money getTipMoney() | | `AppFeeMoney` | [`Money`](/doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.
Fields that do not explicitly define whether they are signed or unsigned are
considered unsigned and can only hold positive amounts. For signed fields, the
sign of the value indicates the purpose of the money transfer. See
[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
for more information. | Money getAppFeeMoney() | diff --git a/doc/models/device-details.md b/doc/models/device-details.md index f9ed5367..9ed835f8 100644 --- a/doc/models/device-details.md +++ b/doc/models/device-details.md @@ -11,6 +11,7 @@ Details about the device that took the payment. | Name | Type | Tags | Description | Getter | | --- | --- | --- | --- | --- | | `DeviceId` | `String` | Optional | Square-issued ID of the device. | String getDeviceId() | +| `DeviceInstallationId` | `String` | Optional | Square-issued installation ID for the device. | String getDeviceInstallationId() | | `DeviceName` | `String` | Optional | The name of the device set by the merchant. | String getDeviceName() | ### Example (as JSON) @@ -18,6 +19,7 @@ Details about the device that took the payment. ```json { "device_id": "device_id6", + "device_installation_id": "device_installation_id8", "device_name": "device_name2" } ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 2f37af49..81582704 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -10,13 +10,14 @@ Indicates the status of an invoice. | Name | Description | | --- | --- | -| `DRAFT` | The invoice is a draft. You must publish a draft invoice before Square can process it.
A draft invoice has no public_url, so it is not available to customers. | +| `DRAFT` | The invoice is a draft. You must publish a draft invoice before Square can process it.
A draft invoice has no `public_url`, so it is not available to customers. | | `UNPAID` | The invoice is published but not yet paid. | -| `SCHEDULED` | The invoice is scheduled to be processed. On scheduled date,
Square emails the invoice (if the `request_method` is EMAIL),
charge the customer's card (if `request_method` is CHARGE_CARD_ON_FILE),
or take no action (if the `request_method` is SHARE_MANUALLY).
The invoice status then changes accordingly (`UNPAID`, `PAID`, or `PARTIALLY_PAID`). | +| `SCHEDULED` | The invoice is scheduled to be processed. On the scheduled date,
Square emails the invoice (if the `request_method` is `EMAIL`),
charges the customer's card (if the `request_method` is `CHARGE_CARD_ON_FILE`),
or takes no action (if the `request_method` is `SHARE_MANUALLY`).
The invoice status then changes accordingly (`UNPAID`, `PAID`, or `PARTIALLY_PAID`). | | `PARTIALLY_PAID` | A partial payment is received for the invoice. | | `PAID` | The customer paid the invoice in full. | | `PARTIALLY_REFUNDED` | The invoice is paid (or partially paid) and some but not all the amount paid is
refunded. | | `REFUNDED` | The full amount that the customer paid for the invoice is refunded. | | `CANCELED` | The invoice is canceled. Square no longer requests payments from the customer.
The `public_url` page remains and is accessible, but it displays the invoice
as cancelled and does not accept payment. | | `FAILED` | Square canceled the invoice due to suspicious activity. | +| `PAYMENT_PENDING` | A payment on the invoice was initiated but has not yet been processed.

When in this state, invoices cannot be updated and other payments cannot be initiated. | diff --git a/doc/models/list-payment-refunds-request.md b/doc/models/list-payment-refunds-request.md index 65fb0e0d..b2c4924c 100644 --- a/doc/models/list-payment-refunds-request.md +++ b/doc/models/list-payment-refunds-request.md @@ -19,6 +19,7 @@ Max results per page: 100 | `LocationId` | `String` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the merchant. | String getLocationId() | | `Status` | `String` | Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](#type-paymentrefund).

Default: If omitted refunds are returned regardless of status. | String getStatus() | | `SourceType` | `String` | Optional | If provided, only refunds with the given source type are returned.
- `CARD` - List refunds only for payments where card was specified as payment
source.

Default: If omitted refunds are returned regardless of source type. | String getSourceType() | +| `Limit` | `Integer` | Optional | Maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, at most 100 results will be returned.

Default: `100` | Integer getLimit() | ### Example (as JSON) diff --git a/doc/models/list-payments-request.md b/doc/models/list-payments-request.md index dfb2bb64..60c692ac 100644 --- a/doc/models/list-payments-request.md +++ b/doc/models/list-payments-request.md @@ -16,10 +16,11 @@ Max results per page: 100 | `EndTime` | `String` | Optional | Timestamp for the end of the requested reporting period, in RFC 3339 format.

Default: The current time. | String getEndTime() | | `SortOrder` | `String` | Optional | The order in which results are listed.
- `ASC` - oldest to newest
- `DESC` - newest to oldest (default). | String getSortOrder() | | `Cursor` | `String` | Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. | String getCursor() | -| `LocationId` | `String` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the merchant. | String getLocationId() | +| `LocationId` | `String` | Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the merchant. | String getLocationId() | | `Total` | `Long` | Optional | The exact amount in the total_money for a `Payment`. | Long getTotal() | | `Last4` | `String` | Optional | The last 4 digits of `Payment` card. | String getLast4() | | `CardBrand` | `String` | Optional | The brand of `Payment` card. For example, `VISA` | String getCardBrand() | +| `Limit` | `Integer` | Optional | Maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, at most 100 results will be returned.

Default: `100` | Integer getLimit() | ### Example (as JSON) diff --git a/doc/models/order-line-item.md b/doc/models/order-line-item.md index fe3b4f9b..4b19ed66 100644 --- a/doc/models/order-line-item.md +++ b/doc/models/order-line-item.md @@ -13,7 +13,7 @@ product to purchase, with its own quantity and price details. | --- | --- | --- | --- | --- | | `Uid` | `String` | Optional | Unique ID that identifies the line item only within this order. | String getUid() | | `Name` | `String` | Optional | The name of the line item. | String getName() | -| `Quantity` | `String` | | The quantity purchased, formatted as a decimal number.
For example: `"3"`.

Line items with a `quantity_unit` can have non-integer quantities.
For example: `"1.70000"`. | String getQuantity() | +| `Quantity` | `String` | | The quantity purchased, formatted as a decimal number.
For example: `"3"`.

Line items with a quantity of `"0"` will be automatically removed
upon paying for or otherwise completing the order.

Line items with a `quantity_unit` can have non-integer quantities.
For example: `"1.70000"`. | String getQuantity() | | `QuantityUnit` | [`OrderQuantityUnit`](/doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision which
specifies the number of digits after the decimal point for decimal quantities. | OrderQuantityUnit getQuantityUnit() | | `Note` | `String` | Optional | The note of the line item. | String getNote() | | `CatalogObjectId` | `String` | Optional | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. | String getCatalogObjectId() | diff --git a/doc/orders.md b/doc/orders.md index 4b623f23..76828673 100644 --- a/doc/orders.md +++ b/doc/orders.md @@ -27,8 +27,7 @@ guide. You can modify open orders using the [UpdateOrder](#endpoint-orders-updateorder) endpoint. -To learn more about the Orders API, see the -[Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). +Create Orders: [https://developer.squareup.com/docs/orders-api/create-orders](https://developer.squareup.com/docs/orders-api/create-orders) ```java CompletableFuture createOrderAsync( @@ -219,7 +218,9 @@ ordersApi.createOrderAsync(body).thenAccept(result -> { Retrieves a set of [Order](#type-order)s by their IDs. -If a given Order ID does not exist, the ID is ignored instead of generating an error. +If a given Order ID does not exist, the ID is ignored instead of generating an error. + +Retrieve orders: [https://developer.squareup.com/docs/orders-api/manage-orders#retrieve-orders](https://developer.squareup.com/docs/orders-api/manage-orders#retrieve-orders) ```java CompletableFuture batchRetrieveOrdersAsync( @@ -414,7 +415,9 @@ how to sort or filter the results. Your SearchOrdersQuery can: Note that details for orders processed with Square Point of Sale while in offline mode may not be transmitted to Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, -not the time it was subsequently transmitted to Square. +not the time it was subsequently transmitted to Square. + +Search orders: [https://developer.squareup.com/docs/orders-api/manage-orders#search-orders](https://developer.squareup.com/docs/orders-api/manage-orders#search-orders) ```java CompletableFuture searchOrdersAsync( @@ -527,8 +530,7 @@ identifying fields to clear. To pay for an order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. -To learn more about the Orders API, see the -[Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). +Update orders: [https://developer.squareup.com/docs/orders-api/manage-orders#update-orders](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders) ```java CompletableFuture updateOrderAsync( @@ -648,7 +650,7 @@ Any approved payments that reference the same `order_id` not specified in the - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture). Using a delayed capture payment with PayOrder will complete the approved payment. -Learn how to [pay for orders with a single payment using the Payments API](https://developer.squareup.com/docs/orders-api/pay-for-orders). +Pay for Orders: [https://developer.squareup.com/docs/orders-api/pay-for-orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) ```java CompletableFuture payOrderAsync( diff --git a/doc/payments.md b/doc/payments.md index 311495ba..d4031cfa 100644 --- a/doc/payments.md +++ b/doc/payments.md @@ -32,7 +32,8 @@ CompletableFuture listPaymentsAsync( final String locationId, final Long total, final String last4, - final String cardBrand) + final String cardBrand, + final Integer limit) ``` ### Parameters @@ -43,10 +44,11 @@ CompletableFuture listPaymentsAsync( | `endTime` | `String` | Query, Optional | Timestamp for the end of the requested reporting period, in RFC 3339 format.

Default: The current time. | | `sortOrder` | `String` | Query, Optional | The order in which results are listed.
- `ASC` - oldest to newest
- `DESC` - newest to oldest (default). | | `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.

See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. | -| `locationId` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the merchant. | +| `locationId` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the merchant. | | `total` | `Long` | Query, Optional | The exact amount in the total_money for a `Payment`. | | `last4` | `String` | Query, Optional | The last 4 digits of `Payment` card. | | `cardBrand` | `String` | Query, Optional | The brand of `Payment` card. For example, `VISA` | +| `limit` | `Integer` | Query, Optional | Maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, at most 100 results will be returned.

Default: `100` | ### Response Type @@ -63,8 +65,9 @@ String locationId = "location_id4"; Long total = 10L; String last4 = "last_42"; String cardBrand = "card_brand6"; +Integer limit = 172; -paymentsApi.listPaymentsAsync(beginTime, endTime, sortOrder, cursor, locationId, total, last4, cardBrand).thenAccept(result -> { +paymentsApi.listPaymentsAsync(beginTime, endTime, sortOrder, cursor, locationId, total, last4, cardBrand, limit).thenAccept(result -> { // TODO success callback handler }).exceptionally(exception -> { // TODO failure callback handler @@ -82,11 +85,11 @@ amount to accept for the payment. There are several optional parameters that you can include in the request. For example, tip money, whether to autocomplete the payment, or a reference ID to correlate this payment with another system. -For more information about these -payment options, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required -to enable application fees. +to enable application fees. + +Take Payments: [https://developer.squareup.com/docs/payments-api/take-payments](https://developer.squareup.com/docs/payments-api/take-payments) ```java CompletableFuture createPaymentAsync( @@ -220,8 +223,9 @@ paymentsApi.getPaymentAsync(paymentId).thenAccept(result -> { ## Cancel Payment Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, -you can cancel the payment using this endpoint. For more information, see -[Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). +you can cancel the payment using this endpoint. + +Delayed capture: [https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments) ```java CompletableFuture cancelPaymentAsync( @@ -257,8 +261,9 @@ Completes (captures) a payment. By default, payments are set to complete immediately after they are created. If you set autocomplete to false when creating a payment, you can complete (capture) -the payment using this endpoint. For more information, see -[Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). +the payment using this endpoint. + +Delayed capture: [https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments) ```java CompletableFuture completePaymentAsync( diff --git a/doc/refunds.md b/doc/refunds.md index 816525b2..60024d60 100644 --- a/doc/refunds.md +++ b/doc/refunds.md @@ -28,7 +28,8 @@ CompletableFuture listPaymentRefundsAsync( final String cursor, final String locationId, final String status, - final String sourceType) + final String sourceType, + final Integer limit) ``` ### Parameters @@ -42,6 +43,7 @@ CompletableFuture listPaymentRefundsAsync( | `locationId` | `String` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the merchant. | | `status` | `String` | Query, Optional | If provided, only refunds with the given status are returned.
For a list of refund status values, see [PaymentRefund](#type-paymentrefund).

Default: If omitted refunds are returned regardless of status. | | `sourceType` | `String` | Query, Optional | If provided, only refunds with the given source type are returned.
- `CARD` - List refunds only for payments where card was specified as payment
source.

Default: If omitted refunds are returned regardless of source type. | +| `limit` | `Integer` | Query, Optional | Maximum number of results to be returned in a single page.
It is possible to receive fewer results than the specified limit on a given page.

If the supplied value is greater than 100, at most 100 results will be returned.

Default: `100` | ### Response Type @@ -57,8 +59,9 @@ String cursor = "cursor6"; String locationId = "location_id4"; String status = "status8"; String sourceType = "source_type0"; +Integer limit = 172; -refundsApi.listPaymentRefundsAsync(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType).thenAccept(result -> { +refundsApi.listPaymentRefundsAsync(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType, limit).thenAccept(result -> { // TODO success callback handler }).exceptionally(exception -> { // TODO failure callback handler @@ -69,8 +72,9 @@ refundsApi.listPaymentRefundsAsync(beginTime, endTime, sortOrder, cursor, locati ## Refund Payment Refunds a payment. You can refund the entire payment amount or a -portion of it. For more information, see -[Payments and Refunds Overview](https://developer.squareup.com/docs/payments-api/overview). +portion of it. + +Refund a payment: [https://developer.squareup.com/docs/payments-api/refund-payments#refund-a-payment](https://developer.squareup.com/docs/payments-api/refund-payments#refund-a-payment) ```java CompletableFuture refundPaymentAsync( @@ -116,7 +120,9 @@ refundsApi.refundPaymentAsync(body).thenAccept(result -> { ## Get Payment Refund -Retrieves a specific `Refund` using the `refund_id`. +Retrieves a specific `Refund` using the `refund_id`. + +Retrieve refund information: [https://developer.squareup.com/docs/payments-api/refund-payments#retrieve-refund-information](https://developer.squareup.com/docs/payments-api/refund-payments#retrieve-refund-information) ```java CompletableFuture getPaymentRefundAsync( diff --git a/pom.xml b/pom.xml index e783b5f5..e6be0758 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.squareup square - 6.3.0.20200826 + 6.4.0.20200923 jar Square diff --git a/src/main/java/com/squareup/square/SquareClient.java b/src/main/java/com/squareup/square/SquareClient.java index 0b34e47b..cb942e3e 100644 --- a/src/main/java/com/squareup/square/SquareClient.java +++ b/src/main/java/com/squareup/square/SquareClient.java @@ -512,7 +512,7 @@ public Headers getAdditionalHeaders() { * @return sdkVersion */ public String getSdkVersion() { - return "6.3.0.20200826"; + return "6.4.0.20200923"; } /** @@ -580,7 +580,7 @@ public Builder newBuilder() { */ public static class Builder { private Environment environment = Environment.PRODUCTION; - private String squareVersion = "2020-08-26"; + private String squareVersion = "2020-09-23"; private String accessToken = "TODO: Replace"; private HttpClient httpClient; private long timeout = 60; diff --git a/src/main/java/com/squareup/square/api/BaseApi.java b/src/main/java/com/squareup/square/api/BaseApi.java index 5562b117..eae74f2e 100644 --- a/src/main/java/com/squareup/square/api/BaseApi.java +++ b/src/main/java/com/squareup/square/api/BaseApi.java @@ -24,7 +24,7 @@ public abstract class BaseApi { * Protected variables to hold an instance of Configuration */ protected final Configuration config; - protected static final String userAgent = "Square-Java-SDK/6.3.0.20200826"; + protected static final String userAgent = "Square-Java-SDK/6.4.0.20200923"; /** * Protected variable to hold an instance of HttpCallback if the user provides it diff --git a/src/main/java/com/squareup/square/api/DefaultDisputesApi.java b/src/main/java/com/squareup/square/api/DefaultDisputesApi.java index bbe59ac1..70bfeb65 100644 --- a/src/main/java/com/squareup/square/api/DefaultDisputesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultDisputesApi.java @@ -258,7 +258,6 @@ private RetrieveDisputeResponse handleRetrieveDisputeResponse(HttpContext contex * Square debits the disputed amount from the seller’s Square * account. If the Square account balance does not have * sufficient funds, Square debits the associated bank account. - * For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). * @param disputeId Required parameter: ID of the dispute you want to accept. * @return Returns the AcceptDisputeResponse response from the API call */ @@ -280,7 +279,6 @@ public AcceptDisputeResponse acceptDispute( * Square debits the disputed amount from the seller’s Square * account. If the Square account balance does not have * sufficient funds, Square debits the associated bank account. - * For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). * @param disputeId Required parameter: ID of the dispute you want to accept. * @return Returns the AcceptDisputeResponse response from the API call */ @@ -651,7 +649,6 @@ private RetrieveDisputeEvidenceResponse handleRetrieveDisputeEvidenceResponse(Ht * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts * HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, * and TIFF formats. - * For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). * @param disputeId Required parameter: ID of the dispute you want to upload evidence for. * @param request Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. * @param imageFile Optional parameter: Example: @@ -674,7 +671,6 @@ public CreateDisputeEvidenceFileResponse createDisputeEvidenceFile( * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts * HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, * and TIFF formats. - * For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). * @param disputeId Required parameter: ID of the dispute you want to upload evidence for. * @param request Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. * @param imageFile Optional parameter: Example: @@ -769,8 +765,7 @@ private CreateDisputeEvidenceFileResponse handleCreateDisputeEvidenceFileRespons } /** - * Uploads text to use as evidence for a dispute challenge. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * Uploads text to use as evidence for a dispute challenge. * @param disputeId Required parameter: The ID of the dispute you want to upload evidence for. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateDisputeEvidenceTextResponse response from the API call @@ -788,8 +783,7 @@ public CreateDisputeEvidenceTextResponse createDisputeEvidenceText( } /** - * Uploads text to use as evidence for a dispute challenge. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * Uploads text to use as evidence for a dispute challenge. * @param disputeId Required parameter: The ID of the dispute you want to upload evidence for. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateDisputeEvidenceTextResponse response from the API call @@ -874,8 +868,7 @@ private CreateDisputeEvidenceTextResponse handleCreateDisputeEvidenceTextRespons * [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and * [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, * and evidence automatically provided by Square, when - * available. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * available. * @param disputeId Required parameter: The ID of the dispute you want to submit evidence for. * @return Returns the SubmitEvidenceResponse response from the API call */ @@ -897,8 +890,7 @@ public SubmitEvidenceResponse submitEvidence( * [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and * [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, * and evidence automatically provided by Square, when - * available. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * available. * @param disputeId Required parameter: The ID of the dispute you want to submit evidence for. * @return Returns the SubmitEvidenceResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java b/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java index 3486e7b5..cf2106d9 100644 --- a/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultInvoicesApi.java @@ -60,7 +60,6 @@ public DefaultInvoicesApi(Configuration config, HttpClient httpClient, Map listPaymentsAsync( @@ -103,8 +106,9 @@ public CompletableFuture listPaymentsAsync( final String locationId, final Long total, final String last4, - final String cardBrand) { - return makeHttpCallAsync(() -> buildListPaymentsRequest(beginTime, endTime, sortOrder, cursor, locationId, total, last4, cardBrand), + final String cardBrand, + final Integer limit) { + return makeHttpCallAsync(() -> buildListPaymentsRequest(beginTime, endTime, sortOrder, cursor, locationId, total, last4, cardBrand, limit), req -> authManagers.get("default").applyAsync(req) .thenCompose(request -> getClientInstance().executeAsStringAsync(request)), context -> handleListPaymentsResponse(context)); @@ -121,7 +125,8 @@ private HttpRequest buildListPaymentsRequest( final String locationId, final Long total, final String last4, - final String cardBrand) { + final String cardBrand, + final Integer limit) { //the base uri for api requests String baseUri = config.getBaseUri(); @@ -138,6 +143,7 @@ private HttpRequest buildListPaymentsRequest( queryParameters.put("total", total); queryParameters.put("last_4", last4); queryParameters.put("card_brand", cardBrand); + queryParameters.put("limit", limit); ApiHelper.appendUrlWithQueryParameters(queryBuilder, queryParameters); //validate and preprocess url String queryUrl = ApiHelper.cleanUrl(queryBuilder); @@ -193,8 +199,6 @@ private ListPaymentsResponse handleListPaymentsResponse(HttpContext context) * There are several optional parameters that you can include in the request. * For example, tip money, whether to autocomplete the payment, or a reference ID * to correlate this payment with another system. - * For more information about these - * payment options, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required * to enable application fees. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -219,8 +223,6 @@ public CreatePaymentResponse createPayment( * There are several optional parameters that you can include in the request. * For example, tip money, whether to autocomplete the payment, or a reference ID * to correlate this payment with another system. - * For more information about these - * payment options, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required * to enable application fees. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -487,8 +489,7 @@ private GetPaymentResponse handleGetPaymentResponse(HttpContext context) /** * Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, - * you can cancel the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * you can cancel the payment using this endpoint. * @param paymentId Required parameter: `payment_id` identifying the payment to be canceled. * @return Returns the CancelPaymentResponse response from the API call */ @@ -505,8 +506,7 @@ public CancelPaymentResponse cancelPayment( /** * Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, - * you can cancel the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * you can cancel the payment using this endpoint. * @param paymentId Required parameter: `payment_id` identifying the payment to be canceled. * @return Returns the CancelPaymentResponse response from the API call */ @@ -583,8 +583,7 @@ private CancelPaymentResponse handleCancelPaymentResponse(HttpContext context) * Completes (captures) a payment. * By default, payments are set to complete immediately after they are created. * If you set autocomplete to false when creating a payment, you can complete (capture) - * the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * the payment using this endpoint. * @param paymentId Required parameter: Unique ID identifying the payment to be completed. * @return Returns the CompletePaymentResponse response from the API call */ @@ -603,8 +602,7 @@ public CompletePaymentResponse completePayment( * Completes (captures) a payment. * By default, payments are set to complete immediately after they are created. * If you set autocomplete to false when creating a payment, you can complete (capture) - * the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * the payment using this endpoint. * @param paymentId Required parameter: Unique ID identifying the payment to be completed. * @return Returns the CompletePaymentResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/api/DefaultRefundsApi.java b/src/main/java/com/squareup/square/api/DefaultRefundsApi.java index c97f4a7e..3ef13a98 100644 --- a/src/main/java/com/squareup/square/api/DefaultRefundsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultRefundsApi.java @@ -57,6 +57,7 @@ public DefaultRefundsApi(Configuration config, HttpClient httpClient, Map listPaymentRefundsAsync( @@ -95,8 +98,9 @@ public CompletableFuture listPaymentRefundsAsync( final String cursor, final String locationId, final String status, - final String sourceType) { - return makeHttpCallAsync(() -> buildListPaymentRefundsRequest(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType), + final String sourceType, + final Integer limit) { + return makeHttpCallAsync(() -> buildListPaymentRefundsRequest(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType, limit), req -> authManagers.get("default").applyAsync(req) .thenCompose(request -> getClientInstance().executeAsStringAsync(request)), context -> handleListPaymentRefundsResponse(context)); @@ -112,7 +116,8 @@ private HttpRequest buildListPaymentRefundsRequest( final String cursor, final String locationId, final String status, - final String sourceType) { + final String sourceType, + final Integer limit) { //the base uri for api requests String baseUri = config.getBaseUri(); @@ -128,6 +133,7 @@ private HttpRequest buildListPaymentRefundsRequest( queryParameters.put("location_id", locationId); queryParameters.put("status", status); queryParameters.put("source_type", sourceType); + queryParameters.put("limit", limit); ApiHelper.appendUrlWithQueryParameters(queryBuilder, queryParameters); //validate and preprocess url String queryUrl = ApiHelper.cleanUrl(queryBuilder); @@ -177,8 +183,7 @@ private ListPaymentRefundsResponse handleListPaymentRefundsResponse(HttpContext /** * Refunds a payment. You can refund the entire payment amount or a - * portion of it. For more information, see - * [Payments and Refunds Overview](https://developer.squareup.com/docs/payments-api/overview). + * portion of it. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the RefundPaymentResponse response from the API call */ @@ -195,8 +200,7 @@ public RefundPaymentResponse refundPayment( /** * Refunds a payment. You can refund the entire payment amount or a - * portion of it. For more information, see - * [Payments and Refunds Overview](https://developer.squareup.com/docs/payments-api/overview). + * portion of it. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the RefundPaymentResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/api/DisputesApi.java b/src/main/java/com/squareup/square/api/DisputesApi.java index d08a84de..a71b94a3 100644 --- a/src/main/java/com/squareup/square/api/DisputesApi.java +++ b/src/main/java/com/squareup/square/api/DisputesApi.java @@ -70,7 +70,6 @@ CompletableFuture retrieveDisputeAsync( * Square debits the disputed amount from the seller’s Square * account. If the Square account balance does not have * sufficient funds, Square debits the associated bank account. - * For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). * @param disputeId Required parameter: ID of the dispute you want to accept. * @return Returns the AcceptDisputeResponse response from the API call */ @@ -84,7 +83,6 @@ AcceptDisputeResponse acceptDispute( * Square debits the disputed amount from the seller’s Square * account. If the Square account balance does not have * sufficient funds, Square debits the associated bank account. - * For an overview of the Disputes API, see [Overview](https://developer.squareup.com/docs/docs/disputes-api/overview). * @param disputeId Required parameter: ID of the dispute you want to accept. * @return Returns the AcceptDisputeResponse response from the API call */ @@ -163,7 +161,6 @@ CompletableFuture retrieveDisputeEvidenceAsync( * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts * HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, * and TIFF formats. - * For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). * @param disputeId Required parameter: ID of the dispute you want to upload evidence for. * @param request Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. * @param imageFile Optional parameter: Example: @@ -178,7 +175,6 @@ CreateDisputeEvidenceFileResponse createDisputeEvidenceFile( * Uploads a file to use as evidence in a dispute challenge. The endpoint accepts * HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, * and TIFF formats. - * For more information, see [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). * @param disputeId Required parameter: ID of the dispute you want to upload evidence for. * @param request Optional parameter: Defines parameters for a CreateDisputeEvidenceFile request. * @param imageFile Optional parameter: Example: @@ -190,8 +186,7 @@ CompletableFuture createDisputeEvidenceFileAs final FileWrapper imageFile); /** - * Uploads text to use as evidence for a dispute challenge. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * Uploads text to use as evidence for a dispute challenge. * @param disputeId Required parameter: The ID of the dispute you want to upload evidence for. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateDisputeEvidenceTextResponse response from the API call @@ -201,8 +196,7 @@ CreateDisputeEvidenceTextResponse createDisputeEvidenceText( final CreateDisputeEvidenceTextRequest body) throws ApiException, IOException; /** - * Uploads text to use as evidence for a dispute challenge. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * Uploads text to use as evidence for a dispute challenge. * @param disputeId Required parameter: The ID of the dispute you want to upload evidence for. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateDisputeEvidenceTextResponse response from the API call @@ -218,8 +212,7 @@ CompletableFuture createDisputeEvidenceTextAs * [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and * [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, * and evidence automatically provided by Square, when - * available. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * available. * @param disputeId Required parameter: The ID of the dispute you want to submit evidence for. * @return Returns the SubmitEvidenceResponse response from the API call */ @@ -233,8 +226,7 @@ SubmitEvidenceResponse submitEvidence( * [CreateDisputeEvidenceFile](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-file) and * [CreateDisputeEvidenceText](https://developer.squareup.com/docs/reference/square/disputes-api/create-dispute-evidence-text) endpoints, * and evidence automatically provided by Square, when - * available. For more information, see - * [Challenge a Dispute](https://developer.squareup.com/docs/docs/disputes-api/process-disputes#challenge-a-dispute). + * available. * @param disputeId Required parameter: The ID of the dispute you want to submit evidence for. * @return Returns the SubmitEvidenceResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/api/InvoicesApi.java b/src/main/java/com/squareup/square/api/InvoicesApi.java index 70591611..46179ecb 100644 --- a/src/main/java/com/squareup/square/api/InvoicesApi.java +++ b/src/main/java/com/squareup/square/api/InvoicesApi.java @@ -26,7 +26,6 @@ public interface InvoicesApi { * Returns a list of invoices for a given location. The response * is paginated. If truncated, the response includes a `cursor` that you * use in a subsequent request to fetch the next set of invoices. - * For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). * @param locationId Required parameter: The ID of the location for which to list invoices. * @param cursor Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for your original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). * @param limit Optional parameter: The maximum number of invoices to return (200 is the maximum `limit`). If not provided, the server uses a default limit of 100 invoices. @@ -41,7 +40,6 @@ ListInvoicesResponse listInvoices( * Returns a list of invoices for a given location. The response * is paginated. If truncated, the response includes a `cursor` that you * use in a subsequent request to fetch the next set of invoices. - * For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). * @param locationId Required parameter: The ID of the location for which to list invoices. * @param cursor Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for your original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). * @param limit Optional parameter: The maximum number of invoices to return (200 is the maximum `limit`). If not provided, the server uses a default limit of 100 invoices. @@ -56,8 +54,7 @@ CompletableFuture listInvoicesAsync( * Creates a draft [invoice](#type-invoice) * for an order created using the Orders API. * A draft invoice remains in your account and no action is taken. - * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). - * For more information, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/docs/invoices-api/overview). + * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateInvoiceResponse response from the API call */ @@ -68,8 +65,7 @@ CreateInvoiceResponse createInvoice( * Creates a draft [invoice](#type-invoice) * for an order created using the Orders API. * A draft invoice remains in your account and no action is taken. - * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). - * For more information, see [Manage Invoices Using the Invoices API](https://developer.squareup.com/docs/docs/invoices-api/overview). + * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateInvoiceResponse response from the API call */ @@ -82,8 +78,7 @@ CompletableFuture createInvoiceAsync( * retrieve invoices. In the current implementation, you can only specify one location and * optionally one customer. * The response is paginated. If truncated, the response includes a `cursor` - * that you use in a subsequent request to fetch the next set of invoices. - * For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). + * that you use in a subsequent request to fetch the next set of invoices. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the SearchInvoicesResponse response from the API call */ @@ -96,8 +91,7 @@ SearchInvoicesResponse searchInvoices( * retrieve invoices. In the current implementation, you can only specify one location and * optionally one customer. * The response is paginated. If truncated, the response includes a `cursor` - * that you use in a subsequent request to fetch the next set of invoices. - * For more information about retrieving invoices, see [Retrieve invoices](https://developer.squareup.com/docs/docs/invoices-api/overview#retrieve-invoices). + * that you use in a subsequent request to fetch the next set of invoices. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the SearchInvoicesResponse response from the API call */ @@ -150,8 +144,7 @@ CompletableFuture getInvoiceAsync( * Updates an invoice by modifying field values, clearing field values, or both * as specified in the request. * There are no restrictions to updating an invoice in a draft state. - * However, there are guidelines for updating a published invoice. - * For more information, see [Update an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#update-an-invoice). + * However, there are guidelines for updating a published invoice. * @param invoiceId Required parameter: The id of the invoice to update. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the UpdateInvoiceResponse response from the API call @@ -164,8 +157,7 @@ UpdateInvoiceResponse updateInvoice( * Updates an invoice by modifying field values, clearing field values, or both * as specified in the request. * There are no restrictions to updating an invoice in a draft state. - * However, there are guidelines for updating a published invoice. - * For more information, see [Update an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#update-an-invoice). + * However, there are guidelines for updating a published invoice. * @param invoiceId Required parameter: The id of the invoice to update. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the UpdateInvoiceResponse response from the API call @@ -208,8 +200,6 @@ CompletableFuture cancelInvoiceAsync( * based on the invoice configuration. For example, the status changes to `UNPAID` if * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the * invoice amount). - * For more information, see - * [Create and publish an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#create-and-publish-an-invoice). * @param invoiceId Required parameter: The id of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the PublishInvoiceResponse response from the API call @@ -228,8 +218,6 @@ PublishInvoiceResponse publishInvoice( * based on the invoice configuration. For example, the status changes to `UNPAID` if * Square emails the invoice or `PARTIALLY_PAID` if Square charge a card on file for a portion of the * invoice amount). - * For more information, see - * [Create and publish an invoice](https://developer.squareup.com/docs/docs/invoices-api/overview#create-and-publish-an-invoice). * @param invoiceId Required parameter: The id of the invoice to publish. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the PublishInvoiceResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/OrdersApi.java b/src/main/java/com/squareup/square/api/OrdersApi.java index fdfa8f5f..a7109aa9 100644 --- a/src/main/java/com/squareup/square/api/OrdersApi.java +++ b/src/main/java/com/squareup/square/api/OrdersApi.java @@ -27,8 +27,6 @@ public interface OrdersApi { * To pay for a created order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) * guide. * You can modify open orders using the [UpdateOrder](#endpoint-orders-updateorder) endpoint. - * To learn more about the Orders API, see the - * [Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateOrderResponse response from the API call */ @@ -41,8 +39,6 @@ CreateOrderResponse createOrder( * To pay for a created order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) * guide. * You can modify open orders using the [UpdateOrder](#endpoint-orders-updateorder) endpoint. - * To learn more about the Orders API, see the - * [Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the CreateOrderResponse response from the API call */ @@ -137,8 +133,6 @@ CompletableFuture searchOrdersAsync( * - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation) * identifying fields to clear. * To pay for an order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. - * To learn more about the Orders API, see the - * [Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). * @param orderId Required parameter: The ID of the order to update. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the UpdateOrderResponse response from the API call @@ -159,8 +153,6 @@ UpdateOrderResponse updateOrder( * - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders#on-dot-notation) * identifying fields to clear. * To pay for an order, please refer to the [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders) guide. - * To learn more about the Orders API, see the - * [Orders API Overview](https://developer.squareup.com/docs/orders-api/what-it-does). * @param orderId Required parameter: The ID of the order to update. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the UpdateOrderResponse response from the API call @@ -181,7 +173,6 @@ CompletableFuture updateOrderAsync( * `payment_ids` will be canceled. * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture). * Using a delayed capture payment with PayOrder will complete the approved payment. - * Learn how to [pay for orders with a single payment using the Payments API](https://developer.squareup.com/docs/orders-api/pay-for-orders). * @param orderId Required parameter: The ID of the order being paid. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the PayOrderResponse response from the API call @@ -202,7 +193,6 @@ PayOrderResponse payOrder( * `payment_ids` will be canceled. * - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments#delayed-capture). * Using a delayed capture payment with PayOrder will complete the approved payment. - * Learn how to [pay for orders with a single payment using the Payments API](https://developer.squareup.com/docs/orders-api/pay-for-orders). * @param orderId Required parameter: The ID of the order being paid. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the PayOrderResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/PaymentsApi.java b/src/main/java/com/squareup/square/api/PaymentsApi.java index 6da6f39e..4ba70dbf 100644 --- a/src/main/java/com/squareup/square/api/PaymentsApi.java +++ b/src/main/java/com/squareup/square/api/PaymentsApi.java @@ -24,10 +24,11 @@ public interface PaymentsApi { * @param endTime Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. * @param sortOrder Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). * @param cursor Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. + * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for the default (main) location associated with the merchant. * @param total Optional parameter: The exact amount in the total_money for a `Payment`. * @param last4 Optional parameter: The last 4 digits of `Payment` card. * @param cardBrand Optional parameter: The brand of `Payment` card. For example, `VISA` + * @param limit Optional parameter: Maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. If the supplied value is greater than 100, at most 100 results will be returned. Default: `100` * @return Returns the ListPaymentsResponse response from the API call */ ListPaymentsResponse listPayments( @@ -38,7 +39,8 @@ ListPaymentsResponse listPayments( final String locationId, final Long total, final String last4, - final String cardBrand) throws ApiException, IOException; + final String cardBrand, + final Integer limit) throws ApiException, IOException; /** * Retrieves a list of payments taken by the account making the request. @@ -47,10 +49,11 @@ ListPaymentsResponse listPayments( * @param endTime Optional parameter: Timestamp for the end of the requested reporting period, in RFC 3339 format. Default: The current time. * @param sortOrder Optional parameter: The order in which results are listed. - `ASC` - oldest to newest - `DESC` - newest to oldest (default). * @param cursor Optional parameter: A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. - * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. + * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for the default (main) location associated with the merchant. * @param total Optional parameter: The exact amount in the total_money for a `Payment`. * @param last4 Optional parameter: The last 4 digits of `Payment` card. * @param cardBrand Optional parameter: The brand of `Payment` card. For example, `VISA` + * @param limit Optional parameter: Maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. If the supplied value is greater than 100, at most 100 results will be returned. Default: `100` * @return Returns the ListPaymentsResponse response from the API call */ CompletableFuture listPaymentsAsync( @@ -61,7 +64,8 @@ CompletableFuture listPaymentsAsync( final String locationId, final Long total, final String last4, - final String cardBrand); + final String cardBrand, + final Integer limit); /** * Charges a payment source, for example, a card @@ -71,8 +75,6 @@ CompletableFuture listPaymentsAsync( * There are several optional parameters that you can include in the request. * For example, tip money, whether to autocomplete the payment, or a reference ID * to correlate this payment with another system. - * For more information about these - * payment options, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required * to enable application fees. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -89,8 +91,6 @@ CreatePaymentResponse createPayment( * There are several optional parameters that you can include in the request. * For example, tip money, whether to autocomplete the payment, or a reference ID * to correlate this payment with another system. - * For more information about these - * payment options, see [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments). * The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required * to enable application fees. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. @@ -149,8 +149,7 @@ CompletableFuture getPaymentAsync( /** * Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, - * you can cancel the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * you can cancel the payment using this endpoint. * @param paymentId Required parameter: `payment_id` identifying the payment to be canceled. * @return Returns the CancelPaymentResponse response from the API call */ @@ -159,8 +158,7 @@ CancelPaymentResponse cancelPayment( /** * Cancels (voids) a payment. If you set `autocomplete` to false when creating a payment, - * you can cancel the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * you can cancel the payment using this endpoint. * @param paymentId Required parameter: `payment_id` identifying the payment to be canceled. * @return Returns the CancelPaymentResponse response from the API call */ @@ -171,8 +169,7 @@ CompletableFuture cancelPaymentAsync( * Completes (captures) a payment. * By default, payments are set to complete immediately after they are created. * If you set autocomplete to false when creating a payment, you can complete (capture) - * the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * the payment using this endpoint. * @param paymentId Required parameter: Unique ID identifying the payment to be completed. * @return Returns the CompletePaymentResponse response from the API call */ @@ -183,8 +180,7 @@ CompletePaymentResponse completePayment( * Completes (captures) a payment. * By default, payments are set to complete immediately after they are created. * If you set autocomplete to false when creating a payment, you can complete (capture) - * the payment using this endpoint. For more information, see - * [Delayed Payments](https://developer.squareup.com/docs/payments-api/take-payments#delayed-payments). + * the payment using this endpoint. * @param paymentId Required parameter: Unique ID identifying the payment to be completed. * @return Returns the CompletePaymentResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/api/RefundsApi.java b/src/main/java/com/squareup/square/api/RefundsApi.java index 1ad4c2b8..01862724 100644 --- a/src/main/java/com/squareup/square/api/RefundsApi.java +++ b/src/main/java/com/squareup/square/api/RefundsApi.java @@ -23,6 +23,7 @@ public interface RefundsApi { * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. * @param status Optional parameter: If provided, only refunds with the given status are returned. For a list of refund status values, see [PaymentRefund](#type-paymentrefund). Default: If omitted refunds are returned regardless of status. * @param sourceType Optional parameter: If provided, only refunds with the given source type are returned. - `CARD` - List refunds only for payments where card was specified as payment source. Default: If omitted refunds are returned regardless of source type. + * @param limit Optional parameter: Maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. If the supplied value is greater than 100, at most 100 results will be returned. Default: `100` * @return Returns the ListPaymentRefundsResponse response from the API call */ ListPaymentRefundsResponse listPaymentRefunds( @@ -32,7 +33,8 @@ ListPaymentRefundsResponse listPaymentRefunds( final String cursor, final String locationId, final String status, - final String sourceType) throws ApiException, IOException; + final String sourceType, + final Integer limit) throws ApiException, IOException; /** * Retrieves a list of refunds for the account making the request. @@ -44,6 +46,7 @@ ListPaymentRefundsResponse listPaymentRefunds( * @param locationId Optional parameter: Limit results to the location supplied. By default, results are returned for all locations associated with the merchant. * @param status Optional parameter: If provided, only refunds with the given status are returned. For a list of refund status values, see [PaymentRefund](#type-paymentrefund). Default: If omitted refunds are returned regardless of status. * @param sourceType Optional parameter: If provided, only refunds with the given source type are returned. - `CARD` - List refunds only for payments where card was specified as payment source. Default: If omitted refunds are returned regardless of source type. + * @param limit Optional parameter: Maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. If the supplied value is greater than 100, at most 100 results will be returned. Default: `100` * @return Returns the ListPaymentRefundsResponse response from the API call */ CompletableFuture listPaymentRefundsAsync( @@ -53,12 +56,12 @@ CompletableFuture listPaymentRefundsAsync( final String cursor, final String locationId, final String status, - final String sourceType); + final String sourceType, + final Integer limit); /** * Refunds a payment. You can refund the entire payment amount or a - * portion of it. For more information, see - * [Payments and Refunds Overview](https://developer.squareup.com/docs/payments-api/overview). + * portion of it. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the RefundPaymentResponse response from the API call */ @@ -67,8 +70,7 @@ RefundPaymentResponse refundPayment( /** * Refunds a payment. You can refund the entire payment amount or a - * portion of it. For more information, see - * [Payments and Refunds Overview](https://developer.squareup.com/docs/payments-api/overview). + * portion of it. * @param body Required parameter: An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return Returns the RefundPaymentResponse response from the API call */ diff --git a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java index 526cfa4d..3a8ae7cd 100644 --- a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java +++ b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java @@ -105,6 +105,8 @@ public String getSourceId() { * A unique string that identifies this CreatePayment request. Keys can be any valid string * but must be unique for every CreatePayment request. * Max: 45 characters + * Note: The number of allowed characters might be less than the stated maximum, if multi-byte + * characters are used. * See [Idempotency keys](https://developer.squareup.com/docs/basics/api101/idempotency) for more information. */ @JsonGetter("idempotency_key") diff --git a/src/main/java/com/squareup/square/models/DeviceDetails.java b/src/main/java/com/squareup/square/models/DeviceDetails.java index c925a511..42fb0463 100644 --- a/src/main/java/com/squareup/square/models/DeviceDetails.java +++ b/src/main/java/com/squareup/square/models/DeviceDetails.java @@ -14,17 +14,21 @@ public class DeviceDetails { /** * Initialization constructor. * @param deviceId + * @param deviceInstallationId * @param deviceName */ @JsonCreator public DeviceDetails( @JsonProperty("device_id") String deviceId, + @JsonProperty("device_installation_id") String deviceInstallationId, @JsonProperty("device_name") String deviceName) { this.deviceId = deviceId; + this.deviceInstallationId = deviceInstallationId; this.deviceName = deviceName; } private final String deviceId; + private final String deviceInstallationId; private final String deviceName; /** * Getter for DeviceId. @@ -35,6 +39,15 @@ public String getDeviceId() { return this.deviceId; } + /** + * Getter for DeviceInstallationId. + * Square-issued installation ID for the device. + */ + @JsonGetter("device_installation_id") + public String getDeviceInstallationId() { + return this.deviceInstallationId; + } + /** * Getter for DeviceName. * The name of the device set by the merchant. @@ -47,7 +60,7 @@ public String getDeviceName() { @Override public int hashCode() { - return Objects.hash(deviceId, deviceName); + return Objects.hash(deviceId, deviceInstallationId, deviceName); } @Override @@ -60,6 +73,7 @@ public boolean equals(Object obj) { } DeviceDetails deviceDetails = (DeviceDetails) obj; return Objects.equals(deviceId, deviceDetails.deviceId) && + Objects.equals(deviceInstallationId, deviceDetails.deviceInstallationId) && Objects.equals(deviceName, deviceDetails.deviceName); } @@ -71,6 +85,7 @@ public boolean equals(Object obj) { public Builder toBuilder() { Builder builder = new Builder() .deviceId(getDeviceId()) + .deviceInstallationId(getDeviceInstallationId()) .deviceName(getDeviceName()); return builder; } @@ -80,6 +95,7 @@ public Builder toBuilder() { */ public static class Builder { private String deviceId; + private String deviceInstallationId; private String deviceName; /** @@ -98,6 +114,15 @@ public Builder deviceId(String deviceId) { this.deviceId = deviceId; return this; } + /** + * Setter for deviceInstallationId + * @param deviceInstallationId + * @return Builder + */ + public Builder deviceInstallationId(String deviceInstallationId) { + this.deviceInstallationId = deviceInstallationId; + return this; + } /** * Setter for deviceName * @param deviceName @@ -114,6 +139,7 @@ public Builder deviceName(String deviceName) { */ public DeviceDetails build() { return new DeviceDetails(deviceId, + deviceInstallationId, deviceName); } } diff --git a/src/main/java/com/squareup/square/models/ListPaymentRefundsRequest.java b/src/main/java/com/squareup/square/models/ListPaymentRefundsRequest.java index 5186cd1e..65bdd890 100644 --- a/src/main/java/com/squareup/square/models/ListPaymentRefundsRequest.java +++ b/src/main/java/com/squareup/square/models/ListPaymentRefundsRequest.java @@ -20,6 +20,7 @@ public class ListPaymentRefundsRequest { * @param locationId * @param status * @param sourceType + * @param limit */ @JsonCreator public ListPaymentRefundsRequest( @@ -29,7 +30,8 @@ public ListPaymentRefundsRequest( @JsonProperty("cursor") String cursor, @JsonProperty("location_id") String locationId, @JsonProperty("status") String status, - @JsonProperty("source_type") String sourceType) { + @JsonProperty("source_type") String sourceType, + @JsonProperty("limit") Integer limit) { this.beginTime = beginTime; this.endTime = endTime; this.sortOrder = sortOrder; @@ -37,6 +39,7 @@ public ListPaymentRefundsRequest( this.locationId = locationId; this.status = status; this.sourceType = sourceType; + this.limit = limit; } private final String beginTime; @@ -46,6 +49,7 @@ public ListPaymentRefundsRequest( private final String locationId; private final String status; private final String sourceType; + private final Integer limit; /** * Getter for BeginTime. * Timestamp for the beginning of the requested reporting period, in RFC 3339 format. @@ -121,10 +125,23 @@ public String getSourceType() { return this.sourceType; } + /** + * Getter for Limit. + * Maximum number of results to be returned in a single page. + * It is possible to receive fewer results than the specified limit on a given page. + * If the supplied value is greater than 100, at most 100 results will be returned. + * Default: `100` + */ + @JsonGetter("limit") + public Integer getLimit() { + return this.limit; + } + @Override public int hashCode() { - return Objects.hash(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType); + return Objects.hash(beginTime, endTime, sortOrder, cursor, locationId, status, sourceType, + limit); } @Override @@ -142,7 +159,8 @@ public boolean equals(Object obj) { Objects.equals(cursor, listPaymentRefundsRequest.cursor) && Objects.equals(locationId, listPaymentRefundsRequest.locationId) && Objects.equals(status, listPaymentRefundsRequest.status) && - Objects.equals(sourceType, listPaymentRefundsRequest.sourceType); + Objects.equals(sourceType, listPaymentRefundsRequest.sourceType) && + Objects.equals(limit, listPaymentRefundsRequest.limit); } /** @@ -158,7 +176,8 @@ public Builder toBuilder() { .cursor(getCursor()) .locationId(getLocationId()) .status(getStatus()) - .sourceType(getSourceType()); + .sourceType(getSourceType()) + .limit(getLimit()); return builder; } @@ -173,6 +192,7 @@ public static class Builder { private String locationId; private String status; private String sourceType; + private Integer limit; /** * Initialization constructor @@ -244,6 +264,15 @@ public Builder sourceType(String sourceType) { this.sourceType = sourceType; return this; } + /** + * Setter for limit + * @param limit + * @return Builder + */ + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } /** * Builds a new {@link ListPaymentRefundsRequest} object using the set fields. @@ -256,7 +285,8 @@ public ListPaymentRefundsRequest build() { cursor, locationId, status, - sourceType); + sourceType, + limit); } } } diff --git a/src/main/java/com/squareup/square/models/ListPaymentsRequest.java b/src/main/java/com/squareup/square/models/ListPaymentsRequest.java index 65c50c3a..6a51d71d 100644 --- a/src/main/java/com/squareup/square/models/ListPaymentsRequest.java +++ b/src/main/java/com/squareup/square/models/ListPaymentsRequest.java @@ -21,6 +21,7 @@ public class ListPaymentsRequest { * @param total * @param last4 * @param cardBrand + * @param limit */ @JsonCreator public ListPaymentsRequest( @@ -31,7 +32,8 @@ public ListPaymentsRequest( @JsonProperty("location_id") String locationId, @JsonProperty("total") Long total, @JsonProperty("last_4") String last4, - @JsonProperty("card_brand") String cardBrand) { + @JsonProperty("card_brand") String cardBrand, + @JsonProperty("limit") Integer limit) { this.beginTime = beginTime; this.endTime = endTime; this.sortOrder = sortOrder; @@ -40,6 +42,7 @@ public ListPaymentsRequest( this.total = total; this.last4 = last4; this.cardBrand = cardBrand; + this.limit = limit; } private final String beginTime; @@ -50,6 +53,7 @@ public ListPaymentsRequest( private final Long total; private final String last4; private final String cardBrand; + private final Integer limit; /** * Getter for BeginTime. * Timestamp for the beginning of the reporting period, in RFC 3339 format. @@ -95,7 +99,7 @@ public String getCursor() { /** * Getter for LocationId. * Limit results to the location supplied. By default, results are returned - * for all locations associated with the merchant. + * for the default (main) location associated with the merchant. */ @JsonGetter("location_id") public String getLocationId() { @@ -129,11 +133,23 @@ public String getCardBrand() { return this.cardBrand; } + /** + * Getter for Limit. + * Maximum number of results to be returned in a single page. + * It is possible to receive fewer results than the specified limit on a given page. + * If the supplied value is greater than 100, at most 100 results will be returned. + * Default: `100` + */ + @JsonGetter("limit") + public Integer getLimit() { + return this.limit; + } + @Override public int hashCode() { return Objects.hash(beginTime, endTime, sortOrder, cursor, locationId, total, last4, - cardBrand); + cardBrand, limit); } @Override @@ -152,7 +168,8 @@ public boolean equals(Object obj) { Objects.equals(locationId, listPaymentsRequest.locationId) && Objects.equals(total, listPaymentsRequest.total) && Objects.equals(last4, listPaymentsRequest.last4) && - Objects.equals(cardBrand, listPaymentsRequest.cardBrand); + Objects.equals(cardBrand, listPaymentsRequest.cardBrand) && + Objects.equals(limit, listPaymentsRequest.limit); } /** @@ -169,7 +186,8 @@ public Builder toBuilder() { .locationId(getLocationId()) .total(getTotal()) .last4(getLast4()) - .cardBrand(getCardBrand()); + .cardBrand(getCardBrand()) + .limit(getLimit()); return builder; } @@ -185,6 +203,7 @@ public static class Builder { private Long total; private String last4; private String cardBrand; + private Integer limit; /** * Initialization constructor @@ -265,6 +284,15 @@ public Builder cardBrand(String cardBrand) { this.cardBrand = cardBrand; return this; } + /** + * Setter for limit + * @param limit + * @return Builder + */ + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } /** * Builds a new {@link ListPaymentsRequest} object using the set fields. @@ -278,7 +306,8 @@ public ListPaymentsRequest build() { locationId, total, last4, - cardBrand); + cardBrand, + limit); } } } diff --git a/src/main/java/com/squareup/square/models/OrderLineItem.java b/src/main/java/com/squareup/square/models/OrderLineItem.java index 63933415..4043e8e2 100644 --- a/src/main/java/com/squareup/square/models/OrderLineItem.java +++ b/src/main/java/com/squareup/square/models/OrderLineItem.java @@ -110,6 +110,8 @@ public String getName() { * Getter for Quantity. * The quantity purchased, formatted as a decimal number. * For example: `"3"`. + * Line items with a quantity of `"0"` will be automatically removed + * upon paying for or otherwise completing the order. * Line items with a `quantity_unit` can have non-integer quantities. * For example: `"1.70000"`. */ diff --git a/src/test/java/com/squareup/square/SanityTest.java b/src/test/java/com/squareup/square/SanityTest.java index 3ca0356f..2c2cea9b 100644 --- a/src/test/java/com/squareup/square/SanityTest.java +++ b/src/test/java/com/squareup/square/SanityTest.java @@ -9,7 +9,6 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ - package com.squareup.square; import static org.hamcrest.CoreMatchers.instanceOf; @@ -40,6 +39,7 @@ import com.squareup.square.api.CatalogApi; import com.squareup.square.api.CustomersApi; import com.squareup.square.api.LocationsApi; +import com.squareup.square.api.PaymentsApi; import com.squareup.square.api.V1LocationsApi; import com.squareup.square.exceptions.ApiException; import com.squareup.square.models.Error; @@ -101,10 +101,10 @@ public void testV2Exception() throws IOException { .accessToken("BAD_TOKEN") .build(); - CustomersApi api = badClient.getCustomersApi(); + PaymentsApi api = badClient.getPaymentsApi(); try { - api.listCustomers(null, null, null); + api.listPayments(null, null, null, null, null, null, null, null, null ); } catch(ApiException e) { assertEquals(e.getResponseCode(), 401);