From e5029980fe31e9d0850ae9cea99dd0d2fa6ce859 Mon Sep 17 00:00:00 2001 From: autobot Date: Tue, 20 Aug 2024 17:00:57 +0000 Subject: [PATCH] Generated PR for Release: 41.0.0.20240821 --- doc/api/catalog.md | 8 +- doc/api/gift-card-activities.md | 3 +- doc/api/gift-cards.md | 8 +- doc/api/o-auth.md | 15 +- doc/api/payments.md | 12 +- doc/client.md | 6 +- doc/models/create-payment-request.md | 1 + doc/models/gift-card-activity-activate.md | 2 +- doc/models/gift-card-activity-load.md | 2 +- doc/models/gift-card-activity-refund.md | 4 +- doc/models/gift-card-activity-type.md | 2 +- doc/models/gift-card-status.md | 2 +- doc/models/list-payments-request.md | 3 + doc/models/offline-payment-details.md | 23 +++ doc/models/payment.md | 1 + pom.xml | 4 +- .../com/squareup/square/SquareClient.java | 6 +- .../api/DefaultGiftCardActivitiesApi.java | 8 +- .../square/api/DefaultGiftCardsApi.java | 18 +- .../squareup/square/api/DefaultOAuthApi.java | 19 +- .../square/api/DefaultPaymentsApi.java | 51 ++++- .../square/api/GiftCardActivitiesApi.java | 8 +- .../com/squareup/square/api/GiftCardsApi.java | 18 +- .../com/squareup/square/api/OAuthApi.java | 8 +- .../com/squareup/square/api/PaymentsApi.java | 34 +++- .../square/models/CreatePaymentRequest.java | 41 +++- .../models/GiftCardActivityActivate.java | 4 +- .../square/models/GiftCardActivityLoad.java | 4 +- .../square/models/GiftCardActivityRefund.java | 22 +-- .../square/models/ListPaymentsRequest.java | 181 +++++++++++++++++- .../square/models/OfflinePaymentDetails.java | 100 ++++++++++ .../com/squareup/square/models/Payment.java | 90 +++++++-- 32 files changed, 573 insertions(+), 135 deletions(-) create mode 100644 doc/models/offline-payment-details.md create mode 100644 src/main/java/com/squareup/square/models/OfflinePaymentDetails.java diff --git a/doc/api/catalog.md b/doc/api/catalog.md index cd5ae678..cc7f7030 100644 --- a/doc/api/catalog.md +++ b/doc/api/catalog.md @@ -39,7 +39,7 @@ children. IDs can be deleted. The response will only include IDs that were actually deleted. -To ensure consistency, only one delete request is processed at a time per seller account. +To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. @@ -138,7 +138,7 @@ batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000. -To ensure consistency, only one update request is processed at a time per seller account. +To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. @@ -468,7 +468,7 @@ catalogApi.listCatalogAsync(null, null, null).thenAccept(result -> { Creates a new or updates the specified [CatalogObject](../../doc/models/catalog-object.md). -To ensure consistency, only one update request is processed at a time per seller account. +To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. @@ -551,7 +551,7 @@ are also deleted. For example, deleting a [CatalogItem](../../doc/models/catalog will also delete all of its [CatalogItemVariation](../../doc/models/catalog-item-variation.md) children. -To ensure consistency, only one delete request is processed at a time per seller account. +To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. diff --git a/doc/api/gift-card-activities.md b/doc/api/gift-card-activities.md index 9d6587ae..e4c900a6 100644 --- a/doc/api/gift-card-activities.md +++ b/doc/api/gift-card-activities.md @@ -67,8 +67,7 @@ giftCardActivitiesApi.listGiftCardActivitiesAsync(null, null, null, null, null, # Create Gift Card Activity Creates a gift card activity to manage the balance or state of a [gift card](../../doc/models/gift-card.md). -For example, you create an `ACTIVATE` activity to activate a gift card with an initial balance -before the gift card can be used. +For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. ```java CompletableFuture createGiftCardActivityAsync( diff --git a/doc/api/gift-cards.md b/doc/api/gift-cards.md index a36ad0f2..76461616 100644 --- a/doc/api/gift-cards.md +++ b/doc/api/gift-cards.md @@ -63,9 +63,11 @@ giftCardsApi.listGiftCardsAsync(null, null, null, null, null).thenAccept(result # Create Gift Card -Creates a digital gift card or registers a physical (plastic) gift card. After the gift card -is created, you must call [CreateGiftCardActivity](../../doc/api/gift-card-activities.md#create-gift-card-activity) -to activate the card with an initial balance before it can be used for payment. +Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift card +has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, call +[CreateGiftCardActivity](../../doc/api/gift-card-activities.md#create-gift-card-activity) and create an `ACTIVATE` +activity with the initial balance. Alternatively, you can use [RefundPayment](../../doc/api/refunds.md#refund-payment) +to refund a payment to the new gift card. ```java CompletableFuture createGiftCardAsync( diff --git a/doc/api/o-auth.md b/doc/api/o-auth.md index d5d714b0..458615b7 100644 --- a/doc/api/o-auth.md +++ b/doc/api/o-auth.md @@ -148,19 +148,10 @@ where `ACCESS_TOKEN` is a If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. -:information_source: **Note** This endpoint does not require authentication. - ```java -CompletableFuture retrieveTokenStatusAsync( - final String authorization) +CompletableFuture retrieveTokenStatusAsync() ``` -## Parameters - -| Parameter | Type | Tags | Description | -| --- | --- | --- | --- | -| `authorization` | `String` | Header, Required | Client APPLICATION_SECRET | - ## Response Type [`RetrieveTokenStatusResponse`](../../doc/models/retrieve-token-status-response.md) @@ -168,9 +159,7 @@ CompletableFuture retrieveTokenStatusAsync( ## Example Usage ```java -String authorization = "Client CLIENT_SECRET"; - -oAuthApi.retrieveTokenStatusAsync(authorization).thenAccept(result -> { +oAuthApi.retrieveTokenStatusAsync().thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { diff --git a/doc/api/payments.md b/doc/api/payments.md index 39bf9f71..d393d796 100644 --- a/doc/api/payments.md +++ b/doc/api/payments.md @@ -38,7 +38,10 @@ CompletableFuture listPaymentsAsync( final Long total, final String last4, final String cardBrand, - final Integer limit) + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime) ``` ## Parameters @@ -54,6 +57,9 @@ CompletableFuture listPaymentsAsync( | `last4` | `String` | Query, Optional | The last four digits of a payment card. | | `cardBrand` | `String` | Query, Optional | The brand of the payment card (for example, VISA). | | `limit` | `Integer` | Query, Optional | The 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.

The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.

Default: `100` | +| `isOfflinePayment` | `Boolean` | Query, Optional | Whether the payment was taken offline or not. | +| `offlineBeginTime` | `String` | Query, Optional | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | +| `offlineEndTime` | `String` | Query, Optional | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | ## Response Type @@ -62,7 +68,9 @@ CompletableFuture listPaymentsAsync( ## Example Usage ```java -paymentsApi.listPaymentsAsync(null, null, null, null, null, null, null, null, null).thenAccept(result -> { +Boolean isOfflinePayment = false; + +paymentsApi.listPaymentsAsync(null, null, null, null, null, null, null, null, null, isOfflinePayment, null, null).thenAccept(result -> { // TODO success callback handler System.out.println(result); }).exceptionally(exception -> { diff --git a/doc/client.md b/doc/client.md index bdebe964..e373d61a 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `squareVersion` | `String` | Square Connect API versions
*Default*: `"2024-07-17"` | +| `squareVersion` | `String` | Square Connect API versions
*Default*: `"2024-08-21"` | | `customUrl` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `"https://connect.squareup.com"` | | `environment` | `string` | The API environment.
**Default: `production`** | | `httpClientConfig` | [`Consumer`](http-client-configuration-builder.md) | Set up Http Client Configuration instance. | @@ -19,7 +19,7 @@ The API client can be initialized as follows: SquareClient client = new SquareClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .squareVersion("2024-07-17") + .squareVersion("2024-08-21") .bearerAuthCredentials(new BearerAuthModel.Builder( "AccessToken" ) @@ -44,7 +44,7 @@ public class Program { SquareClient client = new SquareClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .squareVersion("2024-07-17") + .squareVersion("2024-08-21") .bearerAuthCredentials(new BearerAuthModel.Builder( "AccessToken" ) diff --git a/doc/models/create-payment-request.md b/doc/models/create-payment-request.md index 63e2048e..fedc7f62 100644 --- a/doc/models/create-payment-request.md +++ b/doc/models/create-payment-request.md @@ -35,6 +35,7 @@ Describes a request to create a payment using | `CashDetails` | [`CashPaymentDetails`](../../doc/models/cash-payment-details.md) | Optional | Stores details about a cash payment. Contains only non-confidential information. For more information, see
[Take Cash Payments](https://developer.squareup.com/docs/payments-api/take-payments/cash-payments). | CashPaymentDetails getCashDetails() | | `ExternalDetails` | [`ExternalPaymentDetails`](../../doc/models/external-payment-details.md) | Optional | Stores details about an external payment. Contains only non-confidential information.
For more information, see
[Take External Payments](https://developer.squareup.com/docs/payments-api/take-payments/external-payments). | ExternalPaymentDetails getExternalDetails() | | `CustomerDetails` | [`CustomerDetails`](../../doc/models/customer-details.md) | Optional | Details about the customer making the payment. | CustomerDetails getCustomerDetails() | +| `OfflinePaymentDetails` | [`OfflinePaymentDetails`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | OfflinePaymentDetails getOfflinePaymentDetails() | ## Example (as JSON) diff --git a/doc/models/gift-card-activity-activate.md b/doc/models/gift-card-activity-activate.md index bd28e5ad..84427967 100644 --- a/doc/models/gift-card-activity-activate.md +++ b/doc/models/gift-card-activity-activate.md @@ -15,7 +15,7 @@ Represents details about an `ACTIVATE` [gift card activity type](../../doc/model | `OrderId` | `String` | Optional | The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.

Applications that use the Square Orders API to process orders must specify the order ID
[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | String getOrderId() | | `LineItemUid` | `String` | Optional | The UID of the `GIFT_CARD` line item in the order that represents the gift card purchase.

Applications that use the Square Orders API to process orders must specify the line item UID
in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | String getLineItemUid() | | `ReferenceId` | `String` | Optional | A client-specified ID that associates the gift card activity with an entity in another system.

Applications that use a custom order processing system can use this field to track information
related to an order or payment. | String getReferenceId() | -| `BuyerPaymentInstrumentIds` | `List` | Optional | The payment instrument IDs used to process the gift card purchase, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks. | List getBuyerPaymentInstrumentIds() | +| `BuyerPaymentInstrumentIds` | `List` | Optional | The payment instrument IDs used to process the gift card purchase, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks.

Each buyer payment instrument ID can contain a maximum of 255 characters. | List getBuyerPaymentInstrumentIds() | ## Example (as JSON) diff --git a/doc/models/gift-card-activity-load.md b/doc/models/gift-card-activity-load.md index 455a8454..1926d052 100644 --- a/doc/models/gift-card-activity-load.md +++ b/doc/models/gift-card-activity-load.md @@ -15,7 +15,7 @@ Represents details about a `LOAD` [gift card activity type](../../doc/models/gif | `OrderId` | `String` | Optional | The ID of the [order](entity:Order) that contains the `GIFT_CARD` line item.

Applications that use the Square Orders API to process orders must specify the order ID in the
[CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | String getOrderId() | | `LineItemUid` | `String` | Optional | The UID of the `GIFT_CARD` line item in the order that represents the additional funds for the gift card.

Applications that use the Square Orders API to process orders must specify the line item UID
in the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. | String getLineItemUid() | | `ReferenceId` | `String` | Optional | A client-specified ID that associates the gift card activity with an entity in another system.

Applications that use a custom order processing system can use this field to track information related to
an order or payment. | String getReferenceId() | -| `BuyerPaymentInstrumentIds` | `List` | Optional | The payment instrument IDs used to process the order for the additional funds, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks. | List getBuyerPaymentInstrumentIds() | +| `BuyerPaymentInstrumentIds` | `List` | Optional | The payment instrument IDs used to process the order for the additional funds, such as a credit card ID
or bank account ID.

Applications that use a custom order processing system must specify payment instrument IDs in
the [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request.
Square uses this information to perform compliance checks.

For applications that use the Square Orders API to process payments, Square has the necessary
instrument IDs to perform compliance checks.

Each buyer payment instrument ID can contain a maximum of 255 characters. | List getBuyerPaymentInstrumentIds() | ## Example (as JSON) diff --git a/doc/models/gift-card-activity-refund.md b/doc/models/gift-card-activity-refund.md index 42ac8e50..b0e5b1fa 100644 --- a/doc/models/gift-card-activity-refund.md +++ b/doc/models/gift-card-activity-refund.md @@ -11,10 +11,10 @@ Represents details about a `REFUND` [gift card activity type](../../doc/models/g | Name | Type | Tags | Description | Getter | | --- | --- | --- | --- | --- | -| `RedeemActivityId` | `String` | Optional | The ID of the refunded `REDEEM` gift card activity. Square populates this field if the
`payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request
represents a redemption made by the same gift card. Note that you must use `RefundPayment`
to refund a gift card payment to the same gift card if the payment was processed by Square.

For applications that use a custom payment processing system, this field is required when creating
a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card. | String getRedeemActivityId() | +| `RedeemActivityId` | `String` | Optional | The ID of the refunded `REDEEM` gift card activity. Square populates this field if the
`payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request
represents a gift card redemption.

For applications that use a custom payment processing system, this field is required when creating
a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same gift card. | String getRedeemActivityId() | | `AmountMoney` | [`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 getAmountMoney() | | `ReferenceId` | `String` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | String getReferenceId() | -| `PaymentId` | `String` | Optional | The ID of the refunded payment. Square populates this field if the refund is for a
payment processed by Square and one of the following conditions is true:

- The Refunds API is used to refund a gift card payment to the same gift card.
- A seller initiated the refund from Square Point of Sale or the Seller Dashboard. The payment source can be the
same gift card or a cross-tender payment from a credit card or a different gift card. | String getPaymentId() | +| `PaymentId` | `String` | Optional | The ID of the refunded payment. Square populates this field if the refund is for a
payment processed by Square. This field matches the `payment_id` in the corresponding
[RefundPayment](api-endpoint:Refunds-RefundPayment) request. | String getPaymentId() | ## Example (as JSON) diff --git a/doc/models/gift-card-activity-type.md b/doc/models/gift-card-activity-type.md index 375982ca..04b2854e 100644 --- a/doc/models/gift-card-activity-type.md +++ b/doc/models/gift-card-activity-type.md @@ -18,7 +18,7 @@ Indicates the type of [gift card activity](../../doc/models/gift-card-activity.m | `DEACTIVATE` | Permanently blocked a gift card from balance-changing activities. | | `ADJUST_INCREMENT` | Added money to a gift card outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. | | `ADJUST_DECREMENT` | Deducted money from a gift card outside of a typical `REDEEM` activity flow. | -| `REFUND` | Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to
a Square payment, depending on how the payment and refund are processed. For example:

- A gift card payment processed by Square can be refunded to the same gift card using Square Point of Sale,
the Square Seller Dashboard, or the Refunds API.
- A cross-tender payment processed by Square can be refunded to a gift card using Square Point of Sale or the
Square Seller Dashboard. The payment source might be a credit card or different gift card.
- A payment processed using a custom payment processing system can be refunded to the same gift card. | +| `REFUND` | Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to
a Square payment, depending on how the payment and refund are processed. For example:

- A payment processed by Square can be refunded to a `PENDING` or `ACTIVE` gift card using the Square
Seller Dashboard, Square Point of Sale, or Refunds API.
- A payment processed using a custom processing system can be refunded to the same gift card. | | `UNLINKED_ACTIVITY_REFUND` | Added money to a gift card from a refunded transaction that was processed using a custom payment
processing system and not linked to the gift card. | | `IMPORT` | Imported a third-party gift card with a balance. `IMPORT` activities are managed
by Square and cannot be created using the Gift Card Activities API. | | `BLOCK` | Temporarily blocked a gift card from balance-changing activities. `BLOCK` activities
are managed by Square and cannot be created using the Gift Card Activities API. | diff --git a/doc/models/gift-card-status.md b/doc/models/gift-card-status.md index 717d926f..6b6c3285 100644 --- a/doc/models/gift-card-status.md +++ b/doc/models/gift-card-status.md @@ -14,5 +14,5 @@ Indicates the gift card state. | `ACTIVE` | The gift card is active and can be used as a payment source. | | `DEACTIVATED` | Any activity that changes the gift card balance is permanently forbidden. | | `BLOCKED` | Any activity that changes the gift card balance is temporarily forbidden. | -| `PENDING` | The gift card is pending activation.
This is the initial state when a gift card is created. You must activate the gift card
before it can be used. | +| `PENDING` | The gift card is pending activation.
This is the initial state when a gift card is created. Typically, you'll call
[CreateGiftCardActivity](../../doc/api/gift-card-activities.md#create-gift-card-activity) to create an
`ACTIVATE` activity that activates the gift card with an initial balance before first use. | diff --git a/doc/models/list-payments-request.md b/doc/models/list-payments-request.md index 666c00da..a2c90ed4 100644 --- a/doc/models/list-payments-request.md +++ b/doc/models/list-payments-request.md @@ -23,6 +23,9 @@ The maximum results per page is 100. | `Last4` | `String` | Optional | The last four digits of a payment card. | String getLast4() | | `CardBrand` | `String` | Optional | The brand of the payment card (for example, VISA). | String getCardBrand() | | `Limit` | `Integer` | Optional | The 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.

The default value of 100 is also the maximum allowed value. If the provided value is
greater than 100, it is ignored and the default value is used instead.

Default: `100` | Integer getLimit() | +| `IsOfflinePayment` | `Boolean` | Optional | Whether the payment was taken offline or not. | Boolean getIsOfflinePayment() | +| `OfflineBeginTime` | `String` | Optional | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | String getOfflineBeginTime() | +| `OfflineEndTime` | `String` | Optional | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339
format for timestamps. The range is determined using the
`offline_payment_details.client_created_at` field for each Payment. If set, payments without a
value set in `offline_payment_details.client_created_at` will not be returned.

Default: The current time. | String getOfflineEndTime() | ## Example (as JSON) diff --git a/doc/models/offline-payment-details.md b/doc/models/offline-payment-details.md new file mode 100644 index 00000000..b3939d24 --- /dev/null +++ b/doc/models/offline-payment-details.md @@ -0,0 +1,23 @@ + +# Offline Payment Details + +Details specific to offline payments. + +## Structure + +`OfflinePaymentDetails` + +## Fields + +| Name | Type | Tags | Description | Getter | +| --- | --- | --- | --- | --- | +| `ClientCreatedAt` | `String` | Optional | The client-side timestamp of when the offline payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | String getClientCreatedAt() | + +## Example (as JSON) + +```json +{ + "client_created_at": "client_created_at6" +} +``` + diff --git a/doc/models/payment.md b/doc/models/payment.md index be0429e9..66ff7204 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -52,6 +52,7 @@ Represents a payment processed by the Square API. | `DeviceDetails` | [`DeviceDetails`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | DeviceDetails getDeviceDetails() | | `ApplicationDetails` | [`ApplicationDetails`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | ApplicationDetails getApplicationDetails() | | `IsOfflinePayment` | `Boolean` | Optional | Whether or not this payment was taken offline. | Boolean getIsOfflinePayment() | +| `OfflinePaymentDetails` | [`OfflinePaymentDetails`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | OfflinePaymentDetails getOfflinePaymentDetails() | | `VersionToken` | `String` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | String getVersionToken() | ## Example (as JSON) diff --git a/pom.xml b/pom.xml index 579b8a36..0d609b02 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.squareup square - 40.1.1.20240717 + 41.0.0.20240821 jar Square Java client library for the Square API @@ -45,7 +45,7 @@ io.apimatic core - [0.6.3, 0.7) + [0.6.4, 0.7) io.apimatic diff --git a/src/main/java/com/squareup/square/SquareClient.java b/src/main/java/com/squareup/square/SquareClient.java index b8e4c624..d8dfca26 100644 --- a/src/main/java/com/squareup/square/SquareClient.java +++ b/src/main/java/com/squareup/square/SquareClient.java @@ -157,7 +157,7 @@ public final class SquareClient implements SquareClientInterface { private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl(); - private static String userAgent = "Square-Java-SDK/40.1.1.20240717 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; + private static String userAgent = "Square-Java-SDK/41.0.0.20240821 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; /** * Current API environment. @@ -719,7 +719,7 @@ public String getAccessToken() { * @return sdkVersion */ public String getSdkVersion() { - return "40.1.1.20240717"; + return "41.0.0.20240821"; } /** @@ -832,7 +832,7 @@ public static class Builder { private Environment environment = Environment.PRODUCTION; private String customUrl = "https://connect.squareup.com"; - private String squareVersion = "2024-07-17"; + private String squareVersion = "2024-08-21"; private HttpClient httpClient; private Headers additionalHeaders = new Headers(); private String userAgentDetail = null; diff --git a/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java b/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java index 768abad7..2300a3fc 100644 --- a/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java +++ b/src/main/java/com/squareup/square/api/DefaultGiftCardActivitiesApi.java @@ -176,8 +176,8 @@ private ApiCall prepareListGiftCar /** * Creates a gift card activity to manage the balance or state of a [gift card]($m/GiftCard). - * For example, you create an `ACTIVATE` activity to activate a gift card with an initial - * balance before the gift card can be used. + * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance + * before first use. * @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 CreateGiftCardActivityResponse response from the API call @@ -191,8 +191,8 @@ public CreateGiftCardActivityResponse createGiftCardActivity( /** * Creates a gift card activity to manage the balance or state of a [gift card]($m/GiftCard). - * For example, you create an `ACTIVATE` activity to activate a gift card with an initial - * balance before the gift card can be used. + * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance + * before first use. * @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 CreateGiftCardActivityResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java b/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java index 0a4d2c07..b7735c9a 100644 --- a/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultGiftCardsApi.java @@ -145,10 +145,11 @@ private ApiCall prepareListGiftCardsRequest } /** - * Creates a digital gift card or registers a physical (plastic) gift card. After the gift card - * is created, you must call - * [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) to activate the card - * with an initial balance before it can be used for payment. + * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift + * card has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, + * call [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and create an + * `ACTIVATE` activity with the initial balance. Alternatively, you can use + * [RefundPayment]($e/Refunds/RefundPayment) to refund a payment to the new gift card. * @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 CreateGiftCardResponse response from the API call @@ -161,10 +162,11 @@ public CreateGiftCardResponse createGiftCard( } /** - * Creates a digital gift card or registers a physical (plastic) gift card. After the gift card - * is created, you must call - * [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) to activate the card - * with an initial balance before it can be used for payment. + * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift + * card has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, + * call [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and create an + * `ACTIVATE` activity with the initial balance. Alternatively, you can use + * [RefundPayment]($e/Refunds/RefundPayment) to refund a payment to the new gift card. * @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 CreateGiftCardResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/DefaultOAuthApi.java b/src/main/java/com/squareup/square/api/DefaultOAuthApi.java index 42120be3..5b259ce1 100644 --- a/src/main/java/com/squareup/square/api/DefaultOAuthApi.java +++ b/src/main/java/com/squareup/square/api/DefaultOAuthApi.java @@ -187,14 +187,12 @@ private ApiCall prepareObtainTokenRequest( * authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If * the access token is expired or not a valid access token, the endpoint returns an * `UNAUTHORIZED` error. - * @param authorization Required parameter: Client APPLICATION_SECRET * @return Returns the RetrieveTokenStatusResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public RetrieveTokenStatusResponse retrieveTokenStatus( - final String authorization) throws ApiException, IOException { - return prepareRetrieveTokenStatusRequest(authorization).execute(); + public RetrieveTokenStatusResponse retrieveTokenStatus() throws ApiException, IOException { + return prepareRetrieveTokenStatusRequest().execute(); } /** @@ -208,13 +206,11 @@ public RetrieveTokenStatusResponse retrieveTokenStatus( * authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If * the access token is expired or not a valid access token, the endpoint returns an * `UNAUTHORIZED` error. - * @param authorization Required parameter: Client APPLICATION_SECRET * @return Returns the RetrieveTokenStatusResponse response from the API call */ - public CompletableFuture retrieveTokenStatusAsync( - final String authorization) { + public CompletableFuture retrieveTokenStatusAsync() { try { - return prepareRetrieveTokenStatusRequest(authorization).executeAsync(); + return prepareRetrieveTokenStatusRequest().executeAsync(); } catch (Exception e) { throw new CompletionException(e); } @@ -223,16 +219,15 @@ public CompletableFuture retrieveTokenStatusAsync( /** * Builds the ApiCall object for retrieveTokenStatus. */ - private ApiCall prepareRetrieveTokenStatusRequest( - final String authorization) throws IOException { + private ApiCall prepareRetrieveTokenStatusRequest() throws IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) .path("/oauth2/token/status") - .headerParam(param -> param.key("Authorization") - .value(authorization).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("global")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java b/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java index cef0bd71..42e7fdb3 100644 --- a/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java +++ b/src/main/java/com/squareup/square/api/DefaultPaymentsApi.java @@ -64,6 +64,18 @@ public DefaultPaymentsApi(GlobalConfiguration globalConfig) { * page. The default value of 100 is also the maximum allowed value. If the provided * value is greater than 100, it is ignored and the default value is used instead. * Default: `100` + * @param isOfflinePayment Optional parameter: Whether the payment was taken offline or not. + * @param offlineBeginTime Optional parameter: Indicates the start of the time range for which + * to retrieve offline payments, in RFC 3339 format for timestamps. The range is + * determined using the `offline_payment_details.client_created_at` field for each + * Payment. If set, payments without a value set in + * `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @param offlineEndTime Optional parameter: Indicates the end of the time range for which to + * retrieve offline payments, in RFC 3339 format for timestamps. The range is determined + * using the `offline_payment_details.client_created_at` field for each Payment. If set, + * payments without a value set in `offline_payment_details.client_created_at` will not + * be returned. Default: The current time. * @return Returns the ListPaymentsResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -77,9 +89,13 @@ public ListPaymentsResponse listPayments( final Long total, final String last4, final String cardBrand, - final Integer limit) throws ApiException, IOException { + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime) throws ApiException, IOException { return prepareListPaymentsRequest(beginTime, endTime, sortOrder, cursor, locationId, total, - last4, cardBrand, limit).execute(); + last4, cardBrand, limit, isOfflinePayment, offlineBeginTime, + offlineEndTime).execute(); } /** @@ -109,6 +125,18 @@ public ListPaymentsResponse listPayments( * page. The default value of 100 is also the maximum allowed value. If the provided * value is greater than 100, it is ignored and the default value is used instead. * Default: `100` + * @param isOfflinePayment Optional parameter: Whether the payment was taken offline or not. + * @param offlineBeginTime Optional parameter: Indicates the start of the time range for which + * to retrieve offline payments, in RFC 3339 format for timestamps. The range is + * determined using the `offline_payment_details.client_created_at` field for each + * Payment. If set, payments without a value set in + * `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @param offlineEndTime Optional parameter: Indicates the end of the time range for which to + * retrieve offline payments, in RFC 3339 format for timestamps. The range is determined + * using the `offline_payment_details.client_created_at` field for each Payment. If set, + * payments without a value set in `offline_payment_details.client_created_at` will not + * be returned. Default: The current time. * @return Returns the ListPaymentsResponse response from the API call */ public CompletableFuture listPaymentsAsync( @@ -120,10 +148,14 @@ public CompletableFuture listPaymentsAsync( final Long total, final String last4, final String cardBrand, - final Integer limit) { + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime) { try { return prepareListPaymentsRequest(beginTime, endTime, sortOrder, cursor, locationId, total, - last4, cardBrand, limit).executeAsync(); + last4, cardBrand, limit, isOfflinePayment, offlineBeginTime, + offlineEndTime).executeAsync(); } catch (Exception e) { throw new CompletionException(e); } @@ -141,7 +173,10 @@ private ApiCall prepareListPaymentsRequest( final Long total, final String last4, final String cardBrand, - final Integer limit) throws IOException { + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime) throws IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder @@ -165,6 +200,12 @@ private ApiCall prepareListPaymentsRequest( .value(cardBrand).isRequired(false)) .queryParam(param -> param.key("limit") .value(limit).isRequired(false)) + .queryParam(param -> param.key("is_offline_payment") + .value((isOfflinePayment != null) ? isOfflinePayment : false).isRequired(false)) + .queryParam(param -> param.key("offline_begin_time") + .value(offlineBeginTime).isRequired(false)) + .queryParam(param -> param.key("offline_end_time") + .value(offlineEndTime).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) .withAuth(auth -> auth .add("global")) diff --git a/src/main/java/com/squareup/square/api/GiftCardActivitiesApi.java b/src/main/java/com/squareup/square/api/GiftCardActivitiesApi.java index 3adefd3c..444b1ab4 100644 --- a/src/main/java/com/squareup/square/api/GiftCardActivitiesApi.java +++ b/src/main/java/com/squareup/square/api/GiftCardActivitiesApi.java @@ -103,8 +103,8 @@ CompletableFuture listGiftCardActivitiesAsync( /** * Creates a gift card activity to manage the balance or state of a [gift card]($m/GiftCard). - * For example, you create an `ACTIVATE` activity to activate a gift card with an initial - * balance before the gift card can be used. + * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance + * before first use. * @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 CreateGiftCardActivityResponse response from the API call @@ -116,8 +116,8 @@ CreateGiftCardActivityResponse createGiftCardActivity( /** * Creates a gift card activity to manage the balance or state of a [gift card]($m/GiftCard). - * For example, you create an `ACTIVATE` activity to activate a gift card with an initial - * balance before the gift card can be used. + * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance + * before first use. * @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 CreateGiftCardActivityResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/GiftCardsApi.java b/src/main/java/com/squareup/square/api/GiftCardsApi.java index 7cfacd8b..060c7773 100644 --- a/src/main/java/com/squareup/square/api/GiftCardsApi.java +++ b/src/main/java/com/squareup/square/api/GiftCardsApi.java @@ -83,10 +83,11 @@ CompletableFuture listGiftCardsAsync( final String customerId); /** - * Creates a digital gift card or registers a physical (plastic) gift card. After the gift card - * is created, you must call - * [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) to activate the card - * with an initial balance before it can be used for payment. + * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift + * card has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, + * call [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and create an + * `ACTIVATE` activity with the initial balance. Alternatively, you can use + * [RefundPayment]($e/Refunds/RefundPayment) to refund a payment to the new gift card. * @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 CreateGiftCardResponse response from the API call @@ -97,10 +98,11 @@ CreateGiftCardResponse createGiftCard( final CreateGiftCardRequest body) throws ApiException, IOException; /** - * Creates a digital gift card or registers a physical (plastic) gift card. After the gift card - * is created, you must call - * [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) to activate the card - * with an initial balance before it can be used for payment. + * Creates a digital gift card or registers a physical (plastic) gift card. The resulting gift + * card has a `PENDING` state. To activate a gift card so that it can be redeemed for purchases, + * call [CreateGiftCardActivity]($e/GiftCardActivities/CreateGiftCardActivity) and create an + * `ACTIVATE` activity with the initial balance. Alternatively, you can use + * [RefundPayment]($e/Refunds/RefundPayment) to refund a payment to the new gift card. * @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 CreateGiftCardResponse response from the API call diff --git a/src/main/java/com/squareup/square/api/OAuthApi.java b/src/main/java/com/squareup/square/api/OAuthApi.java index 293c2311..d48f5adc 100644 --- a/src/main/java/com/squareup/square/api/OAuthApi.java +++ b/src/main/java/com/squareup/square/api/OAuthApi.java @@ -100,13 +100,11 @@ CompletableFuture obtainTokenAsync( * authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If * the access token is expired or not a valid access token, the endpoint returns an * `UNAUTHORIZED` error. - * @param authorization Required parameter: Client APPLICATION_SECRET * @return Returns the RetrieveTokenStatusResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - RetrieveTokenStatusResponse retrieveTokenStatus( - final String authorization) throws ApiException, IOException; + RetrieveTokenStatusResponse retrieveTokenStatus() throws ApiException, IOException; /** * Returns information about an [OAuth access @@ -119,10 +117,8 @@ RetrieveTokenStatusResponse retrieveTokenStatus( * authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If * the access token is expired or not a valid access token, the endpoint returns an * `UNAUTHORIZED` error. - * @param authorization Required parameter: Client APPLICATION_SECRET * @return Returns the RetrieveTokenStatusResponse response from the API call */ - CompletableFuture retrieveTokenStatusAsync( - final String authorization); + CompletableFuture retrieveTokenStatusAsync(); } \ No newline at end of file diff --git a/src/main/java/com/squareup/square/api/PaymentsApi.java b/src/main/java/com/squareup/square/api/PaymentsApi.java index 86b49134..b0ee8940 100644 --- a/src/main/java/com/squareup/square/api/PaymentsApi.java +++ b/src/main/java/com/squareup/square/api/PaymentsApi.java @@ -48,6 +48,18 @@ public interface PaymentsApi { * page. The default value of 100 is also the maximum allowed value. If the provided * value is greater than 100, it is ignored and the default value is used instead. * Default: `100` + * @param isOfflinePayment Optional parameter: Whether the payment was taken offline or not. + * @param offlineBeginTime Optional parameter: Indicates the start of the time range for which + * to retrieve offline payments, in RFC 3339 format for timestamps. The range is + * determined using the `offline_payment_details.client_created_at` field for each + * Payment. If set, payments without a value set in + * `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @param offlineEndTime Optional parameter: Indicates the end of the time range for which to + * retrieve offline payments, in RFC 3339 format for timestamps. The range is determined + * using the `offline_payment_details.client_created_at` field for each Payment. If set, + * payments without a value set in `offline_payment_details.client_created_at` will not + * be returned. Default: The current time. * @return Returns the ListPaymentsResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -61,7 +73,10 @@ ListPaymentsResponse listPayments( final Long total, final String last4, final String cardBrand, - final Integer limit) throws ApiException, IOException; + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime) throws ApiException, IOException; /** * Retrieves a list of payments taken by the account making the request. Results are eventually @@ -90,6 +105,18 @@ ListPaymentsResponse listPayments( * page. The default value of 100 is also the maximum allowed value. If the provided * value is greater than 100, it is ignored and the default value is used instead. * Default: `100` + * @param isOfflinePayment Optional parameter: Whether the payment was taken offline or not. + * @param offlineBeginTime Optional parameter: Indicates the start of the time range for which + * to retrieve offline payments, in RFC 3339 format for timestamps. The range is + * determined using the `offline_payment_details.client_created_at` field for each + * Payment. If set, payments without a value set in + * `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @param offlineEndTime Optional parameter: Indicates the end of the time range for which to + * retrieve offline payments, in RFC 3339 format for timestamps. The range is determined + * using the `offline_payment_details.client_created_at` field for each Payment. If set, + * payments without a value set in `offline_payment_details.client_created_at` will not + * be returned. Default: The current time. * @return Returns the ListPaymentsResponse response from the API call */ CompletableFuture listPaymentsAsync( @@ -101,7 +128,10 @@ CompletableFuture listPaymentsAsync( final Long total, final String last4, final String cardBrand, - final Integer limit); + final Integer limit, + final Boolean isOfflinePayment, + final String offlineBeginTime, + final String offlineEndTime); /** * Creates a payment using the provided source. You can use this endpoint to charge a card diff --git a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java index 24ce1913..191673e4 100644 --- a/src/main/java/com/squareup/square/models/CreatePaymentRequest.java +++ b/src/main/java/com/squareup/square/models/CreatePaymentRequest.java @@ -34,6 +34,7 @@ public class CreatePaymentRequest { private final CashPaymentDetails cashDetails; private final ExternalPaymentDetails externalDetails; private final CustomerDetails customerDetails; + private final OfflinePaymentDetails offlinePaymentDetails; /** * Initialization constructor. @@ -60,6 +61,7 @@ public class CreatePaymentRequest { * @param cashDetails CashPaymentDetails value for cashDetails. * @param externalDetails ExternalPaymentDetails value for externalDetails. * @param customerDetails CustomerDetails value for customerDetails. + * @param offlinePaymentDetails OfflinePaymentDetails value for offlinePaymentDetails. */ @JsonCreator public CreatePaymentRequest( @@ -85,7 +87,8 @@ public CreatePaymentRequest( @JsonProperty("statement_description_identifier") String statementDescriptionIdentifier, @JsonProperty("cash_details") CashPaymentDetails cashDetails, @JsonProperty("external_details") ExternalPaymentDetails externalDetails, - @JsonProperty("customer_details") CustomerDetails customerDetails) { + @JsonProperty("customer_details") CustomerDetails customerDetails, + @JsonProperty("offline_payment_details") OfflinePaymentDetails offlinePaymentDetails) { this.sourceId = sourceId; this.idempotencyKey = idempotencyKey; this.amountMoney = amountMoney; @@ -109,6 +112,7 @@ public CreatePaymentRequest( this.cashDetails = cashDetails; this.externalDetails = externalDetails; this.customerDetails = customerDetails; + this.offlinePaymentDetails = offlinePaymentDetails; } /** @@ -426,13 +430,25 @@ public CustomerDetails getCustomerDetails() { return customerDetails; } + /** + * Getter for OfflinePaymentDetails. + * Details specific to offline payments. + * @return Returns the OfflinePaymentDetails + */ + @JsonGetter("offline_payment_details") + @JsonInclude(JsonInclude.Include.NON_NULL) + public OfflinePaymentDetails getOfflinePaymentDetails() { + return offlinePaymentDetails; + } + @Override public int hashCode() { return Objects.hash(sourceId, idempotencyKey, amountMoney, tipMoney, appFeeMoney, delayDuration, delayAction, autocomplete, orderId, customerId, locationId, teamMemberId, referenceId, verificationToken, acceptPartialAuthorization, buyerEmailAddress, billingAddress, shippingAddress, note, - statementDescriptionIdentifier, cashDetails, externalDetails, customerDetails); + statementDescriptionIdentifier, cashDetails, externalDetails, customerDetails, + offlinePaymentDetails); } @Override @@ -467,7 +483,8 @@ public boolean equals(Object obj) { other.statementDescriptionIdentifier) && Objects.equals(cashDetails, other.cashDetails) && Objects.equals(externalDetails, other.externalDetails) - && Objects.equals(customerDetails, other.customerDetails); + && Objects.equals(customerDetails, other.customerDetails) + && Objects.equals(offlinePaymentDetails, other.offlinePaymentDetails); } /** @@ -488,7 +505,7 @@ public String toString() { + ", note=" + note + ", statementDescriptionIdentifier=" + statementDescriptionIdentifier + ", cashDetails=" + cashDetails + ", externalDetails=" + externalDetails + ", customerDetails=" + customerDetails - + "]"; + + ", offlinePaymentDetails=" + offlinePaymentDetails + "]"; } /** @@ -518,7 +535,8 @@ public Builder toBuilder() { .statementDescriptionIdentifier(getStatementDescriptionIdentifier()) .cashDetails(getCashDetails()) .externalDetails(getExternalDetails()) - .customerDetails(getCustomerDetails()); + .customerDetails(getCustomerDetails()) + .offlinePaymentDetails(getOfflinePaymentDetails()); return builder; } @@ -549,6 +567,7 @@ public static class Builder { private CashPaymentDetails cashDetails; private ExternalPaymentDetails externalDetails; private CustomerDetails customerDetails; + private OfflinePaymentDetails offlinePaymentDetails; /** * Initialization constructor. @@ -790,6 +809,16 @@ public Builder customerDetails(CustomerDetails customerDetails) { return this; } + /** + * Setter for offlinePaymentDetails. + * @param offlinePaymentDetails OfflinePaymentDetails value for offlinePaymentDetails. + * @return Builder + */ + public Builder offlinePaymentDetails(OfflinePaymentDetails offlinePaymentDetails) { + this.offlinePaymentDetails = offlinePaymentDetails; + return this; + } + /** * Builds a new {@link CreatePaymentRequest} object using the set fields. * @return {@link CreatePaymentRequest} @@ -800,7 +829,7 @@ public CreatePaymentRequest build() { locationId, teamMemberId, referenceId, verificationToken, acceptPartialAuthorization, buyerEmailAddress, billingAddress, shippingAddress, note, statementDescriptionIdentifier, cashDetails, externalDetails, - customerDetails); + customerDetails, offlinePaymentDetails); } } } diff --git a/src/main/java/com/squareup/square/models/GiftCardActivityActivate.java b/src/main/java/com/squareup/square/models/GiftCardActivityActivate.java index 717f759a..d5fe3a12 100644 --- a/src/main/java/com/squareup/square/models/GiftCardActivityActivate.java +++ b/src/main/java/com/squareup/square/models/GiftCardActivityActivate.java @@ -166,7 +166,7 @@ public String getReferenceId() { * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. * Square uses this information to perform compliance checks. For applications that use the * Square Orders API to process payments, Square has the necessary instrument IDs to perform - * compliance checks. + * compliance checks. Each buyer payment instrument ID can contain a maximum of 255 characters. * @return Returns the Internal List of String */ @JsonGetter("buyer_payment_instrument_ids") @@ -184,7 +184,7 @@ protected OptionalNullable> internalGetBuyerPaymentInstrumentIds() * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. * Square uses this information to perform compliance checks. For applications that use the * Square Orders API to process payments, Square has the necessary instrument IDs to perform - * compliance checks. + * compliance checks. Each buyer payment instrument ID can contain a maximum of 255 characters. * @return Returns the List of String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/GiftCardActivityLoad.java b/src/main/java/com/squareup/square/models/GiftCardActivityLoad.java index 45dbf184..a7e7f12f 100644 --- a/src/main/java/com/squareup/square/models/GiftCardActivityLoad.java +++ b/src/main/java/com/squareup/square/models/GiftCardActivityLoad.java @@ -166,7 +166,7 @@ public String getReferenceId() { * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. * Square uses this information to perform compliance checks. For applications that use the * Square Orders API to process payments, Square has the necessary instrument IDs to perform - * compliance checks. + * compliance checks. Each buyer payment instrument ID can contain a maximum of 255 characters. * @return Returns the Internal List of String */ @JsonGetter("buyer_payment_instrument_ids") @@ -184,7 +184,7 @@ protected OptionalNullable> internalGetBuyerPaymentInstrumentIds() * [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) request. * Square uses this information to perform compliance checks. For applications that use the * Square Orders API to process payments, Square has the necessary instrument IDs to perform - * compliance checks. + * compliance checks. Each buyer payment instrument ID can contain a maximum of 255 characters. * @return Returns the List of String */ @JsonIgnore diff --git a/src/main/java/com/squareup/square/models/GiftCardActivityRefund.java b/src/main/java/com/squareup/square/models/GiftCardActivityRefund.java index 5a1db797..a6e77a57 100644 --- a/src/main/java/com/squareup/square/models/GiftCardActivityRefund.java +++ b/src/main/java/com/squareup/square/models/GiftCardActivityRefund.java @@ -58,11 +58,9 @@ protected GiftCardActivityRefund(OptionalNullable redeemActivityId, Mone * Internal Getter for RedeemActivityId. * The ID of the refunded `REDEEM` gift card activity. Square populates this field if the * `payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request - * represents a redemption made by the same gift card. Note that you must use `RefundPayment` to - * refund a gift card payment to the same gift card if the payment was processed by Square. For - * applications that use a custom payment processing system, this field is required when - * creating a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same - * gift card. + * represents a gift card redemption. For applications that use a custom payment processing + * system, this field is required when creating a `REFUND` activity. The provided `REDEEM` + * activity ID must be linked to the same gift card. * @return Returns the Internal String */ @JsonGetter("redeem_activity_id") @@ -76,11 +74,9 @@ protected OptionalNullable internalGetRedeemActivityId() { * Getter for RedeemActivityId. * The ID of the refunded `REDEEM` gift card activity. Square populates this field if the * `payment_id` in the corresponding [RefundPayment](api-endpoint:Refunds-RefundPayment) request - * represents a redemption made by the same gift card. Note that you must use `RefundPayment` to - * refund a gift card payment to the same gift card if the payment was processed by Square. For - * applications that use a custom payment processing system, this field is required when - * creating a `REFUND` activity. The provided `REDEEM` activity ID must be linked to the same - * gift card. + * represents a gift card redemption. For applications that use a custom payment processing + * system, this field is required when creating a `REFUND` activity. The provided `REDEEM` + * activity ID must be linked to the same gift card. * @return Returns the String */ @JsonIgnore @@ -131,10 +127,8 @@ public String getReferenceId() { /** * Getter for PaymentId. * The ID of the refunded payment. Square populates this field if the refund is for a payment - * processed by Square and one of the following conditions is true: - The Refunds API is used to - * refund a gift card payment to the same gift card. - A seller initiated the refund from Square - * Point of Sale or the Seller Dashboard. The payment source can be the same gift card or a - * cross-tender payment from a credit card or a different gift card. + * processed by Square. This field matches the `payment_id` in the corresponding + * [RefundPayment](api-endpoint:Refunds-RefundPayment) request. * @return Returns the String */ @JsonGetter("payment_id") diff --git a/src/main/java/com/squareup/square/models/ListPaymentsRequest.java b/src/main/java/com/squareup/square/models/ListPaymentsRequest.java index 148c6055..a8ad2ebe 100644 --- a/src/main/java/com/squareup/square/models/ListPaymentsRequest.java +++ b/src/main/java/com/squareup/square/models/ListPaymentsRequest.java @@ -23,6 +23,9 @@ public class ListPaymentsRequest { private final OptionalNullable last4; private final OptionalNullable cardBrand; private final OptionalNullable limit; + private final OptionalNullable isOfflinePayment; + private final OptionalNullable offlineBeginTime; + private final OptionalNullable offlineEndTime; /** * Initialization constructor. @@ -35,6 +38,9 @@ public class ListPaymentsRequest { * @param last4 String value for last4. * @param cardBrand String value for cardBrand. * @param limit Integer value for limit. + * @param isOfflinePayment Boolean value for isOfflinePayment. + * @param offlineBeginTime String value for offlineBeginTime. + * @param offlineEndTime String value for offlineEndTime. */ @JsonCreator public ListPaymentsRequest( @@ -46,7 +52,10 @@ public ListPaymentsRequest( @JsonProperty("total") Long total, @JsonProperty("last_4") String last4, @JsonProperty("card_brand") String cardBrand, - @JsonProperty("limit") Integer limit) { + @JsonProperty("limit") Integer limit, + @JsonProperty("is_offline_payment") Boolean isOfflinePayment, + @JsonProperty("offline_begin_time") String offlineBeginTime, + @JsonProperty("offline_end_time") String offlineEndTime) { this.beginTime = OptionalNullable.of(beginTime); this.endTime = OptionalNullable.of(endTime); this.sortOrder = OptionalNullable.of(sortOrder); @@ -56,6 +65,9 @@ public ListPaymentsRequest( this.last4 = OptionalNullable.of(last4); this.cardBrand = OptionalNullable.of(cardBrand); this.limit = OptionalNullable.of(limit); + this.isOfflinePayment = OptionalNullable.of(isOfflinePayment); + this.offlineBeginTime = OptionalNullable.of(offlineBeginTime); + this.offlineEndTime = OptionalNullable.of(offlineEndTime); } /** @@ -69,13 +81,18 @@ public ListPaymentsRequest( * @param last4 String value for last4. * @param cardBrand String value for cardBrand. * @param limit Integer value for limit. + * @param isOfflinePayment Boolean value for isOfflinePayment. + * @param offlineBeginTime String value for offlineBeginTime. + * @param offlineEndTime String value for offlineEndTime. */ protected ListPaymentsRequest(OptionalNullable beginTime, OptionalNullable endTime, OptionalNullable sortOrder, OptionalNullable cursor, OptionalNullable locationId, OptionalNullable total, OptionalNullable last4, - OptionalNullable cardBrand, OptionalNullable limit) { + OptionalNullable cardBrand, OptionalNullable limit, + OptionalNullable isOfflinePayment, OptionalNullable offlineBeginTime, + OptionalNullable offlineEndTime) { this.beginTime = beginTime; this.endTime = endTime; this.sortOrder = sortOrder; @@ -85,6 +102,9 @@ protected ListPaymentsRequest(OptionalNullable beginTime, this.last4 = last4; this.cardBrand = cardBrand; this.limit = limit; + this.isOfflinePayment = isOfflinePayment; + this.offlineBeginTime = offlineBeginTime; + this.offlineEndTime = offlineEndTime; } /** @@ -305,10 +325,92 @@ public Integer getLimit() { return OptionalNullable.getFrom(limit); } + /** + * Internal Getter for IsOfflinePayment. + * Whether the payment was taken offline or not. + * @return Returns the Internal Boolean + */ + @JsonGetter("is_offline_payment") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetIsOfflinePayment() { + return this.isOfflinePayment; + } + + /** + * Getter for IsOfflinePayment. + * Whether the payment was taken offline or not. + * @return Returns the Boolean + */ + @JsonIgnore + public Boolean getIsOfflinePayment() { + return OptionalNullable.getFrom(isOfflinePayment); + } + + /** + * Internal Getter for OfflineBeginTime. + * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 + * format for timestamps. The range is determined using the + * `offline_payment_details.client_created_at` field for each Payment. If set, payments without + * a value set in `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @return Returns the Internal String + */ + @JsonGetter("offline_begin_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetOfflineBeginTime() { + return this.offlineBeginTime; + } + + /** + * Getter for OfflineBeginTime. + * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 + * format for timestamps. The range is determined using the + * `offline_payment_details.client_created_at` field for each Payment. If set, payments without + * a value set in `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @return Returns the String + */ + @JsonIgnore + public String getOfflineBeginTime() { + return OptionalNullable.getFrom(offlineBeginTime); + } + + /** + * Internal Getter for OfflineEndTime. + * Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 + * format for timestamps. The range is determined using the + * `offline_payment_details.client_created_at` field for each Payment. If set, payments without + * a value set in `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @return Returns the Internal String + */ + @JsonGetter("offline_end_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetOfflineEndTime() { + return this.offlineEndTime; + } + + /** + * Getter for OfflineEndTime. + * Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 + * format for timestamps. The range is determined using the + * `offline_payment_details.client_created_at` field for each Payment. If set, payments without + * a value set in `offline_payment_details.client_created_at` will not be returned. Default: The + * current time. + * @return Returns the String + */ + @JsonIgnore + public String getOfflineEndTime() { + return OptionalNullable.getFrom(offlineEndTime); + } + @Override public int hashCode() { return Objects.hash(beginTime, endTime, sortOrder, cursor, locationId, total, last4, - cardBrand, limit); + cardBrand, limit, isOfflinePayment, offlineBeginTime, offlineEndTime); } @Override @@ -328,7 +430,10 @@ public boolean equals(Object obj) { && Objects.equals(total, other.total) && Objects.equals(last4, other.last4) && Objects.equals(cardBrand, other.cardBrand) - && Objects.equals(limit, other.limit); + && Objects.equals(limit, other.limit) + && Objects.equals(isOfflinePayment, other.isOfflinePayment) + && Objects.equals(offlineBeginTime, other.offlineBeginTime) + && Objects.equals(offlineEndTime, other.offlineEndTime); } /** @@ -340,7 +445,8 @@ public String toString() { return "ListPaymentsRequest [" + "beginTime=" + beginTime + ", endTime=" + endTime + ", sortOrder=" + sortOrder + ", cursor=" + cursor + ", locationId=" + locationId + ", total=" + total + ", last4=" + last4 + ", cardBrand=" + cardBrand + ", limit=" - + limit + "]"; + + limit + ", isOfflinePayment=" + isOfflinePayment + ", offlineBeginTime=" + + offlineBeginTime + ", offlineEndTime=" + offlineEndTime + "]"; } /** @@ -359,6 +465,9 @@ public Builder toBuilder() { builder.last4 = internalGetLast4(); builder.cardBrand = internalGetCardBrand(); builder.limit = internalGetLimit(); + builder.isOfflinePayment = internalGetIsOfflinePayment(); + builder.offlineBeginTime = internalGetOfflineBeginTime(); + builder.offlineEndTime = internalGetOfflineEndTime(); return builder; } @@ -375,6 +484,9 @@ public static class Builder { private OptionalNullable last4; private OptionalNullable cardBrand; private OptionalNullable limit; + private OptionalNullable isOfflinePayment; + private OptionalNullable offlineBeginTime; + private OptionalNullable offlineEndTime; @@ -549,13 +661,70 @@ public Builder unsetLimit() { return this; } + /** + * Setter for isOfflinePayment. + * @param isOfflinePayment Boolean value for isOfflinePayment. + * @return Builder + */ + public Builder isOfflinePayment(Boolean isOfflinePayment) { + this.isOfflinePayment = OptionalNullable.of(isOfflinePayment); + return this; + } + + /** + * UnSetter for isOfflinePayment. + * @return Builder + */ + public Builder unsetIsOfflinePayment() { + isOfflinePayment = null; + return this; + } + + /** + * Setter for offlineBeginTime. + * @param offlineBeginTime String value for offlineBeginTime. + * @return Builder + */ + public Builder offlineBeginTime(String offlineBeginTime) { + this.offlineBeginTime = OptionalNullable.of(offlineBeginTime); + return this; + } + + /** + * UnSetter for offlineBeginTime. + * @return Builder + */ + public Builder unsetOfflineBeginTime() { + offlineBeginTime = null; + return this; + } + + /** + * Setter for offlineEndTime. + * @param offlineEndTime String value for offlineEndTime. + * @return Builder + */ + public Builder offlineEndTime(String offlineEndTime) { + this.offlineEndTime = OptionalNullable.of(offlineEndTime); + return this; + } + + /** + * UnSetter for offlineEndTime. + * @return Builder + */ + public Builder unsetOfflineEndTime() { + offlineEndTime = null; + return this; + } + /** * Builds a new {@link ListPaymentsRequest} object using the set fields. * @return {@link ListPaymentsRequest} */ public ListPaymentsRequest build() { return new ListPaymentsRequest(beginTime, endTime, sortOrder, cursor, locationId, total, - last4, cardBrand, limit); + last4, cardBrand, limit, isOfflinePayment, offlineBeginTime, offlineEndTime); } } } diff --git a/src/main/java/com/squareup/square/models/OfflinePaymentDetails.java b/src/main/java/com/squareup/square/models/OfflinePaymentDetails.java new file mode 100644 index 00000000..49948932 --- /dev/null +++ b/src/main/java/com/squareup/square/models/OfflinePaymentDetails.java @@ -0,0 +1,100 @@ + +package com.squareup.square.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * This is a model class for OfflinePaymentDetails type. + */ +public class OfflinePaymentDetails { + private final String clientCreatedAt; + + /** + * Initialization constructor. + * @param clientCreatedAt String value for clientCreatedAt. + */ + @JsonCreator + public OfflinePaymentDetails( + @JsonProperty("client_created_at") String clientCreatedAt) { + this.clientCreatedAt = clientCreatedAt; + } + + /** + * Getter for ClientCreatedAt. + * The client-side timestamp of when the offline payment was created, in RFC 3339 format. + * @return Returns the String + */ + @JsonGetter("client_created_at") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getClientCreatedAt() { + return clientCreatedAt; + } + + @Override + public int hashCode() { + return Objects.hash(clientCreatedAt); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof OfflinePaymentDetails)) { + return false; + } + OfflinePaymentDetails other = (OfflinePaymentDetails) obj; + return Objects.equals(clientCreatedAt, other.clientCreatedAt); + } + + /** + * Converts this OfflinePaymentDetails into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "OfflinePaymentDetails [" + "clientCreatedAt=" + clientCreatedAt + "]"; + } + + /** + * Builds a new {@link OfflinePaymentDetails.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link OfflinePaymentDetails.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .clientCreatedAt(getClientCreatedAt()); + return builder; + } + + /** + * Class to build instances of {@link OfflinePaymentDetails}. + */ + public static class Builder { + private String clientCreatedAt; + + + + /** + * Setter for clientCreatedAt. + * @param clientCreatedAt String value for clientCreatedAt. + * @return Builder + */ + public Builder clientCreatedAt(String clientCreatedAt) { + this.clientCreatedAt = clientCreatedAt; + return this; + } + + /** + * Builds a new {@link OfflinePaymentDetails} object using the set fields. + * @return {@link OfflinePaymentDetails} + */ + public OfflinePaymentDetails build() { + return new OfflinePaymentDetails(clientCreatedAt); + } + } +} diff --git a/src/main/java/com/squareup/square/models/Payment.java b/src/main/java/com/squareup/square/models/Payment.java index 6d3388b8..f9ca1282 100644 --- a/src/main/java/com/squareup/square/models/Payment.java +++ b/src/main/java/com/squareup/square/models/Payment.java @@ -42,7 +42,7 @@ public class Payment { private final String referenceId; private final String customerId; private final String employeeId; - private final String teamMemberId; + private final OptionalNullable teamMemberId; private final List refundIds; private final RiskEvaluation riskEvaluation; private final String buyerEmailAddress; @@ -56,6 +56,7 @@ public class Payment { private final DeviceDetails deviceDetails; private final ApplicationDetails applicationDetails; private final Boolean isOfflinePayment; + private final OfflinePaymentDetails offlinePaymentDetails; private final OptionalNullable versionToken; /** @@ -101,6 +102,7 @@ public class Payment { * @param deviceDetails DeviceDetails value for deviceDetails. * @param applicationDetails ApplicationDetails value for applicationDetails. * @param isOfflinePayment Boolean value for isOfflinePayment. + * @param offlinePaymentDetails OfflinePaymentDetails value for offlinePaymentDetails. * @param versionToken String value for versionToken. */ @JsonCreator @@ -146,6 +148,7 @@ public Payment( @JsonProperty("device_details") DeviceDetails deviceDetails, @JsonProperty("application_details") ApplicationDetails applicationDetails, @JsonProperty("is_offline_payment") Boolean isOfflinePayment, + @JsonProperty("offline_payment_details") OfflinePaymentDetails offlinePaymentDetails, @JsonProperty("version_token") String versionToken) { this.id = id; this.createdAt = createdAt; @@ -174,7 +177,7 @@ public Payment( this.referenceId = referenceId; this.customerId = customerId; this.employeeId = employeeId; - this.teamMemberId = teamMemberId; + this.teamMemberId = OptionalNullable.of(teamMemberId); this.refundIds = refundIds; this.riskEvaluation = riskEvaluation; this.buyerEmailAddress = buyerEmailAddress; @@ -188,6 +191,7 @@ public Payment( this.deviceDetails = deviceDetails; this.applicationDetails = applicationDetails; this.isOfflinePayment = isOfflinePayment; + this.offlinePaymentDetails = offlinePaymentDetails; this.versionToken = OptionalNullable.of(versionToken); } @@ -234,6 +238,7 @@ public Payment( * @param deviceDetails DeviceDetails value for deviceDetails. * @param applicationDetails ApplicationDetails value for applicationDetails. * @param isOfflinePayment Boolean value for isOfflinePayment. + * @param offlinePaymentDetails OfflinePaymentDetails value for offlinePaymentDetails. * @param versionToken String value for versionToken. */ @@ -245,12 +250,14 @@ protected Payment(String id, String createdAt, String updatedAt, Money amountMon BankAccountPaymentDetails bankAccountDetails, ExternalPaymentDetails externalDetails, DigitalWalletDetails walletDetails, BuyNowPayLaterDetails buyNowPayLaterDetails, SquareAccountDetails squareAccountDetails, String locationId, String orderId, - String referenceId, String customerId, String employeeId, String teamMemberId, - List refundIds, RiskEvaluation riskEvaluation, String buyerEmailAddress, - Address billingAddress, Address shippingAddress, String note, - String statementDescriptionIdentifier, List capabilities, String receiptNumber, - String receiptUrl, DeviceDetails deviceDetails, ApplicationDetails applicationDetails, - Boolean isOfflinePayment, OptionalNullable versionToken) { + String referenceId, String customerId, String employeeId, + OptionalNullable teamMemberId, List refundIds, + RiskEvaluation riskEvaluation, String buyerEmailAddress, Address billingAddress, + Address shippingAddress, String note, String statementDescriptionIdentifier, + List capabilities, String receiptNumber, String receiptUrl, + DeviceDetails deviceDetails, ApplicationDetails applicationDetails, + Boolean isOfflinePayment, OfflinePaymentDetails offlinePaymentDetails, + OptionalNullable versionToken) { this.id = id; this.createdAt = createdAt; this.updatedAt = updatedAt; @@ -292,6 +299,7 @@ protected Payment(String id, String createdAt, String updatedAt, Money amountMon this.deviceDetails = deviceDetails; this.applicationDetails = applicationDetails; this.isOfflinePayment = isOfflinePayment; + this.offlinePaymentDetails = offlinePaymentDetails; this.versionToken = versionToken; } @@ -660,14 +668,25 @@ public String getEmployeeId() { } /** - * Getter for TeamMemberId. + * Internal Getter for TeamMemberId. * An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. - * @return Returns the String + * @return Returns the Internal String */ @JsonGetter("team_member_id") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetTeamMemberId() { + return this.teamMemberId; + } + + /** + * Getter for TeamMemberId. + * An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment. + * @return Returns the String + */ + @JsonIgnore public String getTeamMemberId() { - return teamMemberId; + return OptionalNullable.getFrom(teamMemberId); } /** @@ -824,6 +843,17 @@ public Boolean getIsOfflinePayment() { return isOfflinePayment; } + /** + * Getter for OfflinePaymentDetails. + * Details specific to offline payments. + * @return Returns the OfflinePaymentDetails + */ + @JsonGetter("offline_payment_details") + @JsonInclude(JsonInclude.Include.NON_NULL) + public OfflinePaymentDetails getOfflinePaymentDetails() { + return offlinePaymentDetails; + } + /** * Internal Getter for VersionToken. * Used for optimistic concurrency. This opaque token identifies a specific version of the @@ -857,7 +887,8 @@ public int hashCode() { locationId, orderId, referenceId, customerId, employeeId, teamMemberId, refundIds, riskEvaluation, buyerEmailAddress, billingAddress, shippingAddress, note, statementDescriptionIdentifier, capabilities, receiptNumber, receiptUrl, - deviceDetails, applicationDetails, isOfflinePayment, versionToken); + deviceDetails, applicationDetails, isOfflinePayment, offlinePaymentDetails, + versionToken); } @Override @@ -911,6 +942,7 @@ public boolean equals(Object obj) { && Objects.equals(deviceDetails, other.deviceDetails) && Objects.equals(applicationDetails, other.applicationDetails) && Objects.equals(isOfflinePayment, other.isOfflinePayment) + && Objects.equals(offlinePaymentDetails, other.offlinePaymentDetails) && Objects.equals(versionToken, other.versionToken); } @@ -939,7 +971,8 @@ public String toString() { + statementDescriptionIdentifier + ", capabilities=" + capabilities + ", receiptNumber=" + receiptNumber + ", receiptUrl=" + receiptUrl + ", deviceDetails=" + deviceDetails + ", applicationDetails=" + applicationDetails - + ", isOfflinePayment=" + isOfflinePayment + ", versionToken=" + versionToken + "]"; + + ", isOfflinePayment=" + isOfflinePayment + ", offlinePaymentDetails=" + + offlinePaymentDetails + ", versionToken=" + versionToken + "]"; } /** @@ -975,7 +1008,6 @@ public Builder toBuilder() { .referenceId(getReferenceId()) .customerId(getCustomerId()) .employeeId(getEmployeeId()) - .teamMemberId(getTeamMemberId()) .refundIds(getRefundIds()) .riskEvaluation(getRiskEvaluation()) .buyerEmailAddress(getBuyerEmailAddress()) @@ -988,8 +1020,10 @@ public Builder toBuilder() { .receiptUrl(getReceiptUrl()) .deviceDetails(getDeviceDetails()) .applicationDetails(getApplicationDetails()) - .isOfflinePayment(getIsOfflinePayment()); + .isOfflinePayment(getIsOfflinePayment()) + .offlinePaymentDetails(getOfflinePaymentDetails()); builder.delayAction = internalGetDelayAction(); + builder.teamMemberId = internalGetTeamMemberId(); builder.versionToken = internalGetVersionToken(); return builder; } @@ -1025,7 +1059,7 @@ public static class Builder { private String referenceId; private String customerId; private String employeeId; - private String teamMemberId; + private OptionalNullable teamMemberId; private List refundIds; private RiskEvaluation riskEvaluation; private String buyerEmailAddress; @@ -1039,6 +1073,7 @@ public static class Builder { private DeviceDetails deviceDetails; private ApplicationDetails applicationDetails; private Boolean isOfflinePayment; + private OfflinePaymentDetails offlinePaymentDetails; private OptionalNullable versionToken; @@ -1328,7 +1363,16 @@ public Builder employeeId(String employeeId) { * @return Builder */ public Builder teamMemberId(String teamMemberId) { - this.teamMemberId = teamMemberId; + this.teamMemberId = OptionalNullable.of(teamMemberId); + return this; + } + + /** + * UnSetter for teamMemberId. + * @return Builder + */ + public Builder unsetTeamMemberId() { + teamMemberId = null; return this; } @@ -1462,6 +1506,16 @@ public Builder isOfflinePayment(Boolean isOfflinePayment) { return this; } + /** + * Setter for offlinePaymentDetails. + * @param offlinePaymentDetails OfflinePaymentDetails value for offlinePaymentDetails. + * @return Builder + */ + public Builder offlinePaymentDetails(OfflinePaymentDetails offlinePaymentDetails) { + this.offlinePaymentDetails = offlinePaymentDetails; + return this; + } + /** * Setter for versionToken. * @param versionToken String value for versionToken. @@ -1494,7 +1548,7 @@ public Payment build() { teamMemberId, refundIds, riskEvaluation, buyerEmailAddress, billingAddress, shippingAddress, note, statementDescriptionIdentifier, capabilities, receiptNumber, receiptUrl, deviceDetails, applicationDetails, isOfflinePayment, - versionToken); + offlinePaymentDetails, versionToken); } } }