From febdf6d49c91b34b8365bb0181bd803fb5527851 Mon Sep 17 00:00:00 2001 From: autobot Date: Wed, 7 Jun 2023 17:29:33 +0000 Subject: [PATCH] Generated PR for Release: 28.0.0.20230608 --- composer.json | 2 +- doc/apis/o-auth.md | 10 +- doc/apis/subscriptions.md | 34 ++- doc/apis/terminal.md | 44 ++- doc/client.md | 6 +- doc/models/activity-type.md | 4 + doc/models/cancel-subscription-response.md | 53 +++- .../cancel-terminal-checkout-response.md | 2 +- .../catalog-custom-attribute-definition.md | 6 +- doc/models/catalog-item-option.md | 6 +- doc/models/catalog-modifier-list.md | 4 +- doc/models/catalog-object-batch.md | 2 +- doc/models/catalog-object-type.md | 1 + doc/models/catalog-object.md | 4 +- .../catalog-subscription-plan-variation.md | 51 ++++ doc/models/catalog-subscription-plan.md | 101 ++++++- doc/models/checkout-options.md | 2 + doc/models/collected-data.md | 21 ++ doc/models/confirmation-decision.md | 21 ++ doc/models/confirmation-options.md | 31 +++ ...eate-mobile-authorization-code-response.md | 28 +- doc/models/create-payment-link-response.md | 6 +- doc/models/create-subscription-request.md | 13 +- doc/models/create-subscription-response.md | 5 +- .../create-terminal-checkout-response.md | 2 +- .../data-collection-options-input-type.md | 16 ++ doc/models/data-collection-options.md | 29 ++ .../delete-subscription-action-response.md | 5 +- .../dismiss-terminal-action-response.md | 63 +++++ doc/models/employee-wage.md | 3 +- doc/models/get-employee-wage-response.md | 2 +- doc/models/get-team-member-wage-response.md | 3 +- doc/models/get-terminal-checkout-response.md | 2 +- doc/models/list-payouts-response.md | 2 + .../list-subscription-events-request.md | 2 +- .../list-subscription-events-response.md | 120 ++++---- doc/models/list-team-member-wages-response.md | 12 +- doc/models/obtain-token-request.md | 8 +- doc/models/pause-subscription-response.md | 13 +- doc/models/payment-link-related-resources.md | 4 +- doc/models/payout.md | 1 + doc/models/phase-input.md | 25 ++ doc/models/phase.md | 29 ++ doc/models/qr-code-options.md | 27 ++ doc/models/resume-subscription-response.md | 13 +- doc/models/retrieve-subscription-response.md | 5 +- doc/models/retrieve-token-status-response.md | 4 +- doc/models/revoke-token-request.md | 2 +- doc/models/search-catalog-items-response.md | 4 +- doc/models/search-catalog-objects-response.md | 6 +- doc/models/search-subscriptions-request.md | 2 +- doc/models/search-subscriptions-response.md | 11 +- doc/models/search-terminal-actions-request.md | 2 +- .../search-terminal-checkouts-response.md | 4 +- doc/models/select-option.md | 23 ++ doc/models/select-options.md | 35 +++ doc/models/shift-wage.md | 6 +- doc/models/signature-image.md | 23 ++ doc/models/signature-options.md | 30 ++ doc/models/subscription-action.md | 19 +- doc/models/subscription-event.md | 21 +- doc/models/subscription-phase.md | 17 +- doc/models/subscription-pricing-type.md | 16 ++ doc/models/subscription-pricing.md | 33 +++ doc/models/subscription.md | 11 +- doc/models/swap-plan-request.md | 15 +- doc/models/swap-plan-response.md | 24 +- doc/models/team-member-wage.md | 4 +- doc/models/terminal-action-action-type.md | 5 + doc/models/terminal-action-query-filter.md | 2 +- doc/models/terminal-action-query.md | 2 +- doc/models/terminal-action.md | 7 + doc/models/update-subscription-request.md | 4 +- doc/models/update-subscription-response.md | 3 +- src/Apis/OAuthApi.php | 10 +- src/Apis/SubscriptionsApi.php | 34 +-- src/Apis/TerminalApi.php | 27 +- src/ConfigurationDefaults.php | 2 +- src/Models/ActivityType.php | 24 ++ .../CatalogSubscriptionPlanBuilder.php | 72 +++++ ...atalogSubscriptionPlanVariationBuilder.php | 60 ++++ .../Builders/CheckoutOptionsBuilder.php | 36 +++ src/Models/Builders/CollectedDataBuilder.php | 51 ++++ .../Builders/ConfirmationDecisionBuilder.php | 51 ++++ .../Builders/ConfirmationOptionsBuilder.php | 70 +++++ ...MobileAuthorizationCodeResponseBuilder.php | 7 +- .../CreateSubscriptionRequestBuilder.php | 31 ++- .../Builders/DataCollectionOptionsBuilder.php | 52 ++++ .../DismissTerminalActionResponseBuilder.php | 61 ++++ src/Models/Builders/PayoutBuilder.php | 18 ++ src/Models/Builders/PhaseBuilder.php | 114 ++++++++ src/Models/Builders/PhaseInputBuilder.php | 60 ++++ src/Models/Builders/QrCodeOptionsBuilder.php | 42 +++ src/Models/Builders/SelectOptionBuilder.php | 42 +++ src/Models/Builders/SelectOptionsBuilder.php | 52 ++++ src/Models/Builders/ShiftWageBuilder.php | 9 + src/Models/Builders/SignatureImageBuilder.php | 60 ++++ .../Builders/SignatureOptionsBuilder.php | 51 ++++ .../Builders/SubscriptionActionBuilder.php | 30 +- src/Models/Builders/SubscriptionBuilder.php | 15 +- .../Builders/SubscriptionEventBuilder.php | 28 +- .../Builders/SubscriptionPhaseBuilder.php | 10 + .../Builders/SubscriptionPricingBuilder.php | 79 ++++++ .../Builders/SubscriptionSourceBuilder.php | 9 + .../Builders/SwapPlanRequestBuilder.php | 40 ++- src/Models/Builders/TeamMemberWageBuilder.php | 18 ++ src/Models/Builders/TerminalActionBuilder.php | 86 ++++++ src/Models/CancelSubscriptionResponse.php | 14 +- src/Models/CatalogObject.php | 14 +- src/Models/CatalogObjectType.php | 7 + src/Models/CatalogSubscriptionPlan.php | 189 ++++++++++++- .../CatalogSubscriptionPlanVariation.php | 143 ++++++++++ src/Models/CheckoutOptions.php | 86 ++++++ src/Models/CollectedData.php | 57 ++++ src/Models/ConfirmationDecision.php | 57 ++++ src/Models/ConfirmationOptions.php | 188 +++++++++++++ .../CreateMobileAuthorizationCodeResponse.php | 32 +-- src/Models/CreateSubscriptionRequest.php | 115 ++++++-- src/Models/CreateSubscriptionResponse.php | 14 +- src/Models/DataCollectionOptions.php | 150 ++++++++++ src/Models/DataCollectionOptionsInputType.php | 23 ++ .../DeleteSubscriptionActionResponse.php | 14 +- src/Models/DismissTerminalActionResponse.php | 89 ++++++ src/Models/EmployeeWage.php | 6 +- src/Models/GetEmployeeWageResponse.php | 12 +- src/Models/ListSubscriptionEventsRequest.php | 12 +- src/Models/ListSubscriptionEventsResponse.php | 8 +- src/Models/ObtainTokenRequest.php | 64 +++-- src/Models/PauseSubscriptionResponse.php | 14 +- src/Models/Payout.php | 68 ++++- src/Models/Phase.php | 192 +++++++++++++ src/Models/PhaseInput.php | 107 +++++++ src/Models/QrCodeOptions.php | 127 +++++++++ src/Models/ResumeSubscriptionResponse.php | 14 +- src/Models/RetrieveSubscriptionResponse.php | 14 +- src/Models/RetrieveTokenStatusResponse.php | 8 +- src/Models/RevokeTokenRequest.php | 6 +- src/Models/SearchSubscriptionsRequest.php | 8 +- src/Models/SearchSubscriptionsResponse.php | 8 +- src/Models/SelectOption.php | 93 +++++++ src/Models/SelectOptions.php | 152 ++++++++++ src/Models/ShiftWage.php | 39 ++- src/Models/SignatureImage.php | 87 ++++++ src/Models/SignatureOptions.php | 125 +++++++++ src/Models/Subscription.php | 63 +++-- src/Models/SubscriptionAction.php | 84 ++++-- src/Models/SubscriptionEvent.php | 106 +++++-- src/Models/SubscriptionPhase.php | 33 ++- src/Models/SubscriptionPricing.php | 144 ++++++++++ src/Models/SubscriptionPricingType.php | 21 ++ src/Models/SubscriptionSource.php | 26 +- src/Models/SwapPlanRequest.php | 87 ++++-- src/Models/SwapPlanResponse.php | 14 +- src/Models/TeamMemberWage.php | 43 +++ src/Models/TerminalAction.php | 260 +++++++++++++++++- src/Models/TerminalActionActionType.php | 30 ++ src/Models/UpdateSubscriptionRequest.php | 14 +- src/Models/UpdateSubscriptionResponse.php | 14 +- src/SquareClient.php | 4 +- 159 files changed, 5285 insertions(+), 543 deletions(-) create mode 100644 doc/models/catalog-subscription-plan-variation.md create mode 100644 doc/models/collected-data.md create mode 100644 doc/models/confirmation-decision.md create mode 100644 doc/models/confirmation-options.md create mode 100644 doc/models/data-collection-options-input-type.md create mode 100644 doc/models/data-collection-options.md create mode 100644 doc/models/dismiss-terminal-action-response.md create mode 100644 doc/models/phase-input.md create mode 100644 doc/models/phase.md create mode 100644 doc/models/qr-code-options.md create mode 100644 doc/models/select-option.md create mode 100644 doc/models/select-options.md create mode 100644 doc/models/signature-image.md create mode 100644 doc/models/signature-options.md create mode 100644 doc/models/subscription-pricing-type.md create mode 100644 doc/models/subscription-pricing.md create mode 100644 src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php create mode 100644 src/Models/Builders/CollectedDataBuilder.php create mode 100644 src/Models/Builders/ConfirmationDecisionBuilder.php create mode 100644 src/Models/Builders/ConfirmationOptionsBuilder.php create mode 100644 src/Models/Builders/DataCollectionOptionsBuilder.php create mode 100644 src/Models/Builders/DismissTerminalActionResponseBuilder.php create mode 100644 src/Models/Builders/PhaseBuilder.php create mode 100644 src/Models/Builders/PhaseInputBuilder.php create mode 100644 src/Models/Builders/QrCodeOptionsBuilder.php create mode 100644 src/Models/Builders/SelectOptionBuilder.php create mode 100644 src/Models/Builders/SelectOptionsBuilder.php create mode 100644 src/Models/Builders/SignatureImageBuilder.php create mode 100644 src/Models/Builders/SignatureOptionsBuilder.php create mode 100644 src/Models/Builders/SubscriptionPricingBuilder.php create mode 100644 src/Models/CatalogSubscriptionPlanVariation.php create mode 100644 src/Models/CollectedData.php create mode 100644 src/Models/ConfirmationDecision.php create mode 100644 src/Models/ConfirmationOptions.php create mode 100644 src/Models/DataCollectionOptions.php create mode 100644 src/Models/DataCollectionOptionsInputType.php create mode 100644 src/Models/DismissTerminalActionResponse.php create mode 100644 src/Models/Phase.php create mode 100644 src/Models/PhaseInput.php create mode 100644 src/Models/QrCodeOptions.php create mode 100644 src/Models/SelectOption.php create mode 100644 src/Models/SelectOptions.php create mode 100644 src/Models/SignatureImage.php create mode 100644 src/Models/SignatureOptions.php create mode 100644 src/Models/SubscriptionPricing.php create mode 100644 src/Models/SubscriptionPricingType.php diff --git a/composer.json b/composer.json index 9ce5f3ae..615a6e26 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "square/square", "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", - "version": "27.0.0.20230517", + "version": "28.0.0.20230608", "type": "library", "keywords": [ "Square", diff --git a/doc/apis/o-auth.md b/doc/apis/o-auth.md index b470a65e..1653b7a1 100644 --- a/doc/apis/o-auth.md +++ b/doc/apis/o-auth.md @@ -37,7 +37,7 @@ following format: Authorization: Client APPLICATION_SECRET ``` -Replace `APPLICATION_SECRET` with the application secret on the Credentials +Replace `APPLICATION_SECRET` with the application secret on the **Credentials** page in the [Developer Dashboard](https://developer.squareup.com/apps). :information_source: **Note** This endpoint does not require authentication. @@ -50,7 +50,7 @@ function renewToken(string $clientId, RenewTokenRequest $body, string $authoriza | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `clientId` | `string` | Template, Required | Your application ID, which is available in the OAuth page in the [Developer Dashboard](https://developer.squareup.com/apps). | +| `clientId` | `string` | Template, Required | Your application ID, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). | | `body` | [`RenewTokenRequest`](../../doc/models/renew-token-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | | `authorization` | `string` | Header, Required | Client APPLICATION_SECRET | @@ -103,8 +103,8 @@ following format: Authorization: Client APPLICATION_SECRET ``` -Replace `APPLICATION_SECRET` with the application secret on the OAuth -page for your application on the Developer Dashboard. +Replace `APPLICATION_SECRET` with the application secret on the **OAuth** +page for your application in the Developer Dashboard. :information_source: **Note** This endpoint does not require authentication. @@ -159,7 +159,7 @@ returns only an access token. The `grant_type` parameter specifies the type of OAuth request. If `grant_type` is `authorization_code`, you must include the authorization code you received when a seller granted you authorization. If `grant_type` -is `refresh_token`, you must provide a valid refresh token. If you are using +is `refresh_token`, you must provide a valid refresh token. If you're using an old version of the Square APIs (prior to March 13, 2019), `grant_type` can be `migration_token` and you must provide a valid migration token. diff --git a/doc/apis/subscriptions.md b/doc/apis/subscriptions.md index 3264491f..0915a92e 100644 --- a/doc/apis/subscriptions.md +++ b/doc/apis/subscriptions.md @@ -24,13 +24,15 @@ $subscriptionsApi = $client->getSubscriptionsApi(); # Create Subscription -Creates a subscription to a subscription plan by a customer. +Enrolls a customer in a subscription. If you provide a card on file in the request, Square charges the card for -the subscription. Otherwise, Square bills an invoice to the customer's email +the subscription. Otherwise, Square sends an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. +For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). + ```php function createSubscription(CreateSubscriptionRequest $body): ApiResponse ``` @@ -50,10 +52,10 @@ This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` met ```php $body = CreateSubscriptionRequestBuilder::init( 'S8GWD5R9QB376', - '6JHXF3B2CW3YKHDV4XEM674H', 'CHFGVKYY8RSV93M5KCYTG4PN0G' ) ->idempotencyKey('8193148c-9586-11e6-99f9-28cfe92138cf') + ->planId('6JHXF3B2CW3YKHDV4XEM674H') ->startDate('2021-10-20') ->taxPercentage('5') ->priceOverrideMoney( @@ -102,9 +104,6 @@ If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. -For more information, see -[Retrieve subscriptions](https://developer.squareup.com/docs/subscriptions-api/overview#retrieve-subscriptions). - ```php function searchSubscriptions(SearchSubscriptionsRequest $body): ApiResponse ``` @@ -164,7 +163,7 @@ var_dump($apiResponse->getHeaders()); # Retrieve Subscription -Retrieves a subscription. +Retrieves a specific subscription. ```php function retrieveSubscription(string $subscriptionId, ?string $mInclude = null): ApiResponse @@ -202,8 +201,8 @@ var_dump($apiResponse->getHeaders()); # Update Subscription -Updates a subscription. You can set, modify, and clear the -`subscription` field values. +Updates a subscription by modifying or clearing `subscription` field values. +To clear a field, set its value to `null`. ```php function updateSubscription(string $subscriptionId, UpdateSubscriptionRequest $body): ApiResponse @@ -292,9 +291,9 @@ var_dump($apiResponse->getHeaders()); # Cancel Subscription -Schedules a `CANCEL` action to cancel an active subscription -by setting the `canceled_date` field to the end of the active billing period -and changing the subscription status from ACTIVE to CANCELED after this date. +Schedules a `CANCEL` action to cancel an active subscription. This +sets the `canceled_date` field to the end of the active billing period. After this date, +the subscription status changes from ACTIVE to CANCELED. ```php function cancelSubscription(string $subscriptionId): ApiResponse @@ -331,7 +330,7 @@ var_dump($apiResponse->getHeaders()); # List Subscription Events -Lists all events for a specific subscription. +Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. ```php function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null, ?int $limit = null): ApiResponse @@ -342,7 +341,7 @@ function listSubscriptionEvents(string $subscriptionId, ?string $cursor = null, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve the events for. | -| `cursor` | `?string` | Query, Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | +| `cursor` | `?string` | Query, Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | | `limit` | `?int` | Query, Optional | The upper limit on the number of subscription events to return
in a paged response. | ## Response Type @@ -456,7 +455,8 @@ var_dump($apiResponse->getHeaders()); # Swap Plan -Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription. +Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. +For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). ```php function swapPlan(string $subscriptionId, SwapPlanRequest $body): ApiResponse @@ -478,9 +478,7 @@ This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` met ```php $subscriptionId = 'subscription_id0'; -$body = SwapPlanRequestBuilder::init( - '' -)->build(); +$body = SwapPlanRequestBuilder::init()->build(); $apiResponse = $subscriptionsApi->swapPlan( $subscriptionId, diff --git a/doc/apis/terminal.md b/doc/apis/terminal.md index b6997b2b..3eda8ac6 100644 --- a/doc/apis/terminal.md +++ b/doc/apis/terminal.md @@ -14,6 +14,7 @@ $terminalApi = $client->getTerminalApi(); * [Search Terminal Actions](../../doc/apis/terminal.md#search-terminal-actions) * [Get Terminal Action](../../doc/apis/terminal.md#get-terminal-action) * [Cancel Terminal Action](../../doc/apis/terminal.md#cancel-terminal-action) +* [Dismiss Terminal Action](../../doc/apis/terminal.md#dismiss-terminal-action) * [Create Terminal Checkout](../../doc/apis/terminal.md#create-terminal-checkout) * [Search Terminal Checkouts](../../doc/apis/terminal.md#search-terminal-checkouts) * [Get Terminal Checkout](../../doc/apis/terminal.md#get-terminal-checkout) @@ -144,7 +145,7 @@ function getTerminalAction(string $actionId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction` | +| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | ## Response Type @@ -181,7 +182,7 @@ function cancelTerminalAction(string $actionId): ApiResponse | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction` | +| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | ## Response Type @@ -206,6 +207,45 @@ var_dump($apiResponse->getHeaders()); ``` +# Dismiss Terminal Action + +Dismisses a Terminal action request if the status and type of the request permits it. + +See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. + +```php +function dismissTerminalAction(string $actionId): ApiResponse +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `actionId` | `string` | Template, Required | Unique ID for the `TerminalAction` associated with the waiting dialog to be dismissed. | + +## Response Type + +This method returns a `Square\Utils\ApiResponse` instance. The `getResult()` method on this instance returns the response data which is of type [`DismissTerminalActionResponse`](../../doc/models/dismiss-terminal-action-response.md). + +## Example Usage + +```php +$actionId = 'action_id6'; + +$apiResponse = $terminalApi->dismissTerminalAction($actionId); + +if ($apiResponse->isSuccess()) { + $dismissTerminalActionResponse = $apiResponse->getResult(); +} else { + $errors = $apiResponse->getErrors(); +} + +// Getting more response information +var_dump($apiResponse->getStatusCode()); +var_dump($apiResponse->getHeaders()); +``` + + # Create Terminal Checkout Creates a Terminal checkout request and sends it to the specified device to take a payment diff --git a/doc/client.md b/doc/client.md index 8ad37266..235c1d69 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*: `'2023-05-17'` | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2023-06-08'` | | `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`** | | `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `60` | @@ -26,7 +26,7 @@ The API client can be initialized as follows: ```php $client = SquareClientBuilder::init() ->accessToken('AccessToken') - ->squareVersion('2023-05-17') + ->squareVersion('2023-06-08') ->environment('production') ->customUrl('https://connect.squareup.com') ->build(); @@ -51,7 +51,7 @@ use Square\SquareClientBuilder; $client = SquareClientBuilder::init() ->accessToken('AccessToken') - ->squareVersion('2023-05-17') + ->squareVersion('2023-06-08') ->build(); $apiResponse = $client->getLocationsApi()->listLocations(); diff --git a/doc/models/activity-type.md b/doc/models/activity-type.md index 83b0b11c..f2157dcf 100644 --- a/doc/models/activity-type.md +++ b/doc/models/activity-type.md @@ -44,4 +44,8 @@ | `THIRD_PARTY_FEE` | Fees collected by a third-party platform. | | `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. | | `PAYOUT` | Balance change due to money transfer. | +| `AUTOMATIC_BITCOIN_CONVERSIONS` | Indicates the withholding of a portion of each payment by Square that has been
automatically converted into bitcoin using Cash App. The seller manages their bitcoin in
their Cash App account. | +| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates a return of the payment withholding that had been scheduled to be converted
into bitcoin using Cash App to the Square payments balance. | +| `CREDIT_CARD_REPAYMENT` | The repayment made toward the outstanding balance on the seller's Square credit card. | +| `CREDIT_CARD_REPAYMENT_REVERSED` | The reversal of the repayment made toward the outstanding balance on the seller's
Square credit card. | diff --git a/doc/models/cancel-subscription-response.md b/doc/models/cancel-subscription-response.md index 3683ca76..62fa7c36 100644 --- a/doc/models/cancel-subscription-response.md +++ b/doc/models/cancel-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | | `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a single `CANCEL` action scheduled for the subscription. | getActions(): ?array | setActions(?array actions): void | ## Example (as JSON) @@ -35,7 +35,8 @@ Defines output parameters in a response from the "start_date": "2021-10-20", "status": "ACTIVE", "timezone": "America/Los_Angeles", - "version": 1594311617331 + "version": 1594311617331, + "plan_variation_id": "plan_variation_id8" }, "errors": [ { @@ -62,19 +63,61 @@ Defines output parameters in a response from the "id": "id9", "type": "PAUSE", "effective_date": "effective_date1", - "new_plan_id": "new_plan_id5" + "phases": [ + { + "uid": "uid6", + "ordinal": 186, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "new_plan_variation_id": "new_plan_variation_id9" }, { "id": "id0", "type": "CANCEL", "effective_date": "effective_date0", - "new_plan_id": "new_plan_id6" + "phases": [ + { + "uid": "uid5", + "ordinal": 185, + "order_template_id": "order_template_id7", + "plan_phase_uid": "plan_phase_uid1" + }, + { + "uid": "uid6", + "ordinal": 186, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + }, + { + "uid": "uid7", + "ordinal": 187, + "order_template_id": "order_template_id9", + "plan_phase_uid": "plan_phase_uid3" + } + ], + "new_plan_variation_id": "new_plan_variation_id0" }, { "id": "id1", "type": "SWAP_PLAN", "effective_date": "effective_date9", - "new_plan_id": "new_plan_id7" + "phases": [ + { + "uid": "uid4", + "ordinal": 184, + "order_template_id": "order_template_id6", + "plan_phase_uid": "plan_phase_uid0" + }, + { + "uid": "uid5", + "ordinal": 185, + "order_template_id": "order_template_id7", + "plan_phase_uid": "plan_phase_uid1" + } + ], + "new_plan_variation_id": "new_plan_variation_id1" } ] } diff --git a/doc/models/cancel-terminal-checkout-response.md b/doc/models/cancel-terminal-checkout-response.md index a54a9237..80944d13 100644 --- a/doc/models/cancel-terminal-checkout-response.md +++ b/doc/models/cancel-terminal-checkout-response.md @@ -24,7 +24,7 @@ "app_id": "APP_ID", "cancel_reason": "SELLER_CANCELED", "created_at": "2020-03-16T15:31:19.934Z", - "deadline_duration": "PT10M", + "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": true, diff --git a/doc/models/catalog-custom-attribute-definition.md b/doc/models/catalog-custom-attribute-definition.md index 26dbca76..0c355469 100644 --- a/doc/models/catalog-custom-attribute-definition.md +++ b/doc/models/catalog-custom-attribute-definition.md @@ -41,9 +41,9 @@ to store any sensitive information (personally identifiable information, card de "name": "name2" }, "allowed_object_types": [ - "PRICING_RULE", - "PRODUCT_SET", - "TIME_PERIOD" + "TIME_PERIOD", + "MEASUREMENT_UNIT", + "SUBSCRIPTION_PLAN_VARIATION" ], "seller_visibility": "SELLER_VISIBILITY_HIDDEN", "app_visibility": "APP_VISIBILITY_HIDDEN", diff --git a/doc/models/catalog-item-option.md b/doc/models/catalog-item-option.md index 62a00f6a..621136ec 100644 --- a/doc/models/catalog-item-option.md +++ b/doc/models/catalog-item-option.md @@ -27,7 +27,7 @@ A group of variations for a `CatalogItem`. "show_colors": false, "values": [ { - "type": "MODIFIER", + "type": "TAX", "id": "id0", "updated_at": "updated_at6", "version": 100, @@ -71,7 +71,7 @@ A group of variations for a `CatalogItem`. ] }, { - "type": "MODIFIER_LIST", + "type": "ITEM_VARIATION", "id": "id1", "updated_at": "updated_at7", "version": 101, @@ -100,7 +100,7 @@ A group of variations for a `CatalogItem`. ] }, { - "type": "DISCOUNT", + "type": "CATEGORY", "id": "id2", "updated_at": "updated_at8", "version": 102, diff --git a/doc/models/catalog-modifier-list.md b/doc/models/catalog-modifier-list.md index a8207779..6a7e90d0 100644 --- a/doc/models/catalog-modifier-list.md +++ b/doc/models/catalog-modifier-list.md @@ -74,7 +74,7 @@ the modifier list are allowed. "selection_type": "SINGLE", "modifiers": [ { - "type": "CATEGORY", + "type": "DISCOUNT", "id": "id1", "updated_at": "updated_at7", "version": 145, @@ -100,7 +100,7 @@ the modifier list are allowed. ] }, { - "type": "IMAGE", + "type": "TAX", "id": "id2", "updated_at": "updated_at8", "version": 146, diff --git a/doc/models/catalog-object-batch.md b/doc/models/catalog-object-batch.md index 25f1c548..a3702bf6 100644 --- a/doc/models/catalog-object-batch.md +++ b/doc/models/catalog-object-batch.md @@ -19,7 +19,7 @@ A batch of catalog objects. { "objects": [ { - "type": "CUSTOM_ATTRIBUTE_DEFINITION", + "type": "MODIFIER_LIST", "id": "id8", "item_data": { "object": { diff --git a/doc/models/catalog-object-type.md b/doc/models/catalog-object-type.md index 918c58b7..d817fb24 100644 --- a/doc/models/catalog-object-type.md +++ b/doc/models/catalog-object-type.md @@ -24,6 +24,7 @@ containing type-specific properties in the `*_data` field corresponding to the s | `PRODUCT_SET` | The `CatalogObject` instance is of the [CatalogProductSet](../../doc/models/catalog-product-set.md) type and represents a product set.
The product-set-specific data will be stored in the `product_set_data` field. | | `TIME_PERIOD` | The `CatalogObject` instance is of the [CatalogTimePeriod](../../doc/models/catalog-time-period.md) type and represents a time period.
The time-period-specific data must be set on the `time_period_data` field. | | `MEASUREMENT_UNIT` | The `CatalogObject` instance is of the [CatalogMeasurementUnit](../../doc/models/catalog-measurement-unit.md) type and represents a measurement unit specifying the unit of
measure and precision in which an item variation is sold. The measurement-unit-specific data must set on the `measurement_unit_data` field. | +| `SUBSCRIPTION_PLAN_VARIATION` | The `CatalogObject` instance is of the [CatalogSubscriptionPlan](../../doc/models/catalog-subscription-plan.md) type and represents a subscription plan.
The subscription-plan-specific data must be stored on the `subscription_plan_data` field. | | `ITEM_OPTION` | The `CatalogObject` instance is of the [CatalogItemOption](../../doc/models/catalog-item-option.md) type and represents a list of options (such as a color or size of a T-shirt)
that can be assigned to item variations. The item-option-specific data must be on the `item_option_data` field. | | `ITEM_OPTION_VAL` | The `CatalogObject` instance is of the [CatalogItemOptionValue](../../doc/models/catalog-item-option-value.md) type and represents a value associated with one or more item options.
For example, an item option of "Size" may have item option values such as "Small" or "Medium".
The item-option-value-specific data must be on the `item_option_value_data` field. | | `CUSTOM_ATTRIBUTE_DEFINITION` | The `CatalogObject` instance is of the [CatalogCustomAttributeDefinition](../../doc/models/catalog-custom-attribute-definition.md) type and represents the definition of a custom attribute.
The custom-attribute-definition-specific data must be set on the `custom_attribute_definition_data` field. | diff --git a/doc/models/catalog-object.md b/doc/models/catalog-object.md index 6b9461e3..5d70ed07 100644 --- a/doc/models/catalog-object.md +++ b/doc/models/catalog-object.md @@ -42,7 +42,7 @@ For a more detailed discussion of the Catalog data model, please see the | `pricingRuleData` | [`?CatalogPricingRule`](../../doc/models/catalog-pricing-rule.md) | Optional | Defines how discounts are automatically applied to a set of items that match the pricing rule
during the active time period. | getPricingRuleData(): ?CatalogPricingRule | setPricingRuleData(?CatalogPricingRule pricingRuleData): void | | `imageData` | [`?CatalogImage`](../../doc/models/catalog-image.md) | Optional | An image file to use in Square catalogs. It can be associated with
`CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects.
Only the images on items and item variations are exposed in Dashboard.
Only the first image on an item is displayed in Square Point of Sale (SPOS).
Images on items and variations are displayed through Square Online Store.
Images on other object types are for use by 3rd party application developers. | getImageData(): ?CatalogImage | setImageData(?CatalogImage imageData): void | | `measurementUnitData` | [`?CatalogMeasurementUnit`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | getMeasurementUnitData(): ?CatalogMeasurementUnit | setMeasurementUnitData(?CatalogMeasurementUnit measurementUnitData): void | -| `subscriptionPlanData` | [`?CatalogSubscriptionPlan`](../../doc/models/catalog-subscription-plan.md) | Optional | Describes a subscription plan. For more information, see
[Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan). | getSubscriptionPlanData(): ?CatalogSubscriptionPlan | setSubscriptionPlanData(?CatalogSubscriptionPlan subscriptionPlanData): void | +| `subscriptionPlanData` | [`?CatalogSubscriptionPlan`](../../doc/models/catalog-subscription-plan.md) | Optional | Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations.
For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). | getSubscriptionPlanData(): ?CatalogSubscriptionPlan | setSubscriptionPlanData(?CatalogSubscriptionPlan subscriptionPlanData): void | | `itemOptionData` | [`?CatalogItemOption`](../../doc/models/catalog-item-option.md) | Optional | A group of variations for a `CatalogItem`. | getItemOptionData(): ?CatalogItemOption | setItemOptionData(?CatalogItemOption itemOptionData): void | | `itemOptionValueData` | [`?CatalogItemOptionValue`](../../doc/models/catalog-item-option-value.md) | Optional | An enumerated value that can link a
`CatalogItemVariation` to an item option as one of
its item option values. | getItemOptionValueData(): ?CatalogItemOptionValue | setItemOptionValueData(?CatalogItemOptionValue itemOptionValueData): void | | `customAttributeDefinitionData` | [`?CatalogCustomAttributeDefinition`](../../doc/models/catalog-custom-attribute-definition.md) | Optional | Contains information defining a custom attribute. Custom attributes are
intended to store additional information about a catalog object or to associate a
catalog object with an entity in another system. Do not use custom attributes
to store any sensitive information (personally identifiable information, card details, etc.).
[Read more about custom attributes](https://developer.squareup.com/docs/catalog-api/add-custom-attributes) | getCustomAttributeDefinitionData(): ?CatalogCustomAttributeDefinition | setCustomAttributeDefinitionData(?CatalogCustomAttributeDefinition customAttributeDefinitionData): void | @@ -52,7 +52,7 @@ For a more detailed discussion of the Catalog data model, please see the ```json { - "type": "ITEM_VARIATION", + "type": "CATEGORY", "id": "id0", "item_data": { "object": { diff --git a/doc/models/catalog-subscription-plan-variation.md b/doc/models/catalog-subscription-plan-variation.md new file mode 100644 index 00000000..88da9110 --- /dev/null +++ b/doc/models/catalog-subscription-plan-variation.md @@ -0,0 +1,51 @@ + +# Catalog Subscription Plan Variation + +Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold. +For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). + +## Structure + +`CatalogSubscriptionPlanVariation` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `name` | `string` | Required | The name of the plan variation. | getName(): string | setName(string name): void | +| `phases` | [`SubscriptionPhase[]`](../../doc/models/subscription-phase.md) | Required | A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. | getPhases(): array | setPhases(array phases): void | +| `subscriptionPlanId` | `?string` | Optional | The id of the subscription plan, if there is one. | getSubscriptionPlanId(): ?string | setSubscriptionPlanId(?string subscriptionPlanId): void | + +## Example (as JSON) + +```json +{ + "name": "name0", + "phases": [ + { + "uid": "uid5", + "cadence": "EVERY_FOUR_MONTHS", + "periods": 241, + "recurring_price_money": { + "amount": 193, + "currency": "MOP" + }, + "ordinal": 207, + "pricing": { + "type": "RELATIVE", + "discount_ids": [ + "discount_ids0", + "discount_ids1", + "discount_ids2" + ], + "price_money": { + "amount": 251, + "currency": "SLL" + } + } + } + ], + "subscription_plan_id": "subscription_plan_id2" +} +``` + diff --git a/doc/models/catalog-subscription-plan.md b/doc/models/catalog-subscription-plan.md index 185d5dc2..d1561949 100644 --- a/doc/models/catalog-subscription-plan.md +++ b/doc/models/catalog-subscription-plan.md @@ -1,8 +1,8 @@ # Catalog Subscription Plan -Describes a subscription plan. For more information, see -[Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan). +Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations. +For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). ## Structure @@ -14,6 +14,10 @@ Describes a subscription plan. For more information, see | --- | --- | --- | --- | --- | --- | | `name` | `string` | Required | The name of the plan. | getName(): string | setName(string name): void | | `phases` | [`?(SubscriptionPhase[])`](../../doc/models/subscription-phase.md) | Optional | A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this plan.
This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error | getPhases(): ?array | setPhases(?array phases): void | +| `subscriptionPlanVariations` | [`?(CatalogObject[])`](../../doc/models/catalog-object.md) | Optional | The list of subscription plan variations available for this product | getSubscriptionPlanVariations(): ?array | setSubscriptionPlanVariations(?array subscriptionPlanVariations): void | +| `eligibleItemIds` | `?(string[])` | Optional | The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. | getEligibleItemIds(): ?array | setEligibleItemIds(?array eligibleItemIds): void | +| `eligibleCategoryIds` | `?(string[])` | Optional | The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations. | getEligibleCategoryIds(): ?array | setEligibleCategoryIds(?array eligibleCategoryIds): void | +| `allItems` | `?bool` | Optional | If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. | getAllItems(): ?bool | setAllItems(?bool allItems): void | ## Example (as JSON) @@ -29,7 +33,19 @@ Describes a subscription plan. For more information, see "amount": 193, "currency": "MOP" }, - "ordinal": 207 + "ordinal": 207, + "pricing": { + "type": "RELATIVE", + "discount_ids": [ + "discount_ids0", + "discount_ids1", + "discount_ids2" + ], + "price_money": { + "amount": 251, + "currency": "SLL" + } + } }, { "uid": "uid6", @@ -39,9 +55,84 @@ Describes a subscription plan. For more information, see "amount": 194, "currency": "MRO" }, - "ordinal": 208 + "ordinal": 208, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids9", + "discount_ids0" + ], + "price_money": { + "amount": 252, + "currency": "SOS" + } + } } - ] + ], + "subscription_plan_variations": [ + { + "type": "MODIFIER_LIST", + "id": "id2", + "updated_at": "updated_at2", + "version": 18, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name7", + "string_value": "string_value1", + "custom_attribute_definition_id": "custom_attribute_definition_id5", + "type": "SELECTION", + "number_value": "number_value7" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "NUMBER", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id6", + "location_id": "location_id6" + } + ] + }, + { + "type": "DISCOUNT", + "id": "id3", + "updated_at": "updated_at1", + "version": 19, + "is_deleted": true, + "custom_attribute_values": { + "key0": { + "name": "name6", + "string_value": "string_value0", + "custom_attribute_definition_id": "custom_attribute_definition_id6", + "type": "STRING", + "number_value": "number_value6" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id7", + "location_id": "location_id7" + }, + { + "catalog_v1_id": "catalog_v1_id8", + "location_id": "location_id8" + } + ] + } + ], + "eligible_item_ids": [ + "eligible_item_ids8" + ], + "eligible_category_ids": [ + "eligible_category_ids7" + ], + "all_items": false } ``` diff --git a/doc/models/checkout-options.md b/doc/models/checkout-options.md index 78f131a5..6b146a1e 100644 --- a/doc/models/checkout-options.md +++ b/doc/models/checkout-options.md @@ -18,6 +18,8 @@ | `acceptedPaymentMethods` | [`?AcceptedPaymentMethods`](../../doc/models/accepted-payment-methods.md) | Optional | - | getAcceptedPaymentMethods(): ?AcceptedPaymentMethods | setAcceptedPaymentMethods(?AcceptedPaymentMethods acceptedPaymentMethods): void | | `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. | getAppFeeMoney(): ?Money | setAppFeeMoney(?Money appFeeMoney): void | | `shippingFee` | [`?ShippingFee`](../../doc/models/shipping-fee.md) | Optional | - | getShippingFee(): ?ShippingFee | setShippingFee(?ShippingFee shippingFee): void | +| `enableCoupon` | `?bool` | Optional | Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form. | getEnableCoupon(): ?bool | setEnableCoupon(?bool enableCoupon): void | +| `enableLoyalty` | `?bool` | Optional | Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both. | getEnableLoyalty(): ?bool | setEnableLoyalty(?bool enableLoyalty): void | ## Example (as JSON) diff --git a/doc/models/collected-data.md b/doc/models/collected-data.md new file mode 100644 index 00000000..0951820c --- /dev/null +++ b/doc/models/collected-data.md @@ -0,0 +1,21 @@ + +# Collected Data + +## Structure + +`CollectedData` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `inputText` | `?string` | Optional | The buyer's input text. | getInputText(): ?string | setInputText(?string inputText): void | + +## Example (as JSON) + +```json +{ + "input_text": "input_text8" +} +``` + diff --git a/doc/models/confirmation-decision.md b/doc/models/confirmation-decision.md new file mode 100644 index 00000000..f3038a99 --- /dev/null +++ b/doc/models/confirmation-decision.md @@ -0,0 +1,21 @@ + +# Confirmation Decision + +## Structure + +`ConfirmationDecision` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `hasAgreed` | `?bool` | Optional | The buyer's decision to the displayed terms. | getHasAgreed(): ?bool | setHasAgreed(?bool hasAgreed): void | + +## Example (as JSON) + +```json +{ + "has_agreed": false +} +``` + diff --git a/doc/models/confirmation-options.md b/doc/models/confirmation-options.md new file mode 100644 index 00000000..6167599a --- /dev/null +++ b/doc/models/confirmation-options.md @@ -0,0 +1,31 @@ + +# Confirmation Options + +## Structure + +`ConfirmationOptions` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the confirmation screen flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | +| `body` | `string` | Required | The agreement details to display in the confirmation flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | +| `agreeButtonText` | `string` | Required | The button text to display indicating the customer agrees to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getAgreeButtonText(): string | setAgreeButtonText(string agreeButtonText): void | +| `disagreeButtonText` | `?string` | Optional | The button text to display indicating the customer does not agree to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getDisagreeButtonText(): ?string | setDisagreeButtonText(?string disagreeButtonText): void | +| `decision` | [`?ConfirmationDecision`](../../doc/models/confirmation-decision.md) | Optional | - | getDecision(): ?ConfirmationDecision | setDecision(?ConfirmationDecision decision): void | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body6", + "agree_button_text": "agree_button_text4", + "disagree_button_text": "disagree_button_text4", + "decision": { + "has_agreed": false + } +} +``` + diff --git a/doc/models/create-mobile-authorization-code-response.md b/doc/models/create-mobile-authorization-code-response.md index 71493089..ac450b2f 100644 --- a/doc/models/create-mobile-authorization-code-response.md +++ b/doc/models/create-mobile-authorization-code-response.md @@ -14,7 +14,7 @@ a request to the `CreateMobileAuthorizationCode` endpoint. | --- | --- | --- | --- | --- | --- | | `authorizationCode` | `?string` | Optional | The generated authorization code that connects a mobile application instance
to a Square account.
**Constraints**: *Maximum Length*: `191` | getAuthorizationCode(): ?string | setAuthorizationCode(?string authorizationCode): void | | `expiresAt` | `?string` | Optional | The timestamp when `authorization_code` expires, in
[RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z").
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | -| `error` | [`?Error`](../../doc/models/error.md) | Optional | Represents an error encountered during a request to the Connect API.

See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. | getError(): ?Error | setError(?Error error): void | +| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | ## Example (as JSON) @@ -22,12 +22,26 @@ a request to the `CreateMobileAuthorizationCode` endpoint. { "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", "expires_at": "2019-01-10T19:42:08Z", - "error": { - "category": "API_ERROR", - "code": "ADDRESS_VERIFICATION_FAILURE", - "detail": "detail0", - "field": "field8" - } + "errors": [ + { + "category": "AUTHENTICATION_ERROR", + "code": "REFUND_ALREADY_PENDING", + "detail": "detail1", + "field": "field9" + }, + { + "category": "INVALID_REQUEST_ERROR", + "code": "PAYMENT_NOT_REFUNDABLE", + "detail": "detail2", + "field": "field0" + }, + { + "category": "RATE_LIMIT_ERROR", + "code": "REFUND_DECLINED", + "detail": "detail3", + "field": "field1" + } + ] } ``` diff --git a/doc/models/create-payment-link-response.md b/doc/models/create-payment-link-response.md index 4d3ee167..2f3c8466 100644 --- a/doc/models/create-payment-link-response.md +++ b/doc/models/create-payment-link-response.md @@ -128,7 +128,7 @@ ], "subscription_plans": [ { - "type": "TAX", + "type": "PRICING_RULE", "id": "id0", "updated_at": "updated_at6", "version": 172, @@ -165,7 +165,7 @@ ] }, { - "type": "DISCOUNT", + "type": "PRODUCT_SET", "id": "id1", "updated_at": "updated_at7", "version": 173, @@ -201,7 +201,7 @@ ] }, { - "type": "MODIFIER_LIST", + "type": "TIME_PERIOD", "id": "id2", "updated_at": "updated_at8", "version": 174, diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 2df107fe..a79ac8f3 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -12,17 +12,19 @@ Defines input parameters in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `idempotencyKey` | `?string` | Optional | A unique string that identifies this `CreateSubscription` request.
If you do not provide a unique string (or provide an empty string as the value),
the endpoint treats each request as independent.

For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | +| `idempotencyKey` | `?string` | Optional | A unique string that identifies this `CreateSubscription` request.
If you do not provide a unique string (or provide an empty string as the value),
the endpoint treats each request as independent.

For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | getIdempotencyKey(): ?string | setIdempotencyKey(?string idempotencyKey): void | | `locationId` | `string` | Required | The ID of the location the subscription is associated with.
**Constraints**: *Minimum Length*: `1` | getLocationId(): string | setLocationId(string locationId): void | -| `planId` | `string` | Required | The ID of the subscription plan created using the Catalog API.
For more information, see
[Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan) and
[Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough).
**Constraints**: *Minimum Length*: `1` | getPlanId(): string | setPlanId(string planId): void | -| `customerId` | `string` | Required | The ID of the [customer](entity:Customer) subscribing to the subscription plan.
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | +| `planId` | `?string` | Optional | The ID of the [subscription plan](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations) created using the Catalog API.

Deprecated in favour of `plan_variation_id`.

For more information, see
[Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan) and
[Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). | getPlanId(): ?string | setPlanId(?string planId): void | +| `planVariationId` | `?string` | Optional | The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API. | getPlanVariationId(): ?string | setPlanVariationId(?string planVariationId): void | +| `customerId` | `string` | Required | The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.
**Constraints**: *Minimum Length*: `1` | getCustomerId(): string | setCustomerId(string customerId): void | | `startDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date to start the subscription.
If it is unspecified, the subscription starts immediately. | getStartDate(): ?string | setStartDate(?string startDate): void | -| `canceledDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation.

This date overrides the cancellation date set in the plan configuration.
If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops
at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date`
occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription
stops through the end of the last cycle. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | +| `canceledDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation.

This date overrides the cancellation date set in the plan variation configuration.
If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops
at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date`
occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription
stops through the end of the last cycle. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | | `taxPercentage` | `?string` | Optional | The tax to add when billing the subscription.
The percentage is expressed in decimal form, using a `'.'` as the decimal
separator and without a `'%'` sign. For example, a value of 7.5
corresponds to 7.5%.
**Constraints**: *Maximum Length*: `10` | getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void | | `priceOverrideMoney` | [`?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. | getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void | -| `cardId` | `?string` | Optional | The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge.
If it is not specified, the subscriber receives an invoice via email. For an example to
create a customer profile for a subscriber and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). | getCardId(): ?string | setCardId(?string cardId): void | +| `cardId` | `?string` | Optional | The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge.
If it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription. | getCardId(): ?string | setCardId(?string cardId): void | | `timezone` | `?string` | Optional | The timezone that is used in date calculations for the subscription. If unset, defaults to
the location timezone. If a timezone is not configured for the location, defaults to "America/New_York".
Format: the IANA Timezone Database identifier for the location timezone. For
a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | getTimezone(): ?string | setTimezone(?string timezone): void | | `source` | [`?SubscriptionSource`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | getSource(): ?SubscriptionSource | setSource(?SubscriptionSource source): void | +| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | array of phases for this subscription | getPhases(): ?array | setPhases(?array phases): void | ## Example (as JSON) @@ -43,6 +45,7 @@ Defines input parameters in a request to the "start_date": "2021-10-20", "tax_percentage": "5", "timezone": "America/Los_Angeles", + "plan_variation_id": "plan_variation_id4", "canceled_date": "canceled_date6" } ``` diff --git a/doc/models/create-subscription-response.md b/doc/models/create-subscription-response.md index c47528c3..5343b113 100644 --- a/doc/models/create-subscription-response.md +++ b/doc/models/create-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | ## Example (as JSON) @@ -37,7 +37,8 @@ Defines output parameters in a response from the "status": "PENDING", "tax_percentage": "5", "timezone": "America/Los_Angeles", - "version": 1594155459464 + "version": 1594155459464, + "plan_variation_id": "plan_variation_id8" }, "errors": [ { diff --git a/doc/models/create-terminal-checkout-response.md b/doc/models/create-terminal-checkout-response.md index e60b2ab8..5ca70552 100644 --- a/doc/models/create-terminal-checkout-response.md +++ b/doc/models/create-terminal-checkout-response.md @@ -23,7 +23,7 @@ }, "app_id": "APP_ID", "created_at": "2020-04-06T16:39:32.545Z", - "deadline_duration": "PT10M", + "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": false, diff --git a/doc/models/data-collection-options-input-type.md b/doc/models/data-collection-options-input-type.md new file mode 100644 index 00000000..083724f8 --- /dev/null +++ b/doc/models/data-collection-options-input-type.md @@ -0,0 +1,16 @@ + +# Data Collection Options Input Type + +Describes the input type of the data. + +## Enumeration + +`DataCollectionOptionsInputType` + +## Fields + +| Name | Description | +| --- | --- | +| `EMAIL` | This value is used to represent an input text that contains a email validation on the
client. | +| `PHONE_NUMBER` | This value is used to represent an input text that contains a phone number validation on
the client. | + diff --git a/doc/models/data-collection-options.md b/doc/models/data-collection-options.md new file mode 100644 index 00000000..46c7989f --- /dev/null +++ b/doc/models/data-collection-options.md @@ -0,0 +1,29 @@ + +# Data Collection Options + +## Structure + +`DataCollectionOptions` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the data collection flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | +| `body` | `string` | Required | The body text to display under the title in the data collection screen flow on the
Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | +| `inputType` | [`string (DataCollectionOptionsInputType)`](../../doc/models/data-collection-options-input-type.md) | Required | Describes the input type of the data. | getInputType(): string | setInputType(string inputType): void | +| `collectedData` | [`?CollectedData`](../../doc/models/collected-data.md) | Optional | - | getCollectedData(): ?CollectedData | setCollectedData(?CollectedData collectedData): void | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body6", + "input_type": "EMAIL", + "collected_data": { + "input_text": "input_text0" + } +} +``` + diff --git a/doc/models/delete-subscription-action-response.md b/doc/models/delete-subscription-action-response.md index 5e04e63c..cd9f8eba 100644 --- a/doc/models/delete-subscription-action-response.md +++ b/doc/models/delete-subscription-action-response.md @@ -13,7 +13,7 @@ endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | ## Example (as JSON) @@ -40,7 +40,8 @@ endpoint. }, "start_date": "2021-10-20", "status": "ACTIVE", - "timezone": "America/Los_Angeles" + "timezone": "America/Los_Angeles", + "plan_variation_id": "plan_variation_id8" }, "errors": [ { diff --git a/doc/models/dismiss-terminal-action-response.md b/doc/models/dismiss-terminal-action-response.md new file mode 100644 index 00000000..6a2def60 --- /dev/null +++ b/doc/models/dismiss-terminal-action-response.md @@ -0,0 +1,63 @@ + +# Dismiss Terminal Action Response + +## Structure + +`DismissTerminalActionResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | +| `action` | [`?TerminalAction`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | getAction(): ?TerminalAction | setAction(?TerminalAction action): void | + +## Example (as JSON) + +```json +{ + "action": { + "app_id": "APP_ID", + "await_next_action": true, + "await_next_action_duration": "PT5M", + "confirmation_options": { + "agree_button_text": "Agree", + "body": "I agree to receive promotional emails about future events and activities.", + "decision": { + "has_agreed": true + }, + "disagree_button_text": "Decline", + "title": "Marketing communications" + }, + "created_at": "2021-07-28T23:22:07.476Z", + "deadline_duration": "PT5M", + "device_id": "DEVICE_ID", + "id": "termapia:abcdefg1234567", + "status": "COMPLETED", + "type": "CONFIRMATION", + "updated_at": "2021-07-28T23:22:29.511Z", + "cancel_reason": "TIMED_OUT" + }, + "errors": [ + { + "category": "AUTHENTICATION_ERROR", + "code": "REFUND_ALREADY_PENDING", + "detail": "detail1", + "field": "field9" + }, + { + "category": "INVALID_REQUEST_ERROR", + "code": "PAYMENT_NOT_REFUNDABLE", + "detail": "detail2", + "field": "field0" + }, + { + "category": "RATE_LIMIT_ERROR", + "code": "REFUND_DECLINED", + "detail": "detail3", + "field": "field1" + } + ] +} +``` + diff --git a/doc/models/employee-wage.md b/doc/models/employee-wage.md index 1b28f65f..e4e2d1e4 100644 --- a/doc/models/employee-wage.md +++ b/doc/models/employee-wage.md @@ -1,8 +1,7 @@ # Employee Wage -The hourly wage rate that an employee earns on a `Shift` for doing the job -specified by the `title` property of this object. Deprecated at version 2020-08-26. Use `TeamMemberWage` instead. +The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). ## Structure diff --git a/doc/models/get-employee-wage-response.md b/doc/models/get-employee-wage-response.md index f20cb662..8860566c 100644 --- a/doc/models/get-employee-wage-response.md +++ b/doc/models/get-employee-wage-response.md @@ -13,7 +13,7 @@ the request resulted in errors. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `employeeWage` | [`?EmployeeWage`](../../doc/models/employee-wage.md) | Optional | The hourly wage rate that an employee earns on a `Shift` for doing the job
specified by the `title` property of this object. Deprecated at version 2020-08-26. Use `TeamMemberWage` instead. | getEmployeeWage(): ?EmployeeWage | setEmployeeWage(?EmployeeWage employeeWage): void | +| `employeeWage` | [`?EmployeeWage`](../../doc/models/employee-wage.md) | Optional | The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). | getEmployeeWage(): ?EmployeeWage | setEmployeeWage(?EmployeeWage employeeWage): void | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | ## Example (as JSON) diff --git a/doc/models/get-team-member-wage-response.md b/doc/models/get-team-member-wage-response.md index 6f61c022..f9c496b8 100644 --- a/doc/models/get-team-member-wage-response.md +++ b/doc/models/get-team-member-wage-response.md @@ -27,7 +27,8 @@ the request resulted in errors. }, "id": "pXS3qCv7BERPnEGedM4S8mhm", "team_member_id": "33fJchumvVdJwxV0H6L9", - "title": "Manager" + "title": "Manager", + "job_id": "job_id4" }, "errors": [ { diff --git a/doc/models/get-terminal-checkout-response.md b/doc/models/get-terminal-checkout-response.md index dc1e16ef..a97ecf23 100644 --- a/doc/models/get-terminal-checkout-response.md +++ b/doc/models/get-terminal-checkout-response.md @@ -23,7 +23,7 @@ }, "app_id": "APP_ID", "created_at": "2020-04-06T16:39:32.545Z", - "deadline_duration": "PT10M", + "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": false, diff --git a/doc/models/list-payouts-response.md b/doc/models/list-payouts-response.md index 967e7e51..5aeef542 100644 --- a/doc/models/list-payouts-response.md +++ b/doc/models/list-payouts-response.md @@ -33,6 +33,7 @@ The response to retrieve payout records entries. "id": "ccof:ZPp3oedR3AeEUNd3z7", "type": "CARD" }, + "end_to_end_id": "L2100000005", "id": "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", "location_id": "L88917AVBK2S5", "payout_fee": [ @@ -62,6 +63,7 @@ The response to retrieve payout records entries. "id": "bact:ZPp3oedR3AeEUNd3z7", "type": "BANK_ACCOUNT" }, + "end_to_end_id": "L2100000006", "id": "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", "location_id": "L88917AVBK2S5", "status": "PAID", diff --git a/doc/models/list-subscription-events-request.md b/doc/models/list-subscription-events-request.md index 8a5dfbb6..cfe6f3a2 100644 --- a/doc/models/list-subscription-events-request.md +++ b/doc/models/list-subscription-events-request.md @@ -13,7 +13,7 @@ endpoint. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | | `limit` | `?int` | Optional | The upper limit on the number of subscription events to return
in a paged response.
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | ## Example (as JSON) diff --git a/doc/models/list-subscription-events-response.md b/doc/models/list-subscription-events-response.md index 42cc04c1..7b360bdf 100644 --- a/doc/models/list-subscription-events-response.md +++ b/doc/models/list-subscription-events-response.md @@ -14,74 +14,12 @@ Defines output parameters in a response from the | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | | `subscriptionEvents` | [`?(SubscriptionEvent[])`](../../doc/models/subscription-event.md) | Optional | The retrieved subscription events. | getSubscriptionEvents(): ?array | setSubscriptionEvents(?array subscriptionEvents): void | -| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of events.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | When the total number of resulting subscription events exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of events.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) ```json { - "subscription_events": [ - { - "effective_date": "2020-04-24", - "id": "06809161-3867-4598-8269-8aea5be4f9de", - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "START_SUBSCRIPTION", - "info": { - "detail": "detail2", - "code": "CUSTOMER_NO_NAME" - } - }, - { - "effective_date": "2020-05-01", - "id": "f2736603-cd2e-47ec-8675-f815fff54f88", - "info": { - "code": "CUSTOMER_NO_NAME", - "detail": "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record." - }, - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "DEACTIVATE_SUBSCRIPTION" - }, - { - "effective_date": "2022-05-01", - "id": "b426fc85-6859-450b-b0d0-fe3a5d1b565f", - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "RESUME_SUBSCRIPTION", - "info": { - "detail": "detail4", - "code": "LOCATION_NOT_ACTIVE" - } - }, - { - "effective_date": "2022-05-02", - "id": "09f14de1-2f53-4dae-9091-49aa53f83d01", - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "PAUSE_SUBSCRIPTION", - "info": { - "detail": "detail5", - "code": "LOCATION_CANNOT_ACCEPT_PAYMENT" - } - }, - { - "effective_date": "2020-05-02", - "id": "f28a73ac-1a1b-4b0f-8eeb-709a72945776", - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "RESUME_SUBSCRIPTION", - "info": { - "detail": "detail6", - "code": "CUSTOMER_DELETED" - } - }, - { - "effective_date": "2020-05-06", - "id": "a0c08083-5db0-4800-85c7-d398de4fbb6e", - "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", - "subscription_event_type": "STOP_SUBSCRIPTION", - "info": { - "detail": "detail7", - "code": "CUSTOMER_NO_EMAIL" - } - } - ], "errors": [ { "category": "AUTHENTICATION_ERROR", @@ -102,6 +40,62 @@ Defines output parameters in a response from the "field": "field1" } ], + "subscription_events": [ + { + "id": "id6", + "subscription_event_type": "STOP_SUBSCRIPTION", + "effective_date": "effective_date4", + "info": { + "detail": "detail2", + "code": "CUSTOMER_NO_NAME" + }, + "phases": [ + { + "uid": "uid1", + "ordinal": 17, + "order_template_id": "order_template_id3", + "plan_phase_uid": "plan_phase_uid7" + }, + { + "uid": "uid0", + "ordinal": 16, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid9", + "ordinal": 15, + "order_template_id": "order_template_id1", + "plan_phase_uid": "plan_phase_uid5" + } + ], + "plan_variation_id": "plan_variation_id0" + }, + { + "id": "id7", + "subscription_event_type": "PLAN_CHANGE", + "effective_date": "effective_date3", + "info": { + "detail": "detail3", + "code": "USER_PROVIDED" + }, + "phases": [ + { + "uid": "uid2", + "ordinal": 18, + "order_template_id": "order_template_id4", + "plan_phase_uid": "plan_phase_uid8" + }, + { + "uid": "uid1", + "ordinal": 17, + "order_template_id": "order_template_id3", + "plan_phase_uid": "plan_phase_uid7" + } + ], + "plan_variation_id": "plan_variation_id1" + } + ], "cursor": "cursor6" } ``` diff --git a/doc/models/list-team-member-wages-response.md b/doc/models/list-team-member-wages-response.md index ff1df377..515fca98 100644 --- a/doc/models/list-team-member-wages-response.md +++ b/doc/models/list-team-member-wages-response.md @@ -29,7 +29,8 @@ a set of `TeamMemberWage` objects. }, "id": "pXS3qCv7BERPnEGedM4S8mhm", "team_member_id": "33fJchumvVdJwxV0H6L9", - "title": "Manager" + "title": "Manager", + "job_id": "job_id9" }, { "hourly_rate": { @@ -38,7 +39,8 @@ a set of `TeamMemberWage` objects. }, "id": "rZduCkzYDUVL3ovh1sQgbue6", "team_member_id": "33fJchumvVdJwxV0H6L9", - "title": "Cook" + "title": "Cook", + "job_id": "job_id8" }, { "hourly_rate": { @@ -47,7 +49,8 @@ a set of `TeamMemberWage` objects. }, "id": "FxLbs5KpPUHa8wyt5ctjubDX", "team_member_id": "33fJchumvVdJwxV0H6L9", - "title": "Barista" + "title": "Barista", + "job_id": "job_id7" }, { "hourly_rate": { @@ -56,7 +59,8 @@ a set of `TeamMemberWage` objects. }, "id": "vD1wCgijMDR3cX5TPnu7VXto", "team_member_id": "33fJchumvVdJwxV0H6L9", - "title": "Cashier" + "title": "Cashier", + "job_id": "job_id6" } ], "errors": [ diff --git a/doc/models/obtain-token-request.md b/doc/models/obtain-token-request.md index ea9ae69f..1632a2fc 100644 --- a/doc/models/obtain-token-request.md +++ b/doc/models/obtain-token-request.md @@ -9,16 +9,16 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `clientId` | `string` | Required | The Square-issued ID of your application, which is available in the OAuth page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): string | setClientId(string clientId): void | -| `clientSecret` | `?string` | Optional | The Square-issued application secret for your application, which is available in the OAuth page
in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required when you are not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow).
The PKCE flow requires a `code_verifier` instead of a `client_secret`.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getClientSecret(): ?string | setClientSecret(?string clientSecret): void | +| `clientId` | `string` | Required | The Square-issued ID of your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): string | setClientId(string clientId): void | +| `clientSecret` | `?string` | Optional | The Square-issued application secret for your application, which is available on the **OAuth** page
in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required when
you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow).
The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to `authorization_code`.
If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE flow only requires `client_id`, 
`grant_type`, and `refresh_token`.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getClientSecret(): ?string | setClientSecret(?string clientSecret): void | | `code` | `?string` | Optional | The authorization code to exchange.
This code is required if `grant_type` is set to `authorization_code` to indicate that
the application wants to exchange an authorization code for an OAuth access token.
**Constraints**: *Maximum Length*: `191` | getCode(): ?string | setCode(?string code): void | -| `redirectUri` | `?string` | Optional | The redirect URL assigned in the OAuth page for your application in the [Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `2048` | getRedirectUri(): ?string | setRedirectUri(?string redirectUri): void | +| `redirectUri` | `?string` | Optional | The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `2048` | getRedirectUri(): ?string | setRedirectUri(?string redirectUri): void | | `grantType` | `string` | Required | Specifies the method to request an OAuth access token.
Valid values are `authorization_code`, `refresh_token`, and `migration_token`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `20` | getGrantType(): string | setGrantType(string grantType): void | | `refreshToken` | `?string` | Optional | A valid refresh token for generating a new OAuth access token.

A valid refresh token is required if `grant_type` is set to `refresh_token`
to indicate that the application wants a replacement for an expired OAuth access token.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getRefreshToken(): ?string | setRefreshToken(?string refreshToken): void | | `migrationToken` | `?string` | Optional | A legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if `grant_type` is set to
`migration_token` to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getMigrationToken(): ?string | setMigrationToken(?string migrationToken): void | | `scopes` | `?(string[])` | Optional | A JSON list of strings representing the permissions that the application is requesting.
For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`".

The access token returned in the response is granted the permissions
that comprise the intersection between the requested list of permissions and those
that belong to the provided refresh token. | getScopes(): ?array | setScopes(?array scopes): void | | `shortLived` | `?bool` | Optional | A Boolean indicating a request for a short-lived access token.

The short-lived access token returned in the response expires in 24 hours. | getShortLived(): ?bool | setShortLived(?bool shortLived): void | -| `codeVerifier` | `?string` | Optional | Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the
`code_challenge` associated with the `authorization_code`. | getCodeVerifier(): ?string | setCodeVerifier(?string codeVerifier): void | +| `codeVerifier` | `?string` | Optional | Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the
`code_challenge` associated with the `authorization_code`. | getCodeVerifier(): ?string | setCodeVerifier(?string codeVerifier): void | ## Example (as JSON) diff --git a/doc/models/pause-subscription-response.md b/doc/models/pause-subscription-response.md index 5bfd6295..52a4a401 100644 --- a/doc/models/pause-subscription-response.md +++ b/doc/models/pause-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | | `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | The list of a `PAUSE` action and a possible `RESUME` action created by the request. | getActions(): ?array | setActions(?array actions): void | ## Example (as JSON) @@ -25,7 +25,15 @@ Defines output parameters in a response from the "effective_date": "2021-11-17", "id": "99b2439e-63f7-3ad5-95f7-ab2447a80673", "type": "PAUSE", - "new_plan_id": "new_plan_id5" + "phases": [ + { + "uid": "uid6", + "ordinal": 186, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "new_plan_variation_id": "new_plan_variation_id9" } ], "subscription": { @@ -44,6 +52,7 @@ Defines output parameters in a response from the "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1594311617331, + "plan_variation_id": "plan_variation_id8", "start_date": "start_date8" }, "errors": [ diff --git a/doc/models/payment-link-related-resources.md b/doc/models/payment-link-related-resources.md index d4992be4..df75b32c 100644 --- a/doc/models/payment-link-related-resources.md +++ b/doc/models/payment-link-related-resources.md @@ -130,7 +130,7 @@ ], "subscription_plans": [ { - "type": "QUICK_AMOUNTS_SETTINGS", + "type": "ITEM_OPTION_VAL", "id": "id6", "updated_at": "updated_at2", "version": 126, @@ -156,7 +156,7 @@ ] }, { - "type": "CUSTOM_ATTRIBUTE_DEFINITION", + "type": "ITEM_OPTION", "id": "id7", "updated_at": "updated_at3", "version": 127, diff --git a/doc/models/payout.md b/doc/models/payout.md index 28cedbaf..5f418231 100644 --- a/doc/models/payout.md +++ b/doc/models/payout.md @@ -23,6 +23,7 @@ external bank account or to the Square balance. | `type` | [`?string (PayoutType)`](../../doc/models/payout-type.md) | Optional | The type of payout: “BATCH” or “SIMPLE”.
BATCH payouts include a list of payout entries that can be considered settled.
SIMPLE payouts do not have any payout entries associated with them
and will show up as one of the payout entries in a future BATCH payout. | getType(): ?string | setType(?string type): void | | `payoutFee` | [`?(PayoutFee[])`](../../doc/models/payout-fee.md) | Optional | A list of transfer fees and any taxes on the fees assessed by Square for this payout. | getPayoutFee(): ?array | setPayoutFee(?array payoutFee): void | | `arrivalDate` | `?string` | Optional | The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. | getArrivalDate(): ?string | setArrivalDate(?string arrivalDate): void | +| `endToEndId` | `?string` | Optional | A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can use this ID to automate the process of reconciling each payout with the corresponding line item on the bank statement. | getEndToEndId(): ?string | setEndToEndId(?string endToEndId): void | ## Example (as JSON) diff --git a/doc/models/phase-input.md b/doc/models/phase-input.md new file mode 100644 index 00000000..5dd0f102 --- /dev/null +++ b/doc/models/phase-input.md @@ -0,0 +1,25 @@ + +# Phase Input + +Represents the arguments used to construct a new phase. + +## Structure + +`PhaseInput` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ordinal` | `int` | Required | index of phase in total subscription plan | getOrdinal(): int | setOrdinal(int ordinal): void | +| `orderTemplateId` | `?string` | Optional | id of order to be used in billing | getOrderTemplateId(): ?string | setOrderTemplateId(?string orderTemplateId): void | + +## Example (as JSON) + +```json +{ + "ordinal": 80, + "order_template_id": "order_template_id2" +} +``` + diff --git a/doc/models/phase.md b/doc/models/phase.md new file mode 100644 index 00000000..535cd480 --- /dev/null +++ b/doc/models/phase.md @@ -0,0 +1,29 @@ + +# Phase + +Represents a phase, which can override subscription phases as defined by plan_id + +## Structure + +`Phase` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `uid` | `?string` | Optional | id of subscription phase | getUid(): ?string | setUid(?string uid): void | +| `ordinal` | `?int` | Optional | index of phase in total subscription plan | getOrdinal(): ?int | setOrdinal(?int ordinal): void | +| `orderTemplateId` | `?string` | Optional | id of order to be used in billing | getOrderTemplateId(): ?string | setOrderTemplateId(?string orderTemplateId): void | +| `planPhaseUid` | `?string` | Optional | the uid from the plan's phase in catalog | getPlanPhaseUid(): ?string | setPlanPhaseUid(?string planPhaseUid): void | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "ordinal": 80, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" +} +``` + diff --git a/doc/models/qr-code-options.md b/doc/models/qr-code-options.md new file mode 100644 index 00000000..c04c421e --- /dev/null +++ b/doc/models/qr-code-options.md @@ -0,0 +1,27 @@ + +# Qr Code Options + +Fields to describe the action that displays QR-Codes. + +## Structure + +`QrCodeOptions` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | +| `body` | `string` | Required | The body text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | +| `barcodeContents` | `string` | Required | The text representation of the data to show in the QR code
as UTF8-encoded data.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1024` | getBarcodeContents(): string | setBarcodeContents(string barcodeContents): void | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body6", + "barcode_contents": "barcode_contents8" +} +``` + diff --git a/doc/models/resume-subscription-response.md b/doc/models/resume-subscription-response.md index afb08af9..d53ee990 100644 --- a/doc/models/resume-subscription-response.md +++ b/doc/models/resume-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | | `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of `RESUME` actions created by the request and scheduled for the subscription. | getActions(): ?array | setActions(?array actions): void | ## Example (as JSON) @@ -25,7 +25,15 @@ Defines output parameters in a response from the "effective_date": "2022-01-01", "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", "type": "RESUME", - "new_plan_id": "new_plan_id5" + "phases": [ + { + "uid": "uid6", + "ordinal": 186, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "new_plan_variation_id": "new_plan_variation_id9" } ], "subscription": { @@ -44,6 +52,7 @@ Defines output parameters in a response from the "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1594311617331, + "plan_variation_id": "plan_variation_id8", "start_date": "start_date8" }, "errors": [ diff --git a/doc/models/retrieve-subscription-response.md b/doc/models/retrieve-subscription-response.md index 145ff62e..6c9daf7e 100644 --- a/doc/models/retrieve-subscription-response.md +++ b/doc/models/retrieve-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | ## Example (as JSON) @@ -40,7 +40,8 @@ Defines output parameters in a response from the }, "start_date": "2021-10-20", "status": "ACTIVE", - "timezone": "America/Los_Angeles" + "timezone": "America/Los_Angeles", + "plan_variation_id": "plan_variation_id8" }, "errors": [ { diff --git a/doc/models/retrieve-token-status-response.md b/doc/models/retrieve-token-status-response.md index e45380ab..233625e1 100644 --- a/doc/models/retrieve-token-status-response.md +++ b/doc/models/retrieve-token-status-response.md @@ -2,7 +2,7 @@ # Retrieve Token Status Response Defines the fields that are included in the response body of -a request to the `RetrieveTokenStatus` endpoint +a request to the `RetrieveTokenStatus` endpoint. ## Structure @@ -13,7 +13,7 @@ a request to the `RetrieveTokenStatus` endpoint | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `scopes` | `?(string[])` | Optional | The list of scopes associated with an access token. | getScopes(): ?array | setScopes(?array scopes): void | -| `expiresAt` | `?string` | Optional | The date and time when the `access_token` expires, in RFC 3339 format. Empty if token never expires. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | +| `expiresAt` | `?string` | Optional | The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires. | getExpiresAt(): ?string | setExpiresAt(?string expiresAt): void | | `clientId` | `?string` | Optional | The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | | `merchantId` | `?string` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | getMerchantId(): ?string | setMerchantId(?string merchantId): void | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | getErrors(): ?array | setErrors(?array errors): void | diff --git a/doc/models/revoke-token-request.md b/doc/models/revoke-token-request.md index db56bed3..66a81f88 100644 --- a/doc/models/revoke-token-request.md +++ b/doc/models/revoke-token-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `clientId` | `?string` | Optional | The Square-issued ID for your application, which is available in the OAuth page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | +| `clientId` | `?string` | Optional | The Square-issued ID for your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | getClientId(): ?string | setClientId(?string clientId): void | | `accessToken` | `?string` | Optional | The access token of the merchant whose token you want to revoke.
Do not provide a value for `merchant_id` if you provide this parameter.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | getAccessToken(): ?string | setAccessToken(?string accessToken): void | | `merchantId` | `?string` | Optional | The ID of the merchant whose token you want to revoke.
Do not provide a value for `access_token` if you provide this parameter. | getMerchantId(): ?string | setMerchantId(?string merchantId): void | | `revokeOnlyAccessToken` | `?bool` | Optional | If `true`, terminate the given single access token, but do not
terminate the entire authorization.
Default: `false` | getRevokeOnlyAccessToken(): ?bool | setRevokeOnlyAccessToken(?bool revokeOnlyAccessToken): void | diff --git a/doc/models/search-catalog-items-response.md b/doc/models/search-catalog-items-response.md index f1438782..b9046a10 100644 --- a/doc/models/search-catalog-items-response.md +++ b/doc/models/search-catalog-items-response.md @@ -42,7 +42,7 @@ Defines the response body returned from the [SearchCatalogItems](../../doc/apis/ ], "items": [ { - "type": "PRODUCT_SET", + "type": "DISCOUNT", "id": "id7", "updated_at": "updated_at7", "version": 143, @@ -68,7 +68,7 @@ Defines the response body returned from the [SearchCatalogItems](../../doc/apis/ ] }, { - "type": "PRICING_RULE", + "type": "TAX", "id": "id8", "updated_at": "updated_at6", "version": 144, diff --git a/doc/models/search-catalog-objects-response.md b/doc/models/search-catalog-objects-response.md index 41e005bd..bfdfc96c 100644 --- a/doc/models/search-catalog-objects-response.md +++ b/doc/models/search-catalog-objects-response.md @@ -179,7 +179,7 @@ "cursor": "cursor6", "related_objects": [ { - "type": "CATEGORY", + "type": "PRICING_RULE", "id": "id8", "updated_at": "updated_at6", "version": 170, @@ -205,7 +205,7 @@ ] }, { - "type": "IMAGE", + "type": "MODIFIER", "id": "id9", "updated_at": "updated_at5", "version": 169, @@ -249,7 +249,7 @@ ] }, { - "type": "ITEM", + "type": "MODIFIER_LIST", "id": "id0", "updated_at": "updated_at4", "version": 168, diff --git a/doc/models/search-subscriptions-request.md b/doc/models/search-subscriptions-request.md index 9bd4c3c1..9191e6fb 100644 --- a/doc/models/search-subscriptions-request.md +++ b/doc/models/search-subscriptions-request.md @@ -12,7 +12,7 @@ Defines input parameters in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `cursor` | `?string` | Optional | When the total number of resulting subscriptions exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | When the total number of resulting subscriptions exceeds the limit of a paged response,
specify the cursor returned from a preceding response here to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | | `limit` | `?int` | Optional | The upper limit on the number of subscriptions to return
in a paged response.
**Constraints**: `>= 1` | getLimit(): ?int | setLimit(?int limit): void | | `query` | [`?SearchSubscriptionsQuery`](../../doc/models/search-subscriptions-query.md) | Optional | Represents a query, consisting of specified query expressions, used to search for subscriptions. | getQuery(): ?SearchSubscriptionsQuery | setQuery(?SearchSubscriptionsQuery query): void | | `include` | `?(string[])` | Optional | An option to include related information in the response.

The supported values are:

- `actions`: to include scheduled actions on the targeted subscriptions. | getInclude(): ?array | setInclude(?array include): void | diff --git a/doc/models/search-subscriptions-response.md b/doc/models/search-subscriptions-response.md index 6565029e..0f315f31 100644 --- a/doc/models/search-subscriptions-response.md +++ b/doc/models/search-subscriptions-response.md @@ -14,7 +14,7 @@ Defines output parameters in a response from the | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | | `subscriptions` | [`?(Subscription[])`](../../doc/models/subscription.md) | Optional | The subscriptions matching the specified query expressions. | getSubscriptions(): ?array | setSubscriptions(?array subscriptions): void | -| `cursor` | `?string` | Optional | When the total number of resulting subscription exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | getCursor(): ?string | setCursor(?string cursor): void | +| `cursor` | `?string` | Optional | When the total number of resulting subscription exceeds the limit of a paged response,
the response includes a cursor for you to use in a subsequent request to fetch the next set of results.
If the cursor is unset, the response contains the last page of the results.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). | getCursor(): ?string | setCursor(?string cursor): void | ## Example (as JSON) @@ -36,7 +36,8 @@ Defines output parameters in a response from the }, "start_date": "2021-10-20", "status": "CANCELED", - "timezone": "UTC" + "timezone": "UTC", + "plan_variation_id": "plan_variation_id3" }, { "created_at": "2021-10-20T21:53:10Z", @@ -55,7 +56,8 @@ Defines output parameters in a response from the "status": "PENDING", "tax_percentage": "5", "timezone": "America/Los_Angeles", - "version": 1594155459464 + "version": 1594155459464, + "plan_variation_id": "plan_variation_id4" }, { "charged_through_date": "2021-11-20", @@ -78,7 +80,8 @@ Defines output parameters in a response from the }, "start_date": "2021-10-20", "status": "ACTIVE", - "timezone": "America/Los_Angeles" + "timezone": "America/Los_Angeles", + "plan_variation_id": "plan_variation_id5" } ], "errors": [ diff --git a/doc/models/search-terminal-actions-request.md b/doc/models/search-terminal-actions-request.md index 26f21507..6dc1b471 100644 --- a/doc/models/search-terminal-actions-request.md +++ b/doc/models/search-terminal-actions-request.md @@ -26,7 +26,7 @@ }, "device_id": "device_id0", "status": "status4", - "type": "SAVE_CARD" + "type": "QR_CODE" }, "sort": { "sort_order": "DESC" diff --git a/doc/models/search-terminal-checkouts-response.md b/doc/models/search-terminal-checkouts-response.md index d05a3358..6b5c7e87 100644 --- a/doc/models/search-terminal-checkouts-response.md +++ b/doc/models/search-terminal-checkouts-response.md @@ -25,7 +25,7 @@ }, "app_id": "APP_ID", "created_at": "2020-03-31T18:13:15.921Z", - "deadline_duration": "PT10M", + "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": false, @@ -66,7 +66,7 @@ }, "app_id": "APP_ID", "created_at": "2020-03-31T18:08:31.882Z", - "deadline_duration": "PT10M", + "deadline_duration": "PT5M", "device_options": { "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", "skip_receipt_screen": true, diff --git a/doc/models/select-option.md b/doc/models/select-option.md new file mode 100644 index 00000000..075964ed --- /dev/null +++ b/doc/models/select-option.md @@ -0,0 +1,23 @@ + +# Select Option + +## Structure + +`SelectOption` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `referenceId` | `string` | Required | The reference id for the option.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | getReferenceId(): string | setReferenceId(string referenceId): void | +| `title` | `string` | Required | The title text that displays in the select option button.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | + +## Example (as JSON) + +```json +{ + "reference_id": "reference_id2", + "title": "title4" +} +``` + diff --git a/doc/models/select-options.md b/doc/models/select-options.md new file mode 100644 index 00000000..69138878 --- /dev/null +++ b/doc/models/select-options.md @@ -0,0 +1,35 @@ + +# Select Options + +## Structure + +`SelectOptions` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | +| `body` | `string` | Required | The body text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | +| `options` | [`SelectOption[]`](../../doc/models/select-option.md) | Required | Represents the buttons/options that should be displayed in the select flow on the Terminal. | getOptions(): array | setOptions(array options): void | +| `selectedOption` | [`?SelectOption`](../../doc/models/select-option.md) | Optional | - | getSelectedOption(): ?SelectOption | setSelectedOption(?SelectOption selectedOption): void | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body6", + "options": [ + { + "reference_id": "reference_id1", + "title": "title3" + } + ], + "selected_option": { + "reference_id": "reference_id6", + "title": "title8" + } +} +``` + diff --git a/doc/models/shift-wage.md b/doc/models/shift-wage.md index 7ef425ae..11d31653 100644 --- a/doc/models/shift-wage.md +++ b/doc/models/shift-wage.md @@ -11,8 +11,9 @@ The hourly wage rate used to compensate an employee for this shift. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `title` | `?string` | Optional | The name of the job performed during this shift. Square
labor-reporting UIs might group shifts together by title. | getTitle(): ?string | setTitle(?string title): void | +| `title` | `?string` | Optional | The name of the job performed during this shift. | getTitle(): ?string | setTitle(?string title): void | | `hourlyRate` | [`?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. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | +| `jobId` | `?string` | Optional | The id of the job performed during this shift. Square
labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void | ## Example (as JSON) @@ -22,7 +23,8 @@ The hourly wage rate used to compensate an employee for this shift. "hourly_rate": { "amount": 172, "currency": "TJS" - } + }, + "job_id": "job_id2" } ``` diff --git a/doc/models/signature-image.md b/doc/models/signature-image.md new file mode 100644 index 00000000..b8a52755 --- /dev/null +++ b/doc/models/signature-image.md @@ -0,0 +1,23 @@ + +# Signature Image + +## Structure + +`SignatureImage` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `imageType` | `?string` | Optional | The mime/type of the image data.
Use `image/png;base64` for png. | getImageType(): ?string | setImageType(?string imageType): void | +| `data` | `?string` | Optional | The base64 representation of the image. | getData(): ?string | setData(?string data): void | + +## Example (as JSON) + +```json +{ + "image_type": "image_type6", + "data": "data0" +} +``` + diff --git a/doc/models/signature-options.md b/doc/models/signature-options.md new file mode 100644 index 00000000..825ac72e --- /dev/null +++ b/doc/models/signature-options.md @@ -0,0 +1,30 @@ + +# Signature Options + +## Structure + +`SignatureOptions` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | getTitle(): string | setTitle(string title): void | +| `body` | `string` | Required | The body text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | getBody(): string | setBody(string body): void | +| `signature` | [`?(SignatureImage[])`](../../doc/models/signature-image.md) | Optional | An image representation of the collected signature. | getSignature(): ?array | setSignature(?array signature): void | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body6", + "signature": [ + { + "image_type": "image_type8", + "data": "data2" + } + ] +} +``` + diff --git a/doc/models/subscription-action.md b/doc/models/subscription-action.md index 264845e9..d0daa53a 100644 --- a/doc/models/subscription-action.md +++ b/doc/models/subscription-action.md @@ -14,7 +14,8 @@ Represents an action as a pending change to a subscription. | `id` | `?string` | Optional | The ID of an action scoped to a subscription. | getId(): ?string | setId(?string id): void | | `type` | [`?string (SubscriptionActionType)`](../../doc/models/subscription-action-type.md) | Optional | Supported types of an action as a pending change to a subscription. | getType(): ?string | setType(?string type): void | | `effectiveDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. | getEffectiveDate(): ?string | setEffectiveDate(?string effectiveDate): void | -| `newPlanId` | `?string` | Optional | The target subscription plan a subscription switches to, for a `SWAP_PLAN` action. | getNewPlanId(): ?string | setNewPlanId(?string newPlanId): void | +| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | +| `newPlanVariationId` | `?string` | Optional | The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. | getNewPlanVariationId(): ?string | setNewPlanVariationId(?string newPlanVariationId): void | ## Example (as JSON) @@ -23,7 +24,21 @@ Represents an action as a pending change to a subscription. "id": "id0", "type": "RESUME", "effective_date": "effective_date0", - "new_plan_id": "new_plan_id4" + "phases": [ + { + "uid": "uid5", + "ordinal": 207, + "order_template_id": "order_template_id7", + "plan_phase_uid": "plan_phase_uid1" + }, + { + "uid": "uid6", + "ordinal": 208, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "new_plan_variation_id": "new_plan_variation_id0" } ``` diff --git a/doc/models/subscription-event.md b/doc/models/subscription-event.md index 1cf40c6d..494bb6fe 100644 --- a/doc/models/subscription-event.md +++ b/doc/models/subscription-event.md @@ -14,8 +14,9 @@ Describes changes to a subscription and the subscription status. | `id` | `string` | Required | The ID of the subscription event. | getId(): string | setId(string id): void | | `subscriptionEventType` | [`string (SubscriptionEventSubscriptionEventType)`](../../doc/models/subscription-event-subscription-event-type.md) | Required | Supported types of an event occurred to a subscription. | getSubscriptionEventType(): string | setSubscriptionEventType(string subscriptionEventType): void | | `effectiveDate` | `string` | Required | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. | getEffectiveDate(): string | setEffectiveDate(string effectiveDate): void | -| `planId` | `string` | Required | The ID of the subscription plan associated with the subscription. | getPlanId(): string | setPlanId(string planId): void | | `info` | [`?SubscriptionEventInfo`](../../doc/models/subscription-event-info.md) | Optional | Provides information about the subscription event. | getInfo(): ?SubscriptionEventInfo | setInfo(?SubscriptionEventInfo info): void | +| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | +| `planVariationId` | `string` | Required | The ID of the subscription plan variation associated with the subscription. | getPlanVariationId(): string | setPlanVariationId(string planVariationId): void | ## Example (as JSON) @@ -24,11 +25,25 @@ Describes changes to a subscription and the subscription status. "id": "id0", "subscription_event_type": "RESUME_SUBSCRIPTION", "effective_date": "effective_date0", - "plan_id": "plan_id8", "info": { "detail": "detail6", "code": "CUSTOMER_DELETED" - } + }, + "phases": [ + { + "uid": "uid5", + "ordinal": 207, + "order_template_id": "order_template_id7", + "plan_phase_uid": "plan_phase_uid1" + }, + { + "uid": "uid6", + "ordinal": 208, + "order_template_id": "order_template_id8", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "plan_variation_id": "plan_variation_id4" } ``` diff --git a/doc/models/subscription-phase.md b/doc/models/subscription-phase.md index d28b682d..0d8f4d8b 100644 --- a/doc/models/subscription-phase.md +++ b/doc/models/subscription-phase.md @@ -1,8 +1,7 @@ # Subscription Phase -Describes a phase in a subscription plan. For more information, see -[Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan). +Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). ## Structure @@ -17,6 +16,7 @@ Describes a phase in a subscription plan. For more information, see | `periods` | `?int` | Optional | The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is created. | getPeriods(): ?int | setPeriods(?int periods): void | | `recurringPriceMoney` | [`?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. | getRecurringPriceMoney(): ?Money | setRecurringPriceMoney(?Money recurringPriceMoney): void | | `ordinal` | `?int` | Optional | The position this phase appears in the sequence of phases defined for the plan, indexed from 0. This field cannot be changed after a `SubscriptionPhase` is created. | getOrdinal(): ?int | setOrdinal(?int ordinal): void | +| `pricing` | [`?SubscriptionPricing`](../../doc/models/subscription-pricing.md) | Optional | Describes the pricing for the subscription. | getPricing(): ?SubscriptionPricing | setPricing(?SubscriptionPricing pricing): void | ## Example (as JSON) @@ -29,7 +29,18 @@ Describes a phase in a subscription plan. For more information, see "amount": 66, "currency": "NAD" }, - "ordinal": 80 + "ordinal": 80, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 40, + "currency": "SHP" + } + } } ``` diff --git a/doc/models/subscription-pricing-type.md b/doc/models/subscription-pricing-type.md new file mode 100644 index 00000000..105aa699 --- /dev/null +++ b/doc/models/subscription-pricing-type.md @@ -0,0 +1,16 @@ + +# Subscription Pricing Type + +Determines the pricing of a [Subscription](../../doc/models/subscription.md) + +## Enumeration + +`SubscriptionPricingType` + +## Fields + +| Name | Description | +| --- | --- | +| `STATIC` | Static pricing | +| `RELATIVE` | Relative pricing | + diff --git a/doc/models/subscription-pricing.md b/doc/models/subscription-pricing.md new file mode 100644 index 00000000..eb2ef897 --- /dev/null +++ b/doc/models/subscription-pricing.md @@ -0,0 +1,33 @@ + +# Subscription Pricing + +Describes the pricing for the subscription. + +## Structure + +`SubscriptionPricing` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `type` | [`?string (SubscriptionPricingType)`](../../doc/models/subscription-pricing-type.md) | Optional | Determines the pricing of a [Subscription](../../doc/models/subscription.md) | getType(): ?string | setType(?string type): void | +| `discountIds` | `?(string[])` | Optional | The ids of the discount catalog objects | getDiscountIds(): ?array | setDiscountIds(?array discountIds): void | +| `priceMoney` | [`?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. | getPriceMoney(): ?Money | setPriceMoney(?Money priceMoney): void | + +## Example (as JSON) + +```json +{ + "type": "STATIC", + "discount_ids": [ + "discount_ids1", + "discount_ids2" + ], + "price_money": { + "amount": 202, + "currency": "BBD" + } +} +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index 736b83ad..8625ab2b 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -1,10 +1,10 @@ # Subscription -Represents a subscription to a subscription plan by a subscriber. +Represents a subscription purchased by a customer. -For an overview of the `Subscription` type, see -[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). +For more information, see +[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). ## Structure @@ -16,7 +16,7 @@ For an overview of the `Subscription` type, see | --- | --- | --- | --- | --- | --- | | `id` | `?string` | Optional | The Square-assigned ID of the subscription.
**Constraints**: *Maximum Length*: `255` | getId(): ?string | setId(?string id): void | | `locationId` | `?string` | Optional | The ID of the location associated with the subscription. | getLocationId(): ?string | setLocationId(?string locationId): void | -| `planId` | `?string` | Optional | The ID of the subscribed-to [subscription plan](entity:CatalogSubscriptionPlan). | getPlanId(): ?string | setPlanId(?string planId): void | +| `planVariationId` | `?string` | Optional | The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). | getPlanVariationId(): ?string | setPlanVariationId(?string planVariationId): void | | `customerId` | `?string` | Optional | The ID of the subscribing [customer](entity:Customer) profile. | getCustomerId(): ?string | setCustomerId(?string customerId): void | | `startDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. | getStartDate(): ?string | setStartDate(?string startDate): void | | `canceledDate` | `?string` | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription,
when the subscription status changes to `CANCELED` and the subscription billing stops.

If this field is not set, the subscription ends according its subscription plan.

This field cannot be updated, other than being cleared. | getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void | @@ -31,6 +31,7 @@ For an overview of the `Subscription` type, see | `timezone` | `?string` | Optional | Timezone that will be used in date calculations for the subscription.
Defaults to the timezone of the location based on `location_id`.
Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). | getTimezone(): ?string | setTimezone(?string timezone): void | | `source` | [`?SubscriptionSource`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | getSource(): ?SubscriptionSource | setSource(?SubscriptionSource source): void | | `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | The list of scheduled actions on this subscription. It is set only in the response from
[RetrieveSubscription](../../doc/apis/subscriptions.md#retrieve-subscription) with the query parameter
of `include=actions` or from
[SearchSubscriptions](../../doc/apis/subscriptions.md#search-subscriptions) with the input parameter
of `include:["actions"]`. | getActions(): ?array | setActions(?array actions): void | +| `phases` | [`?(Phase[])`](../../doc/models/phase.md) | Optional | array of phases for this subscription | getPhases(): ?array | setPhases(?array phases): void | ## Example (as JSON) @@ -38,7 +39,7 @@ For an overview of the `Subscription` type, see { "id": "id0", "location_id": "location_id4", - "plan_id": "plan_id8", + "plan_variation_id": "plan_variation_id4", "customer_id": "customer_id8", "start_date": "start_date6" } diff --git a/doc/models/swap-plan-request.md b/doc/models/swap-plan-request.md index 1b8d534a..d454dfed 100644 --- a/doc/models/swap-plan-request.md +++ b/doc/models/swap-plan-request.md @@ -12,13 +12,24 @@ Defines input parameters in a call to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `newPlanId` | `string` | Required | The ID of the new subscription plan.
**Constraints**: *Minimum Length*: `1` | getNewPlanId(): string | setNewPlanId(string newPlanId): void | +| `newPlanVariationId` | `?string` | Optional | The ID of the new subscription plan variation.

This field is required. | getNewPlanVariationId(): ?string | setNewPlanVariationId(?string newPlanVariationId): void | +| `phases` | [`?(PhaseInput[])`](../../doc/models/phase-input.md) | Optional | A list of PhaseInputs, to pass phase-specific information used in the swap. | getPhases(): ?array | setPhases(?array phases): void | ## Example (as JSON) ```json { - "new_plan_id": "new_plan_id4" + "new_plan_variation_id": "new_plan_variation_id0", + "phases": [ + { + "ordinal": 207, + "order_template_id": "order_template_id7" + }, + { + "ordinal": 208, + "order_template_id": "order_template_id8" + } + ] } ``` diff --git a/doc/models/swap-plan-response.md b/doc/models/swap-plan-response.md index ace5cd77..087a9330 100644 --- a/doc/models/swap-plan-response.md +++ b/doc/models/swap-plan-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response of the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | | `actions` | [`?(SubscriptionAction[])`](../../doc/models/subscription-action.md) | Optional | A list of a `SWAP_PLAN` action created by the request. | getActions(): ?array | setActions(?array actions): void | ## Example (as JSON) @@ -24,8 +24,17 @@ Defines output parameters in a response of the { "effective_date": "2021-11-17", "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", - "new_plan_id": "DPNEOJAP33DKC3GAC5CAZG4O", - "type": "SWAP_PLAN" + "new_plan_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0, + "uid": "uid6", + "plan_phase_uid": "plan_phase_uid2" + } + ], + "type": "SWAP_PLAN", + "new_plan_variation_id": "new_plan_variation_id9" } ], "subscription": { @@ -33,6 +42,14 @@ Defines output parameters in a response of the "customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G", "id": "9ba40961-995a-4a3d-8c53-048c40cafc13", "location_id": "S8GWD5R9QB376", + "phases": [ + { + "order_template_id": "E6oBY5WfQ2eN4pkYZwq4ka6n7KeZY", + "ordinal": 0, + "plan_phase_uid": "C66BKH3ASTDYGJJCEZXQQSS7", + "uid": "98d6f53b-40e1-4714-8827-032fd923be25" + } + ], "plan_id": "6JHXF3B2CW3YKHDV4XEM674H", "price_override_money": { "amount": 2000, @@ -44,6 +61,7 @@ Defines output parameters in a response of the "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1594311617331, + "plan_variation_id": "plan_variation_id8", "start_date": "start_date8" }, "errors": [ diff --git a/doc/models/team-member-wage.md b/doc/models/team-member-wage.md index 18f16e00..24ac8eff 100644 --- a/doc/models/team-member-wage.md +++ b/doc/models/team-member-wage.md @@ -16,6 +16,7 @@ specified by the `title` property of this object. | `teamMemberId` | `?string` | Optional | The `TeamMember` that this wage is assigned to. | getTeamMemberId(): ?string | setTeamMemberId(?string teamMemberId): void | | `title` | `?string` | Optional | The job title that this wage relates to. | getTitle(): ?string | setTitle(?string title): void | | `hourlyRate` | [`?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. | getHourlyRate(): ?Money | setHourlyRate(?Money hourlyRate): void | +| `jobId` | `?string` | Optional | An identifier for the job that this wage relates to. This cannot be
used to retrieve the job. | getJobId(): ?string | setJobId(?string jobId): void | ## Example (as JSON) @@ -27,7 +28,8 @@ specified by the `title` property of this object. "hourly_rate": { "amount": 172, "currency": "TJS" - } + }, + "job_id": "job_id2" } ``` diff --git a/doc/models/terminal-action-action-type.md b/doc/models/terminal-action-action-type.md index a0f00628..09d26ffd 100644 --- a/doc/models/terminal-action-action-type.md +++ b/doc/models/terminal-action-action-type.md @@ -11,7 +11,12 @@ Describes the type of this unit and indicates which field contains the unit info | Name | Description | | --- | --- | +| `QR_CODE` | The action represents a request to display a QR code. Details are contained in
the `qr_code_options` object. | | `PING` | The action represents a request to check if the specific device is
online or currently active with the merchant in question. Does not require an action options value. | | `SAVE_CARD` | Represents a request to save a card for future card-on-file use. Details are contained
in the `save_card_options` object. | +| `SIGNATURE` | The action represents a request to capture a buyer's signature. Details are contained
in the `signature_options` object. | +| `CONFIRMATION` | The action represents a request to collect a buyer's confirmation decision to the
displayed terms. Details are contained in the `confirmation_options` object. | | `RECEIPT` | The action represents a request to display the receipt screen options. Details are
contained in the `receipt_options` object. | +| `DATA_COLLECTION` | The action represents a request to collect a buyer's text data. Details
are contained in the `data_collection_options` object. | +| `SELECT` | The action represents a request to allow the buyer to select from provided options.
Details are contained in the `select_options` object. | diff --git a/doc/models/terminal-action-query-filter.md b/doc/models/terminal-action-query-filter.md index a7d6a513..5429d322 100644 --- a/doc/models/terminal-action-query-filter.md +++ b/doc/models/terminal-action-query-filter.md @@ -24,7 +24,7 @@ "end_at": "end_at8" }, "status": "status8", - "type": "RECEIPT" + "type": "DATA_COLLECTION" } ``` diff --git a/doc/models/terminal-action-query.md b/doc/models/terminal-action-query.md index 1ddeddb4..01daa11a 100644 --- a/doc/models/terminal-action-query.md +++ b/doc/models/terminal-action-query.md @@ -32,7 +32,7 @@ "end_at": "end_at8" }, "status": "status6", - "type": "RECEIPT" + "type": "SAVE_CARD" }, "sort": { "sort_order": "DESC" diff --git a/doc/models/terminal-action.md b/doc/models/terminal-action.md index 16da0f66..869f11e6 100644 --- a/doc/models/terminal-action.md +++ b/doc/models/terminal-action.md @@ -20,9 +20,16 @@ Represents an action processed by the Square Terminal. | `updatedAt` | `?string` | Optional | The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. | getUpdatedAt(): ?string | setUpdatedAt(?string updatedAt): void | | `appId` | `?string` | Optional | The ID of the application that created the action. | getAppId(): ?string | setAppId(?string appId): void | | `type` | [`?string (TerminalActionActionType)`](../../doc/models/terminal-action-action-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | getType(): ?string | setType(?string type): void | +| `qrCodeOptions` | [`?QrCodeOptions`](../../doc/models/qr-code-options.md) | Optional | Fields to describe the action that displays QR-Codes. | getQrCodeOptions(): ?QrCodeOptions | setQrCodeOptions(?QrCodeOptions qrCodeOptions): void | | `saveCardOptions` | [`?SaveCardOptions`](../../doc/models/save-card-options.md) | Optional | Describes save-card action fields. | getSaveCardOptions(): ?SaveCardOptions | setSaveCardOptions(?SaveCardOptions saveCardOptions): void | +| `signatureOptions` | [`?SignatureOptions`](../../doc/models/signature-options.md) | Optional | - | getSignatureOptions(): ?SignatureOptions | setSignatureOptions(?SignatureOptions signatureOptions): void | +| `confirmationOptions` | [`?ConfirmationOptions`](../../doc/models/confirmation-options.md) | Optional | - | getConfirmationOptions(): ?ConfirmationOptions | setConfirmationOptions(?ConfirmationOptions confirmationOptions): void | | `receiptOptions` | [`?ReceiptOptions`](../../doc/models/receipt-options.md) | Optional | Describes receipt action fields. | getReceiptOptions(): ?ReceiptOptions | setReceiptOptions(?ReceiptOptions receiptOptions): void | +| `dataCollectionOptions` | [`?DataCollectionOptions`](../../doc/models/data-collection-options.md) | Optional | - | getDataCollectionOptions(): ?DataCollectionOptions | setDataCollectionOptions(?DataCollectionOptions dataCollectionOptions): void | +| `selectOptions` | [`?SelectOptions`](../../doc/models/select-options.md) | Optional | - | getSelectOptions(): ?SelectOptions | setSelectOptions(?SelectOptions selectOptions): void | | `deviceMetadata` | [`?DeviceMetadata`](../../doc/models/device-metadata.md) | Optional | - | getDeviceMetadata(): ?DeviceMetadata | setDeviceMetadata(?DeviceMetadata deviceMetadata): void | +| `awaitNextAction` | `?bool` | Optional | Indicates the action will be linked to another action and requires a waiting dialog to be
displayed instead of returning to the idle screen on completion of the action.

Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. | getAwaitNextAction(): ?bool | setAwaitNextAction(?bool awaitNextAction): void | +| `awaitNextActionDuration` | `?string` | Optional | The timeout duration of the waiting dialog as an RFC 3339 duration, after which the
waiting dialog will no longer be displayed and the Terminal will return to the idle screen.

Default: 5 minutes from when the waiting dialog is displayed

Maximum: 5 minutes | getAwaitNextActionDuration(): ?string | setAwaitNextActionDuration(?string awaitNextActionDuration): void | ## Example (as JSON) diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index 7a829975..5cdc8970 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -12,7 +12,7 @@ Defines input parameters in a request to the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | ## Example (as JSON) @@ -27,7 +27,7 @@ Defines input parameters in a request to the "version": 1594155459464, "id": "id4", "location_id": "location_id8", - "plan_id": "plan_id6", + "plan_variation_id": "plan_variation_id8", "customer_id": "customer_id2", "start_date": "start_date8" } diff --git a/doc/models/update-subscription-response.md b/doc/models/update-subscription-response.md index 8e057515..1bd7b8c8 100644 --- a/doc/models/update-subscription-response.md +++ b/doc/models/update-subscription-response.md @@ -13,7 +13,7 @@ Defines output parameters in a response from the | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `errors` | [`?(Error[])`](../../doc/models/error.md) | Optional | Errors encountered during the request. | getErrors(): ?array | setErrors(?array errors): void | -| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription to a subscription plan by a subscriber.

For an overview of the `Subscription` type, see
[Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription-object-overview). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | +| `subscription` | [`?Subscription`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | getSubscription(): ?Subscription | setSubscription(?Subscription subscription): void | ## Example (as JSON) @@ -35,6 +35,7 @@ Defines output parameters in a response from the "status": "ACTIVE", "timezone": "America/Los_Angeles", "version": 1594311617331, + "plan_variation_id": "plan_variation_id8", "start_date": "start_date8" }, "errors": [ diff --git a/src/Apis/OAuthApi.php b/src/Apis/OAuthApi.php index 6de75621..07ae1f0d 100644 --- a/src/Apis/OAuthApi.php +++ b/src/Apis/OAuthApi.php @@ -38,12 +38,12 @@ class OAuthApi extends BaseApi * Authorization: Client APPLICATION_SECRET * ``` * - * Replace `APPLICATION_SECRET` with the application secret on the Credentials + * Replace `APPLICATION_SECRET` with the application secret on the **Credentials** * page in the [Developer Dashboard](https://developer.squareup.com/apps). * * @deprecated * - * @param string $clientId Your application ID, which is available in the OAuth page in the + * @param string $clientId Your application ID, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). * @param RenewTokenRequest $body An object containing the fields to POST for the request. See * the corresponding object definition for field details. @@ -83,8 +83,8 @@ public function renewToken(string $clientId, RenewTokenRequest $body, string $au * Authorization: Client APPLICATION_SECRET * ``` * - * Replace `APPLICATION_SECRET` with the application secret on the OAuth - * page for your application on the Developer Dashboard. + * Replace `APPLICATION_SECRET` with the application secret on the **OAuth** + * page for your application in the Developer Dashboard. * * @param RevokeTokenRequest $body An object containing the fields to POST for the request. See * the corresponding object definition for field details. @@ -114,7 +114,7 @@ public function revokeToken(RevokeTokenRequest $body, string $authorization): Ap * The `grant_type` parameter specifies the type of OAuth request. If * `grant_type` is `authorization_code`, you must include the authorization * code you received when a seller granted you authorization. If `grant_type` - * is `refresh_token`, you must provide a valid refresh token. If you are using + * is `refresh_token`, you must provide a valid refresh token. If you're using * an old version of the Square APIs (prior to March 13, 2019), `grant_type` * can be `migration_token` and you must provide a valid migration token. * diff --git a/src/Apis/SubscriptionsApi.php b/src/Apis/SubscriptionsApi.php index bb63714a..f7736838 100644 --- a/src/Apis/SubscriptionsApi.php +++ b/src/Apis/SubscriptionsApi.php @@ -30,13 +30,16 @@ class SubscriptionsApi extends BaseApi { /** - * Creates a subscription to a subscription plan by a customer. + * Enrolls a customer in a subscription. * * If you provide a card on file in the request, Square charges the card for - * the subscription. Otherwise, Square bills an invoice to the customer's email + * the subscription. Otherwise, Square sends an invoice to the customer's email * address. The subscription starts immediately, unless the request includes * the optional `start_date`. Each individual subscription is associated with a particular location. * + * For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions- + * api/manage-subscriptions#create-a-subscription). + * * @param CreateSubscriptionRequest $body An object containing the fields to POST for the * request. * @@ -71,10 +74,6 @@ public function createSubscription(CreateSubscriptionRequest $body): ApiResponse * first by location, within location by customer ID, and within * customer by subscription creation date. * - * For more information, see - * [Retrieve subscriptions](https://developer.squareup.com/docs/subscriptions-api/overview#retrieve- - * subscriptions). - * * @param SearchSubscriptionsRequest $body An object containing the fields to POST for the * request. * @@ -94,7 +93,7 @@ public function searchSubscriptions(SearchSubscriptionsRequest $body): ApiRespon } /** - * Retrieves a subscription. + * Retrieves a specific subscription. * * @param string $subscriptionId The ID of the subscription to retrieve. * @param string|null $mInclude A query parameter to specify related information to be included @@ -121,8 +120,8 @@ public function retrieveSubscription(string $subscriptionId, ?string $mInclude = } /** - * Updates a subscription. You can set, modify, and clear the - * `subscription` field values. + * Updates a subscription by modifying or clearing `subscription` field values. + * To clear a field, set its value to `null`. * * @param string $subscriptionId The ID of the subscription to update. * @param UpdateSubscriptionRequest $body An object containing the fields to POST for the @@ -173,9 +172,9 @@ public function deleteSubscriptionAction(string $subscriptionId, string $actionI } /** - * Schedules a `CANCEL` action to cancel an active subscription - * by setting the `canceled_date` field to the end of the active billing period - * and changing the subscription status from ACTIVE to CANCELED after this date. + * Schedules a `CANCEL` action to cancel an active subscription. This + * sets the `canceled_date` field to the end of the active billing period. After this date, + * the subscription status changes from ACTIVE to CANCELED. * * @param string $subscriptionId The ID of the subscription to cancel. * @@ -193,7 +192,8 @@ public function cancelSubscription(string $subscriptionId): ApiResponse } /** - * Lists all events for a specific subscription. + * Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a + * specific subscription. * * @param string $subscriptionId The ID of the subscription to retrieve the events for. * @param string|null $cursor When the total number of resulting subscription events exceeds the @@ -202,8 +202,8 @@ public function cancelSubscription(string $subscriptionId): ApiResponse * results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working- - * with-apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build- + * basics/common-api-patterns/pagination). * @param int|null $limit The upper limit on the number of subscription events to return in a * paged response. * @@ -280,7 +280,9 @@ public function resumeSubscription(string $subscriptionId, ResumeSubscriptionReq } /** - * Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription. + * Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. + * For more information, see [Swap Subscription Plan Variations](https://developer.squareup. + * com/docs/subscriptions-api/swap-plan-variations). * * @param string $subscriptionId The ID of the subscription to swap the subscription plan for. * @param SwapPlanRequest $body An object containing the fields to POST for the request. See the diff --git a/src/Apis/TerminalApi.php b/src/Apis/TerminalApi.php index 18b2c81e..1ade7f22 100644 --- a/src/Apis/TerminalApi.php +++ b/src/Apis/TerminalApi.php @@ -18,6 +18,7 @@ use Square\Models\CreateTerminalCheckoutResponse; use Square\Models\CreateTerminalRefundRequest; use Square\Models\CreateTerminalRefundResponse; +use Square\Models\DismissTerminalActionResponse; use Square\Models\GetTerminalActionResponse; use Square\Models\GetTerminalCheckoutResponse; use Square\Models\GetTerminalRefundResponse; @@ -77,7 +78,7 @@ public function searchTerminalActions(SearchTerminalActionsRequest $body): ApiRe * Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 * days. * - * @param string $actionId Unique ID for the desired `TerminalAction` + * @param string $actionId Unique ID for the desired `TerminalAction`. * * @return ApiResponse Response from the API call */ @@ -95,7 +96,7 @@ public function getTerminalAction(string $actionId): ApiResponse /** * Cancels a Terminal action request if the status of the request permits it. * - * @param string $actionId Unique ID for the desired `TerminalAction` + * @param string $actionId Unique ID for the desired `TerminalAction`. * * @return ApiResponse Response from the API call */ @@ -110,6 +111,28 @@ public function cancelTerminalAction(string $actionId): ApiResponse return $this->execute($_reqBuilder, $_resHandler); } + /** + * Dismisses a Terminal action request if the status and type of the request permits it. + * + * See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced- + * features/custom-workflows/link-and-dismiss-actions) for more details. + * + * @param string $actionId Unique ID for the `TerminalAction` associated with the waiting dialog + * to be dismissed. + * + * @return ApiResponse Response from the API call + */ + public function dismissTerminalAction(string $actionId): ApiResponse + { + $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/terminals/actions/{action_id}/dismiss') + ->auth('global') + ->parameters(TemplateParam::init('action_id', $actionId)); + + $_resHandler = $this->responseHandler()->type(DismissTerminalActionResponse::class)->returnApiResponse(); + + return $this->execute($_reqBuilder, $_resHandler); + } + /** * Creates a Terminal checkout request and sends it to the specified device to take a payment * for the requested amount. diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php index 3ba3c931..d1549e7d 100644 --- a/src/ConfigurationDefaults.php +++ b/src/ConfigurationDefaults.php @@ -27,7 +27,7 @@ class ConfigurationDefaults public const HTTP_METHODS_TO_RETRY = ['GET', 'PUT']; - public const SQUARE_VERSION = '2023-05-17'; + public const SQUARE_VERSION = '2023-06-08'; public const ADDITIONAL_HEADERS = []; diff --git a/src/Models/ActivityType.php b/src/Models/ActivityType.php index 46d923f9..ffffeb63 100644 --- a/src/Models/ActivityType.php +++ b/src/Models/ActivityType.php @@ -190,4 +190,28 @@ class ActivityType * Balance change due to money transfer. */ public const PAYOUT = 'PAYOUT'; + + /** + * Indicates the withholding of a portion of each payment by Square that has been + * automatically converted into bitcoin using Cash App. The seller manages their bitcoin in + * their Cash App account. + */ + public const AUTOMATIC_BITCOIN_CONVERSIONS = 'AUTOMATIC_BITCOIN_CONVERSIONS'; + + /** + * Indicates a return of the payment withholding that had been scheduled to be converted + * into bitcoin using Cash App to the Square payments balance. + */ + public const AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED = 'AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED'; + + /** + * The repayment made toward the outstanding balance on the seller's Square credit card. + */ + public const CREDIT_CARD_REPAYMENT = 'CREDIT_CARD_REPAYMENT'; + + /** + * The reversal of the repayment made toward the outstanding balance on the seller's + * Square credit card. + */ + public const CREDIT_CARD_REPAYMENT_REVERSED = 'CREDIT_CARD_REPAYMENT_REVERSED'; } diff --git a/src/Models/Builders/CatalogSubscriptionPlanBuilder.php b/src/Models/Builders/CatalogSubscriptionPlanBuilder.php index f9b78982..f066cd25 100644 --- a/src/Models/Builders/CatalogSubscriptionPlanBuilder.php +++ b/src/Models/Builders/CatalogSubscriptionPlanBuilder.php @@ -50,6 +50,78 @@ public function unsetPhases(): self return $this; } + /** + * Sets subscription plan variations field. + */ + public function subscriptionPlanVariations(?array $value): self + { + $this->instance->setSubscriptionPlanVariations($value); + return $this; + } + + /** + * Unsets subscription plan variations field. + */ + public function unsetSubscriptionPlanVariations(): self + { + $this->instance->unsetSubscriptionPlanVariations(); + return $this; + } + + /** + * Sets eligible item ids field. + */ + public function eligibleItemIds(?array $value): self + { + $this->instance->setEligibleItemIds($value); + return $this; + } + + /** + * Unsets eligible item ids field. + */ + public function unsetEligibleItemIds(): self + { + $this->instance->unsetEligibleItemIds(); + return $this; + } + + /** + * Sets eligible category ids field. + */ + public function eligibleCategoryIds(?array $value): self + { + $this->instance->setEligibleCategoryIds($value); + return $this; + } + + /** + * Unsets eligible category ids field. + */ + public function unsetEligibleCategoryIds(): self + { + $this->instance->unsetEligibleCategoryIds(); + return $this; + } + + /** + * Sets all items field. + */ + public function allItems(?bool $value): self + { + $this->instance->setAllItems($value); + return $this; + } + + /** + * Unsets all items field. + */ + public function unsetAllItems(): self + { + $this->instance->unsetAllItems(); + return $this; + } + /** * Initializes a new catalog subscription plan object. */ diff --git a/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php b/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php new file mode 100644 index 00000000..d540c1f8 --- /dev/null +++ b/src/Models/Builders/CatalogSubscriptionPlanVariationBuilder.php @@ -0,0 +1,60 @@ +instance = $instance; + } + + /** + * Initializes a new catalog subscription plan variation Builder object. + */ + public static function init(string $name, array $phases): self + { + return new self(new CatalogSubscriptionPlanVariation($name, $phases)); + } + + /** + * Sets subscription plan id field. + */ + public function subscriptionPlanId(?string $value): self + { + $this->instance->setSubscriptionPlanId($value); + return $this; + } + + /** + * Unsets subscription plan id field. + */ + public function unsetSubscriptionPlanId(): self + { + $this->instance->unsetSubscriptionPlanId(); + return $this; + } + + /** + * Initializes a new catalog subscription plan variation object. + */ + public function build(): CatalogSubscriptionPlanVariation + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/CheckoutOptionsBuilder.php b/src/Models/Builders/CheckoutOptionsBuilder.php index 06ede650..ea2384bc 100644 --- a/src/Models/Builders/CheckoutOptionsBuilder.php +++ b/src/Models/Builders/CheckoutOptionsBuilder.php @@ -170,6 +170,42 @@ public function shippingFee(?ShippingFee $value): self return $this; } + /** + * Sets enable coupon field. + */ + public function enableCoupon(?bool $value): self + { + $this->instance->setEnableCoupon($value); + return $this; + } + + /** + * Unsets enable coupon field. + */ + public function unsetEnableCoupon(): self + { + $this->instance->unsetEnableCoupon(); + return $this; + } + + /** + * Sets enable loyalty field. + */ + public function enableLoyalty(?bool $value): self + { + $this->instance->setEnableLoyalty($value); + return $this; + } + + /** + * Unsets enable loyalty field. + */ + public function unsetEnableLoyalty(): self + { + $this->instance->unsetEnableLoyalty(); + return $this; + } + /** * Initializes a new checkout options object. */ diff --git a/src/Models/Builders/CollectedDataBuilder.php b/src/Models/Builders/CollectedDataBuilder.php new file mode 100644 index 00000000..cf221de6 --- /dev/null +++ b/src/Models/Builders/CollectedDataBuilder.php @@ -0,0 +1,51 @@ +instance = $instance; + } + + /** + * Initializes a new collected data Builder object. + */ + public static function init(): self + { + return new self(new CollectedData()); + } + + /** + * Sets input text field. + */ + public function inputText(?string $value): self + { + $this->instance->setInputText($value); + return $this; + } + + /** + * Initializes a new collected data object. + */ + public function build(): CollectedData + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/ConfirmationDecisionBuilder.php b/src/Models/Builders/ConfirmationDecisionBuilder.php new file mode 100644 index 00000000..590f0003 --- /dev/null +++ b/src/Models/Builders/ConfirmationDecisionBuilder.php @@ -0,0 +1,51 @@ +instance = $instance; + } + + /** + * Initializes a new confirmation decision Builder object. + */ + public static function init(): self + { + return new self(new ConfirmationDecision()); + } + + /** + * Sets has agreed field. + */ + public function hasAgreed(?bool $value): self + { + $this->instance->setHasAgreed($value); + return $this; + } + + /** + * Initializes a new confirmation decision object. + */ + public function build(): ConfirmationDecision + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/ConfirmationOptionsBuilder.php b/src/Models/Builders/ConfirmationOptionsBuilder.php new file mode 100644 index 00000000..f186910c --- /dev/null +++ b/src/Models/Builders/ConfirmationOptionsBuilder.php @@ -0,0 +1,70 @@ +instance = $instance; + } + + /** + * Initializes a new confirmation options Builder object. + */ + public static function init(string $title, string $body, string $agreeButtonText): self + { + return new self(new ConfirmationOptions($title, $body, $agreeButtonText)); + } + + /** + * Sets disagree button text field. + */ + public function disagreeButtonText(?string $value): self + { + $this->instance->setDisagreeButtonText($value); + return $this; + } + + /** + * Unsets disagree button text field. + */ + public function unsetDisagreeButtonText(): self + { + $this->instance->unsetDisagreeButtonText(); + return $this; + } + + /** + * Sets decision field. + */ + public function decision(?ConfirmationDecision $value): self + { + $this->instance->setDecision($value); + return $this; + } + + /** + * Initializes a new confirmation options object. + */ + public function build(): ConfirmationOptions + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php b/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php index c27503a9..881bc5c8 100644 --- a/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php +++ b/src/Models/Builders/CreateMobileAuthorizationCodeResponseBuilder.php @@ -6,7 +6,6 @@ use Core\Utils\CoreHelper; use Square\Models\CreateMobileAuthorizationCodeResponse; -use Square\Models\Error; /** * Builder for model CreateMobileAuthorizationCodeResponse @@ -52,11 +51,11 @@ public function expiresAt(?string $value): self } /** - * Sets error field. + * Sets errors field. */ - public function error(?Error $value): self + public function errors(?array $value): self { - $this->instance->setError($value); + $this->instance->setErrors($value); return $this; } diff --git a/src/Models/Builders/CreateSubscriptionRequestBuilder.php b/src/Models/Builders/CreateSubscriptionRequestBuilder.php index a3aa99c0..32957038 100644 --- a/src/Models/Builders/CreateSubscriptionRequestBuilder.php +++ b/src/Models/Builders/CreateSubscriptionRequestBuilder.php @@ -29,9 +29,9 @@ private function __construct(CreateSubscriptionRequest $instance) /** * Initializes a new create subscription request Builder object. */ - public static function init(string $locationId, string $planId, string $customerId): self + public static function init(string $locationId, string $customerId): self { - return new self(new CreateSubscriptionRequest($locationId, $planId, $customerId)); + return new self(new CreateSubscriptionRequest($locationId, $customerId)); } /** @@ -43,6 +43,24 @@ public function idempotencyKey(?string $value): self return $this; } + /** + * Sets plan id field. + */ + public function planId(?string $value): self + { + $this->instance->setPlanId($value); + return $this; + } + + /** + * Sets plan variation id field. + */ + public function planVariationId(?string $value): self + { + $this->instance->setPlanVariationId($value); + return $this; + } + /** * Sets start date field. */ @@ -106,6 +124,15 @@ public function source(?SubscriptionSource $value): self return $this; } + /** + * Sets phases field. + */ + public function phases(?array $value): self + { + $this->instance->setPhases($value); + return $this; + } + /** * Initializes a new create subscription request object. */ diff --git a/src/Models/Builders/DataCollectionOptionsBuilder.php b/src/Models/Builders/DataCollectionOptionsBuilder.php new file mode 100644 index 00000000..f999e4e9 --- /dev/null +++ b/src/Models/Builders/DataCollectionOptionsBuilder.php @@ -0,0 +1,52 @@ +instance = $instance; + } + + /** + * Initializes a new data collection options Builder object. + */ + public static function init(string $title, string $body, string $inputType): self + { + return new self(new DataCollectionOptions($title, $body, $inputType)); + } + + /** + * Sets collected data field. + */ + public function collectedData(?CollectedData $value): self + { + $this->instance->setCollectedData($value); + return $this; + } + + /** + * Initializes a new data collection options object. + */ + public function build(): DataCollectionOptions + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/DismissTerminalActionResponseBuilder.php b/src/Models/Builders/DismissTerminalActionResponseBuilder.php new file mode 100644 index 00000000..3bc6f290 --- /dev/null +++ b/src/Models/Builders/DismissTerminalActionResponseBuilder.php @@ -0,0 +1,61 @@ +instance = $instance; + } + + /** + * Initializes a new dismiss terminal action response Builder object. + */ + public static function init(): self + { + return new self(new DismissTerminalActionResponse()); + } + + /** + * Sets errors field. + */ + public function errors(?array $value): self + { + $this->instance->setErrors($value); + return $this; + } + + /** + * Sets action field. + */ + public function action(?TerminalAction $value): self + { + $this->instance->setAction($value); + return $this; + } + + /** + * Initializes a new dismiss terminal action response object. + */ + public function build(): DismissTerminalActionResponse + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/PayoutBuilder.php b/src/Models/Builders/PayoutBuilder.php index 13d1799f..bcb85c61 100644 --- a/src/Models/Builders/PayoutBuilder.php +++ b/src/Models/Builders/PayoutBuilder.php @@ -133,6 +133,24 @@ public function unsetArrivalDate(): self return $this; } + /** + * Sets end to end id field. + */ + public function endToEndId(?string $value): self + { + $this->instance->setEndToEndId($value); + return $this; + } + + /** + * Unsets end to end id field. + */ + public function unsetEndToEndId(): self + { + $this->instance->unsetEndToEndId(); + return $this; + } + /** * Initializes a new payout object. */ diff --git a/src/Models/Builders/PhaseBuilder.php b/src/Models/Builders/PhaseBuilder.php new file mode 100644 index 00000000..bcd8e220 --- /dev/null +++ b/src/Models/Builders/PhaseBuilder.php @@ -0,0 +1,114 @@ +instance = $instance; + } + + /** + * Initializes a new phase Builder object. + */ + public static function init(): self + { + return new self(new Phase()); + } + + /** + * Sets uid field. + */ + public function uid(?string $value): self + { + $this->instance->setUid($value); + return $this; + } + + /** + * Unsets uid field. + */ + public function unsetUid(): self + { + $this->instance->unsetUid(); + return $this; + } + + /** + * Sets ordinal field. + */ + public function ordinal(?int $value): self + { + $this->instance->setOrdinal($value); + return $this; + } + + /** + * Unsets ordinal field. + */ + public function unsetOrdinal(): self + { + $this->instance->unsetOrdinal(); + return $this; + } + + /** + * Sets order template id field. + */ + public function orderTemplateId(?string $value): self + { + $this->instance->setOrderTemplateId($value); + return $this; + } + + /** + * Unsets order template id field. + */ + public function unsetOrderTemplateId(): self + { + $this->instance->unsetOrderTemplateId(); + return $this; + } + + /** + * Sets plan phase uid field. + */ + public function planPhaseUid(?string $value): self + { + $this->instance->setPlanPhaseUid($value); + return $this; + } + + /** + * Unsets plan phase uid field. + */ + public function unsetPlanPhaseUid(): self + { + $this->instance->unsetPlanPhaseUid(); + return $this; + } + + /** + * Initializes a new phase object. + */ + public function build(): Phase + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/PhaseInputBuilder.php b/src/Models/Builders/PhaseInputBuilder.php new file mode 100644 index 00000000..65012029 --- /dev/null +++ b/src/Models/Builders/PhaseInputBuilder.php @@ -0,0 +1,60 @@ +instance = $instance; + } + + /** + * Initializes a new phase input Builder object. + */ + public static function init(int $ordinal): self + { + return new self(new PhaseInput($ordinal)); + } + + /** + * Sets order template id field. + */ + public function orderTemplateId(?string $value): self + { + $this->instance->setOrderTemplateId($value); + return $this; + } + + /** + * Unsets order template id field. + */ + public function unsetOrderTemplateId(): self + { + $this->instance->unsetOrderTemplateId(); + return $this; + } + + /** + * Initializes a new phase input object. + */ + public function build(): PhaseInput + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/QrCodeOptionsBuilder.php b/src/Models/Builders/QrCodeOptionsBuilder.php new file mode 100644 index 00000000..a43a101d --- /dev/null +++ b/src/Models/Builders/QrCodeOptionsBuilder.php @@ -0,0 +1,42 @@ +instance = $instance; + } + + /** + * Initializes a new qr code options Builder object. + */ + public static function init(string $title, string $body, string $barcodeContents): self + { + return new self(new QrCodeOptions($title, $body, $barcodeContents)); + } + + /** + * Initializes a new qr code options object. + */ + public function build(): QrCodeOptions + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SelectOptionBuilder.php b/src/Models/Builders/SelectOptionBuilder.php new file mode 100644 index 00000000..23247db9 --- /dev/null +++ b/src/Models/Builders/SelectOptionBuilder.php @@ -0,0 +1,42 @@ +instance = $instance; + } + + /** + * Initializes a new select option Builder object. + */ + public static function init(string $referenceId, string $title): self + { + return new self(new SelectOption($referenceId, $title)); + } + + /** + * Initializes a new select option object. + */ + public function build(): SelectOption + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SelectOptionsBuilder.php b/src/Models/Builders/SelectOptionsBuilder.php new file mode 100644 index 00000000..cc2287a9 --- /dev/null +++ b/src/Models/Builders/SelectOptionsBuilder.php @@ -0,0 +1,52 @@ +instance = $instance; + } + + /** + * Initializes a new select options Builder object. + */ + public static function init(string $title, string $body, array $options): self + { + return new self(new SelectOptions($title, $body, $options)); + } + + /** + * Sets selected option field. + */ + public function selectedOption(?SelectOption $value): self + { + $this->instance->setSelectedOption($value); + return $this; + } + + /** + * Initializes a new select options object. + */ + public function build(): SelectOptions + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/ShiftWageBuilder.php b/src/Models/Builders/ShiftWageBuilder.php index 51610f03..304e51c1 100644 --- a/src/Models/Builders/ShiftWageBuilder.php +++ b/src/Models/Builders/ShiftWageBuilder.php @@ -60,6 +60,15 @@ public function hourlyRate(?Money $value): self return $this; } + /** + * Sets job id field. + */ + public function jobId(?string $value): self + { + $this->instance->setJobId($value); + return $this; + } + /** * Initializes a new shift wage object. */ diff --git a/src/Models/Builders/SignatureImageBuilder.php b/src/Models/Builders/SignatureImageBuilder.php new file mode 100644 index 00000000..ee4f6ec8 --- /dev/null +++ b/src/Models/Builders/SignatureImageBuilder.php @@ -0,0 +1,60 @@ +instance = $instance; + } + + /** + * Initializes a new signature image Builder object. + */ + public static function init(): self + { + return new self(new SignatureImage()); + } + + /** + * Sets image type field. + */ + public function imageType(?string $value): self + { + $this->instance->setImageType($value); + return $this; + } + + /** + * Sets data field. + */ + public function data(?string $value): self + { + $this->instance->setData($value); + return $this; + } + + /** + * Initializes a new signature image object. + */ + public function build(): SignatureImage + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SignatureOptionsBuilder.php b/src/Models/Builders/SignatureOptionsBuilder.php new file mode 100644 index 00000000..5646c8ed --- /dev/null +++ b/src/Models/Builders/SignatureOptionsBuilder.php @@ -0,0 +1,51 @@ +instance = $instance; + } + + /** + * Initializes a new signature options Builder object. + */ + public static function init(string $title, string $body): self + { + return new self(new SignatureOptions($title, $body)); + } + + /** + * Sets signature field. + */ + public function signature(?array $value): self + { + $this->instance->setSignature($value); + return $this; + } + + /** + * Initializes a new signature options object. + */ + public function build(): SignatureOptions + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SubscriptionActionBuilder.php b/src/Models/Builders/SubscriptionActionBuilder.php index 4c1cd65a..87cabeb9 100644 --- a/src/Models/Builders/SubscriptionActionBuilder.php +++ b/src/Models/Builders/SubscriptionActionBuilder.php @@ -69,20 +69,38 @@ public function unsetEffectiveDate(): self } /** - * Sets new plan id field. + * Sets phases field. */ - public function newPlanId(?string $value): self + public function phases(?array $value): self { - $this->instance->setNewPlanId($value); + $this->instance->setPhases($value); return $this; } /** - * Unsets new plan id field. + * Unsets phases field. */ - public function unsetNewPlanId(): self + public function unsetPhases(): self { - $this->instance->unsetNewPlanId(); + $this->instance->unsetPhases(); + return $this; + } + + /** + * Sets new plan variation id field. + */ + public function newPlanVariationId(?string $value): self + { + $this->instance->setNewPlanVariationId($value); + return $this; + } + + /** + * Unsets new plan variation id field. + */ + public function unsetNewPlanVariationId(): self + { + $this->instance->unsetNewPlanVariationId(); return $this; } diff --git a/src/Models/Builders/SubscriptionBuilder.php b/src/Models/Builders/SubscriptionBuilder.php index 73b1ff2e..6786954b 100644 --- a/src/Models/Builders/SubscriptionBuilder.php +++ b/src/Models/Builders/SubscriptionBuilder.php @@ -53,11 +53,11 @@ public function locationId(?string $value): self } /** - * Sets plan id field. + * Sets plan variation id field. */ - public function planId(?string $value): self + public function planVariationId(?string $value): self { - $this->instance->setPlanId($value); + $this->instance->setPlanVariationId($value); return $this; } @@ -223,6 +223,15 @@ public function unsetActions(): self return $this; } + /** + * Sets phases field. + */ + public function phases(?array $value): self + { + $this->instance->setPhases($value); + return $this; + } + /** * Initializes a new subscription object. */ diff --git a/src/Models/Builders/SubscriptionEventBuilder.php b/src/Models/Builders/SubscriptionEventBuilder.php index 57d3ecb9..1dea4975 100644 --- a/src/Models/Builders/SubscriptionEventBuilder.php +++ b/src/Models/Builders/SubscriptionEventBuilder.php @@ -28,9 +28,13 @@ private function __construct(SubscriptionEvent $instance) /** * Initializes a new subscription event Builder object. */ - public static function init(string $id, string $subscriptionEventType, string $effectiveDate, string $planId): self - { - return new self(new SubscriptionEvent($id, $subscriptionEventType, $effectiveDate, $planId)); + public static function init( + string $id, + string $subscriptionEventType, + string $effectiveDate, + string $planVariationId + ): self { + return new self(new SubscriptionEvent($id, $subscriptionEventType, $effectiveDate, $planVariationId)); } /** @@ -42,6 +46,24 @@ public function info(?SubscriptionEventInfo $value): self return $this; } + /** + * Sets phases field. + */ + public function phases(?array $value): self + { + $this->instance->setPhases($value); + return $this; + } + + /** + * Unsets phases field. + */ + public function unsetPhases(): self + { + $this->instance->unsetPhases(); + return $this; + } + /** * Initializes a new subscription event object. */ diff --git a/src/Models/Builders/SubscriptionPhaseBuilder.php b/src/Models/Builders/SubscriptionPhaseBuilder.php index c6b341d4..a35bd371 100644 --- a/src/Models/Builders/SubscriptionPhaseBuilder.php +++ b/src/Models/Builders/SubscriptionPhaseBuilder.php @@ -7,6 +7,7 @@ use Core\Utils\CoreHelper; use Square\Models\Money; use Square\Models\SubscriptionPhase; +use Square\Models\SubscriptionPricing; /** * Builder for model SubscriptionPhase @@ -96,6 +97,15 @@ public function unsetOrdinal(): self return $this; } + /** + * Sets pricing field. + */ + public function pricing(?SubscriptionPricing $value): self + { + $this->instance->setPricing($value); + return $this; + } + /** * Initializes a new subscription phase object. */ diff --git a/src/Models/Builders/SubscriptionPricingBuilder.php b/src/Models/Builders/SubscriptionPricingBuilder.php new file mode 100644 index 00000000..86318e38 --- /dev/null +++ b/src/Models/Builders/SubscriptionPricingBuilder.php @@ -0,0 +1,79 @@ +instance = $instance; + } + + /** + * Initializes a new subscription pricing Builder object. + */ + public static function init(): self + { + return new self(new SubscriptionPricing()); + } + + /** + * Sets type field. + */ + public function type(?string $value): self + { + $this->instance->setType($value); + return $this; + } + + /** + * Sets discount ids field. + */ + public function discountIds(?array $value): self + { + $this->instance->setDiscountIds($value); + return $this; + } + + /** + * Unsets discount ids field. + */ + public function unsetDiscountIds(): self + { + $this->instance->unsetDiscountIds(); + return $this; + } + + /** + * Sets price money field. + */ + public function priceMoney(?Money $value): self + { + $this->instance->setPriceMoney($value); + return $this; + } + + /** + * Initializes a new subscription pricing object. + */ + public function build(): SubscriptionPricing + { + return CoreHelper::clone($this->instance); + } +} diff --git a/src/Models/Builders/SubscriptionSourceBuilder.php b/src/Models/Builders/SubscriptionSourceBuilder.php index 9cee3b2e..8486aa8c 100644 --- a/src/Models/Builders/SubscriptionSourceBuilder.php +++ b/src/Models/Builders/SubscriptionSourceBuilder.php @@ -41,6 +41,15 @@ public function name(?string $value): self return $this; } + /** + * Unsets name field. + */ + public function unsetName(): self + { + $this->instance->unsetName(); + return $this; + } + /** * Initializes a new subscription source object. */ diff --git a/src/Models/Builders/SwapPlanRequestBuilder.php b/src/Models/Builders/SwapPlanRequestBuilder.php index 35e258c2..3c9b58d9 100644 --- a/src/Models/Builders/SwapPlanRequestBuilder.php +++ b/src/Models/Builders/SwapPlanRequestBuilder.php @@ -27,9 +27,45 @@ private function __construct(SwapPlanRequest $instance) /** * Initializes a new swap plan request Builder object. */ - public static function init(string $newPlanId): self + public static function init(): self { - return new self(new SwapPlanRequest($newPlanId)); + return new self(new SwapPlanRequest()); + } + + /** + * Sets new plan variation id field. + */ + public function newPlanVariationId(?string $value): self + { + $this->instance->setNewPlanVariationId($value); + return $this; + } + + /** + * Unsets new plan variation id field. + */ + public function unsetNewPlanVariationId(): self + { + $this->instance->unsetNewPlanVariationId(); + return $this; + } + + /** + * Sets phases field. + */ + public function phases(?array $value): self + { + $this->instance->setPhases($value); + return $this; + } + + /** + * Unsets phases field. + */ + public function unsetPhases(): self + { + $this->instance->unsetPhases(); + return $this; } /** diff --git a/src/Models/Builders/TeamMemberWageBuilder.php b/src/Models/Builders/TeamMemberWageBuilder.php index b9db0b09..67cdfef4 100644 --- a/src/Models/Builders/TeamMemberWageBuilder.php +++ b/src/Models/Builders/TeamMemberWageBuilder.php @@ -87,6 +87,24 @@ public function hourlyRate(?Money $value): self return $this; } + /** + * Sets job id field. + */ + public function jobId(?string $value): self + { + $this->instance->setJobId($value); + return $this; + } + + /** + * Unsets job id field. + */ + public function unsetJobId(): self + { + $this->instance->unsetJobId(); + return $this; + } + /** * Initializes a new team member wage object. */ diff --git a/src/Models/Builders/TerminalActionBuilder.php b/src/Models/Builders/TerminalActionBuilder.php index a566df71..68f12bd4 100644 --- a/src/Models/Builders/TerminalActionBuilder.php +++ b/src/Models/Builders/TerminalActionBuilder.php @@ -5,9 +5,14 @@ namespace Square\Models\Builders; use Core\Utils\CoreHelper; +use Square\Models\ConfirmationOptions; +use Square\Models\DataCollectionOptions; use Square\Models\DeviceMetadata; +use Square\Models\QrCodeOptions; use Square\Models\ReceiptOptions; use Square\Models\SaveCardOptions; +use Square\Models\SelectOptions; +use Square\Models\SignatureOptions; use Square\Models\TerminalAction; /** @@ -134,6 +139,15 @@ public function type(?string $value): self return $this; } + /** + * Sets qr code options field. + */ + public function qrCodeOptions(?QrCodeOptions $value): self + { + $this->instance->setQrCodeOptions($value); + return $this; + } + /** * Sets save card options field. */ @@ -143,6 +157,24 @@ public function saveCardOptions(?SaveCardOptions $value): self return $this; } + /** + * Sets signature options field. + */ + public function signatureOptions(?SignatureOptions $value): self + { + $this->instance->setSignatureOptions($value); + return $this; + } + + /** + * Sets confirmation options field. + */ + public function confirmationOptions(?ConfirmationOptions $value): self + { + $this->instance->setConfirmationOptions($value); + return $this; + } + /** * Sets receipt options field. */ @@ -152,6 +184,24 @@ public function receiptOptions(?ReceiptOptions $value): self return $this; } + /** + * Sets data collection options field. + */ + public function dataCollectionOptions(?DataCollectionOptions $value): self + { + $this->instance->setDataCollectionOptions($value); + return $this; + } + + /** + * Sets select options field. + */ + public function selectOptions(?SelectOptions $value): self + { + $this->instance->setSelectOptions($value); + return $this; + } + /** * Sets device metadata field. */ @@ -161,6 +211,42 @@ public function deviceMetadata(?DeviceMetadata $value): self return $this; } + /** + * Sets await next action field. + */ + public function awaitNextAction(?bool $value): self + { + $this->instance->setAwaitNextAction($value); + return $this; + } + + /** + * Unsets await next action field. + */ + public function unsetAwaitNextAction(): self + { + $this->instance->unsetAwaitNextAction(); + return $this; + } + + /** + * Sets await next action duration field. + */ + public function awaitNextActionDuration(?string $value): self + { + $this->instance->setAwaitNextActionDuration($value); + return $this; + } + + /** + * Unsets await next action duration field. + */ + public function unsetAwaitNextActionDuration(): self + { + $this->instance->unsetAwaitNextActionDuration(); + return $this; + } + /** * Initializes a new terminal action object. */ diff --git a/src/Models/CancelSubscriptionResponse.php b/src/Models/CancelSubscriptionResponse.php index 7a2df203..8d0d9f03 100644 --- a/src/Models/CancelSubscriptionResponse.php +++ b/src/Models/CancelSubscriptionResponse.php @@ -53,11 +53,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -66,11 +65,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/CatalogObject.php b/src/Models/CatalogObject.php index 77ae2084..64d3e319 100644 --- a/src/Models/CatalogObject.php +++ b/src/Models/CatalogObject.php @@ -884,9 +884,10 @@ public function setMeasurementUnitData(?CatalogMeasurementUnit $measurementUnitD /** * Returns Subscription Plan Data. - * Describes a subscription plan. For more information, see - * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- - * plan). + * Describes a subscription plan. A subscription plan represents what you want to sell in a + * subscription model, and includes references to each of the associated subscription plan variations. + * For more information, see [Subscription Plans and Variations](https://developer.squareup. + * com/docs/subscriptions-api/plans-and-variations). */ public function getSubscriptionPlanData(): ?CatalogSubscriptionPlan { @@ -895,9 +896,10 @@ public function getSubscriptionPlanData(): ?CatalogSubscriptionPlan /** * Sets Subscription Plan Data. - * Describes a subscription plan. For more information, see - * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- - * plan). + * Describes a subscription plan. A subscription plan represents what you want to sell in a + * subscription model, and includes references to each of the associated subscription plan variations. + * For more information, see [Subscription Plans and Variations](https://developer.squareup. + * com/docs/subscriptions-api/plans-and-variations). * * @maps subscription_plan_data */ diff --git a/src/Models/CatalogObjectType.php b/src/Models/CatalogObjectType.php index 1074a1ca..4724071e 100644 --- a/src/Models/CatalogObjectType.php +++ b/src/Models/CatalogObjectType.php @@ -95,6 +95,13 @@ class CatalogObjectType */ public const MEASUREMENT_UNIT = 'MEASUREMENT_UNIT'; + /** + * The `CatalogObject` instance is of the [CatalogSubscriptionPlan]($m/CatalogSubscriptionPlan) type + * and represents a subscription plan. + * The subscription-plan-specific data must be stored on the `subscription_plan_data` field. + */ + public const SUBSCRIPTION_PLAN_VARIATION = 'SUBSCRIPTION_PLAN_VARIATION'; + /** * The `CatalogObject` instance is of the [CatalogItemOption]($m/CatalogItemOption) type and represents * a list of options (such as a color or size of a T-shirt) diff --git a/src/Models/CatalogSubscriptionPlan.php b/src/Models/CatalogSubscriptionPlan.php index 087191eb..3c933e44 100644 --- a/src/Models/CatalogSubscriptionPlan.php +++ b/src/Models/CatalogSubscriptionPlan.php @@ -7,9 +7,10 @@ use stdClass; /** - * Describes a subscription plan. For more information, see - * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- - * plan). + * Describes a subscription plan. A subscription plan represents what you want to sell in a + * subscription model, and includes references to each of the associated subscription plan variations. + * For more information, see [Subscription Plans and Variations](https://developer.squareup. + * com/docs/subscriptions-api/plans-and-variations). */ class CatalogSubscriptionPlan implements \JsonSerializable { @@ -23,6 +24,26 @@ class CatalogSubscriptionPlan implements \JsonSerializable */ private $phases = []; + /** + * @var array + */ + private $subscriptionPlanVariations = []; + + /** + * @var array + */ + private $eligibleItemIds = []; + + /** + * @var array + */ + private $eligibleCategoryIds = []; + + /** + * @var array + */ + private $allItems = []; + /** * @param string $name */ @@ -94,6 +115,152 @@ public function unsetPhases(): void $this->phases = []; } + /** + * Returns Subscription Plan Variations. + * The list of subscription plan variations available for this product + * + * @return CatalogObject[]|null + */ + public function getSubscriptionPlanVariations(): ?array + { + if (count($this->subscriptionPlanVariations) == 0) { + return null; + } + return $this->subscriptionPlanVariations['value']; + } + + /** + * Sets Subscription Plan Variations. + * The list of subscription plan variations available for this product + * + * @maps subscription_plan_variations + * + * @param CatalogObject[]|null $subscriptionPlanVariations + */ + public function setSubscriptionPlanVariations(?array $subscriptionPlanVariations): void + { + $this->subscriptionPlanVariations['value'] = $subscriptionPlanVariations; + } + + /** + * Unsets Subscription Plan Variations. + * The list of subscription plan variations available for this product + */ + public function unsetSubscriptionPlanVariations(): void + { + $this->subscriptionPlanVariations = []; + } + + /** + * Returns Eligible Item Ids. + * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's + * variations. + * + * @return string[]|null + */ + public function getEligibleItemIds(): ?array + { + if (count($this->eligibleItemIds) == 0) { + return null; + } + return $this->eligibleItemIds['value']; + } + + /** + * Sets Eligible Item Ids. + * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's + * variations. + * + * @maps eligible_item_ids + * + * @param string[]|null $eligibleItemIds + */ + public function setEligibleItemIds(?array $eligibleItemIds): void + { + $this->eligibleItemIds['value'] = $eligibleItemIds; + } + + /** + * Unsets Eligible Item Ids. + * The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's + * variations. + */ + public function unsetEligibleItemIds(): void + { + $this->eligibleItemIds = []; + } + + /** + * Returns Eligible Category Ids. + * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's + * variations. + * + * @return string[]|null + */ + public function getEligibleCategoryIds(): ?array + { + if (count($this->eligibleCategoryIds) == 0) { + return null; + } + return $this->eligibleCategoryIds['value']; + } + + /** + * Sets Eligible Category Ids. + * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's + * variations. + * + * @maps eligible_category_ids + * + * @param string[]|null $eligibleCategoryIds + */ + public function setEligibleCategoryIds(?array $eligibleCategoryIds): void + { + $this->eligibleCategoryIds['value'] = $eligibleCategoryIds; + } + + /** + * Unsets Eligible Category Ids. + * The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's + * variations. + */ + public function unsetEligibleCategoryIds(): void + { + $this->eligibleCategoryIds = []; + } + + /** + * Returns All Items. + * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. + */ + public function getAllItems(): ?bool + { + if (count($this->allItems) == 0) { + return null; + } + return $this->allItems['value']; + } + + /** + * Sets All Items. + * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. + * + * @maps all_items + */ + public function setAllItems(?bool $allItems): void + { + $this->allItems['value'] = $allItems; + } + + /** + * Unsets All Items. + * If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. + */ + public function unsetAllItems(): void + { + $this->allItems = []; + } + /** * Encode this object to JSON * @@ -106,9 +273,21 @@ public function unsetPhases(): void public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - $json['name'] = $this->name; + $json['name'] = $this->name; if (!empty($this->phases)) { - $json['phases'] = $this->phases['value']; + $json['phases'] = $this->phases['value']; + } + if (!empty($this->subscriptionPlanVariations)) { + $json['subscription_plan_variations'] = $this->subscriptionPlanVariations['value']; + } + if (!empty($this->eligibleItemIds)) { + $json['eligible_item_ids'] = $this->eligibleItemIds['value']; + } + if (!empty($this->eligibleCategoryIds)) { + $json['eligible_category_ids'] = $this->eligibleCategoryIds['value']; + } + if (!empty($this->allItems)) { + $json['all_items'] = $this->allItems['value']; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/CatalogSubscriptionPlanVariation.php b/src/Models/CatalogSubscriptionPlanVariation.php new file mode 100644 index 00000000..12fed603 --- /dev/null +++ b/src/Models/CatalogSubscriptionPlanVariation.php @@ -0,0 +1,143 @@ +name = $name; + $this->phases = $phases; + } + + /** + * Returns Name. + * The name of the plan variation. + */ + public function getName(): string + { + return $this->name; + } + + /** + * Sets Name. + * The name of the plan variation. + * + * @required + * @maps name + */ + public function setName(string $name): void + { + $this->name = $name; + } + + /** + * Returns Phases. + * A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. + * + * @return SubscriptionPhase[] + */ + public function getPhases(): array + { + return $this->phases; + } + + /** + * Sets Phases. + * A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. + * + * @required + * @maps phases + * + * @param SubscriptionPhase[] $phases + */ + public function setPhases(array $phases): void + { + $this->phases = $phases; + } + + /** + * Returns Subscription Plan Id. + * The id of the subscription plan, if there is one. + */ + public function getSubscriptionPlanId(): ?string + { + if (count($this->subscriptionPlanId) == 0) { + return null; + } + return $this->subscriptionPlanId['value']; + } + + /** + * Sets Subscription Plan Id. + * The id of the subscription plan, if there is one. + * + * @maps subscription_plan_id + */ + public function setSubscriptionPlanId(?string $subscriptionPlanId): void + { + $this->subscriptionPlanId['value'] = $subscriptionPlanId; + } + + /** + * Unsets Subscription Plan Id. + * The id of the subscription plan, if there is one. + */ + public function unsetSubscriptionPlanId(): void + { + $this->subscriptionPlanId = []; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['name'] = $this->name; + $json['phases'] = $this->phases; + if (!empty($this->subscriptionPlanId)) { + $json['subscription_plan_id'] = $this->subscriptionPlanId['value']; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/CheckoutOptions.php b/src/Models/CheckoutOptions.php index 82d8f10f..d2156e20 100644 --- a/src/Models/CheckoutOptions.php +++ b/src/Models/CheckoutOptions.php @@ -53,6 +53,16 @@ class CheckoutOptions implements \JsonSerializable */ private $shippingFee; + /** + * @var array + */ + private $enableCoupon = []; + + /** + * @var array + */ + private $enableLoyalty = []; + /** * Returns Allow Tipping. * Indicates whether the payment allows tipping. @@ -323,6 +333,76 @@ public function setShippingFee(?ShippingFee $shippingFee): void $this->shippingFee = $shippingFee; } + /** + * Returns Enable Coupon. + * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing + * coupon in the payment form. + */ + public function getEnableCoupon(): ?bool + { + if (count($this->enableCoupon) == 0) { + return null; + } + return $this->enableCoupon['value']; + } + + /** + * Sets Enable Coupon. + * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing + * coupon in the payment form. + * + * @maps enable_coupon + */ + public function setEnableCoupon(?bool $enableCoupon): void + { + $this->enableCoupon['value'] = $enableCoupon; + } + + /** + * Unsets Enable Coupon. + * Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing + * coupon in the payment form. + */ + public function unsetEnableCoupon(): void + { + $this->enableCoupon = []; + } + + /** + * Returns Enable Loyalty. + * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem + * rewards in the payment form, or both. + */ + public function getEnableLoyalty(): ?bool + { + if (count($this->enableLoyalty) == 0) { + return null; + } + return $this->enableLoyalty['value']; + } + + /** + * Sets Enable Loyalty. + * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem + * rewards in the payment form, or both. + * + * @maps enable_loyalty + */ + public function setEnableLoyalty(?bool $enableLoyalty): void + { + $this->enableLoyalty['value'] = $enableLoyalty; + } + + /** + * Unsets Enable Loyalty. + * Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem + * rewards in the payment form, or both. + */ + public function unsetEnableLoyalty(): void + { + $this->enableLoyalty = []; + } + /** * Encode this object to JSON * @@ -362,6 +442,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->shippingFee)) { $json['shipping_fee'] = $this->shippingFee; } + if (!empty($this->enableCoupon)) { + $json['enable_coupon'] = $this->enableCoupon['value']; + } + if (!empty($this->enableLoyalty)) { + $json['enable_loyalty'] = $this->enableLoyalty['value']; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/CollectedData.php b/src/Models/CollectedData.php new file mode 100644 index 00000000..56fbf5e7 --- /dev/null +++ b/src/Models/CollectedData.php @@ -0,0 +1,57 @@ +inputText; + } + + /** + * Sets Input Text. + * The buyer's input text. + * + * @maps input_text + */ + public function setInputText(?string $inputText): void + { + $this->inputText = $inputText; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->inputText)) { + $json['input_text'] = $this->inputText; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/ConfirmationDecision.php b/src/Models/ConfirmationDecision.php new file mode 100644 index 00000000..a549d785 --- /dev/null +++ b/src/Models/ConfirmationDecision.php @@ -0,0 +1,57 @@ +hasAgreed; + } + + /** + * Sets Has Agreed. + * The buyer's decision to the displayed terms. + * + * @maps has_agreed + */ + public function setHasAgreed(?bool $hasAgreed): void + { + $this->hasAgreed = $hasAgreed; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->hasAgreed)) { + $json['has_agreed'] = $this->hasAgreed; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/ConfirmationOptions.php b/src/Models/ConfirmationOptions.php new file mode 100644 index 00000000..38efa792 --- /dev/null +++ b/src/Models/ConfirmationOptions.php @@ -0,0 +1,188 @@ +title = $title; + $this->body = $body; + $this->agreeButtonText = $agreeButtonText; + } + + /** + * Returns Title. + * The title text to display in the confirmation screen flow on the Terminal. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text to display in the confirmation screen flow on the Terminal. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Returns Body. + * The agreement details to display in the confirmation flow on the Terminal. + */ + public function getBody(): string + { + return $this->body; + } + + /** + * Sets Body. + * The agreement details to display in the confirmation flow on the Terminal. + * + * @required + * @maps body + */ + public function setBody(string $body): void + { + $this->body = $body; + } + + /** + * Returns Agree Button Text. + * The button text to display indicating the customer agrees to the displayed terms. + */ + public function getAgreeButtonText(): string + { + return $this->agreeButtonText; + } + + /** + * Sets Agree Button Text. + * The button text to display indicating the customer agrees to the displayed terms. + * + * @required + * @maps agree_button_text + */ + public function setAgreeButtonText(string $agreeButtonText): void + { + $this->agreeButtonText = $agreeButtonText; + } + + /** + * Returns Disagree Button Text. + * The button text to display indicating the customer does not agree to the displayed terms. + */ + public function getDisagreeButtonText(): ?string + { + if (count($this->disagreeButtonText) == 0) { + return null; + } + return $this->disagreeButtonText['value']; + } + + /** + * Sets Disagree Button Text. + * The button text to display indicating the customer does not agree to the displayed terms. + * + * @maps disagree_button_text + */ + public function setDisagreeButtonText(?string $disagreeButtonText): void + { + $this->disagreeButtonText['value'] = $disagreeButtonText; + } + + /** + * Unsets Disagree Button Text. + * The button text to display indicating the customer does not agree to the displayed terms. + */ + public function unsetDisagreeButtonText(): void + { + $this->disagreeButtonText = []; + } + + /** + * Returns Decision. + */ + public function getDecision(): ?ConfirmationDecision + { + return $this->decision; + } + + /** + * Sets Decision. + * + * @maps decision + */ + public function setDecision(?ConfirmationDecision $decision): void + { + $this->decision = $decision; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['title'] = $this->title; + $json['body'] = $this->body; + $json['agree_button_text'] = $this->agreeButtonText; + if (!empty($this->disagreeButtonText)) { + $json['disagree_button_text'] = $this->disagreeButtonText['value']; + } + if (isset($this->decision)) { + $json['decision'] = $this->decision; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/CreateMobileAuthorizationCodeResponse.php b/src/Models/CreateMobileAuthorizationCodeResponse.php index 523c4052..5dbdbe9f 100644 --- a/src/Models/CreateMobileAuthorizationCodeResponse.php +++ b/src/Models/CreateMobileAuthorizationCodeResponse.php @@ -23,9 +23,9 @@ class CreateMobileAuthorizationCodeResponse implements \JsonSerializable private $expiresAt; /** - * @var Error|null + * @var Error[]|null */ - private $error; + private $errors; /** * Returns Authorization Code. @@ -72,29 +72,27 @@ public function setExpiresAt(?string $expiresAt): void } /** - * Returns Error. - * Represents an error encountered during a request to the Connect API. + * Returns Errors. + * Any errors that occurred during the request. * - * See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more - * information. + * @return Error[]|null */ - public function getError(): ?Error + public function getErrors(): ?array { - return $this->error; + return $this->errors; } /** - * Sets Error. - * Represents an error encountered during a request to the Connect API. + * Sets Errors. + * Any errors that occurred during the request. * - * See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more - * information. + * @maps errors * - * @maps error + * @param Error[]|null $errors */ - public function setError(?Error $error): void + public function setErrors(?array $errors): void { - $this->error = $error; + $this->errors = $errors; } /** @@ -115,8 +113,8 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->expiresAt)) { $json['expires_at'] = $this->expiresAt; } - if (isset($this->error)) { - $json['error'] = $this->error; + if (isset($this->errors)) { + $json['errors'] = $this->errors; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/CreateSubscriptionRequest.php b/src/Models/CreateSubscriptionRequest.php index 4020fa6c..89916516 100644 --- a/src/Models/CreateSubscriptionRequest.php +++ b/src/Models/CreateSubscriptionRequest.php @@ -23,10 +23,15 @@ class CreateSubscriptionRequest implements \JsonSerializable private $locationId; /** - * @var string + * @var string|null */ private $planId; + /** + * @var string|null + */ + private $planVariationId; + /** * @var string */ @@ -67,15 +72,18 @@ class CreateSubscriptionRequest implements \JsonSerializable */ private $source; + /** + * @var Phase[]|null + */ + private $phases; + /** * @param string $locationId - * @param string $planId * @param string $customerId */ - public function __construct(string $locationId, string $planId, string $customerId) + public function __construct(string $locationId, string $customerId) { $this->locationId = $locationId; - $this->planId = $planId; $this->customerId = $customerId; } @@ -85,8 +93,8 @@ public function __construct(string $locationId, string $planId, string $customer * If you do not provide a unique string (or provide an empty string as the value), * the endpoint treats each request as independent. * - * For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with- - * apis/idempotency). + * For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common- + * api-patterns/idempotency). */ public function getIdempotencyKey(): ?string { @@ -99,8 +107,8 @@ public function getIdempotencyKey(): ?string * If you do not provide a unique string (or provide an empty string as the value), * the endpoint treats each request as independent. * - * For more information, see [Idempotency keys](https://developer.squareup.com/docs/working-with- - * apis/idempotency). + * For more information, see [Idempotency keys](https://developer.squareup.com/docs/build-basics/common- + * api-patterns/idempotency). * * @maps idempotency_key */ @@ -132,36 +140,65 @@ public function setLocationId(string $locationId): void /** * Returns Plan Id. - * The ID of the subscription plan created using the Catalog API. + * The ID of the [subscription plan](https://developer.squareup.com/docs/subscriptions-api/plans-and- + * variations) created using the Catalog API. + * + * Deprecated in favour of `plan_variation_id`. + * * For more information, see * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- * plan) and * [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). */ - public function getPlanId(): string + public function getPlanId(): ?string { return $this->planId; } /** * Sets Plan Id. - * The ID of the subscription plan created using the Catalog API. + * The ID of the [subscription plan](https://developer.squareup.com/docs/subscriptions-api/plans-and- + * variations) created using the Catalog API. + * + * Deprecated in favour of `plan_variation_id`. + * * For more information, see * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- * plan) and * [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). * - * @required * @maps plan_id */ - public function setPlanId(string $planId): void + public function setPlanId(?string $planId): void { $this->planId = $planId; } + /** + * Returns Plan Variation Id. + * The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions- + * api/plans-and-variations#plan-variations) created using the Catalog API. + */ + public function getPlanVariationId(): ?string + { + return $this->planVariationId; + } + + /** + * Sets Plan Variation Id. + * The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions- + * api/plans-and-variations#plan-variations) created using the Catalog API. + * + * @maps plan_variation_id + */ + public function setPlanVariationId(?string $planVariationId): void + { + $this->planVariationId = $planVariationId; + } + /** * Returns Customer Id. - * The ID of the [customer](entity:Customer) subscribing to the subscription plan. + * The ID of the [customer](entity:Customer) subscribing to the subscription plan variation. */ public function getCustomerId(): string { @@ -170,7 +207,7 @@ public function getCustomerId(): string /** * Sets Customer Id. - * The ID of the [customer](entity:Customer) subscribing to the subscription plan. + * The ID of the [customer](entity:Customer) subscribing to the subscription plan variation. * * @required * @maps customer_id @@ -206,7 +243,7 @@ public function setStartDate(?string $startDate): void * Returns Canceled Date. * The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. * - * This date overrides the cancellation date set in the plan configuration. + * This date overrides the cancellation date set in the plan variation configuration. * If the cancellation date is earlier than the end date of a subscription cycle, the subscription * stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled @@ -227,7 +264,7 @@ public function getCanceledDate(): ?string * Sets Canceled Date. * The `YYYY-MM-DD`-formatted date when the newly created subscription is scheduled for cancellation. * - * This date overrides the cancellation date set in the plan configuration. + * This date overrides the cancellation date set in the plan variation configuration. * If the cancellation date is earlier than the end date of a subscription cycle, the subscription * stops * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled @@ -307,9 +344,8 @@ public function setPriceOverrideMoney(?Money $priceOverrideMoney): void /** * Returns Card Id. * The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge. - * If it is not specified, the subscriber receives an invoice via email. For an example to - * create a customer profile for a subscriber and add a card on file, see [Subscriptions - * Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). + * If it is not specified, the subscriber receives an invoice via email with a link to pay for their + * subscription. */ public function getCardId(): ?string { @@ -319,9 +355,8 @@ public function getCardId(): ?string /** * Sets Card Id. * The ID of the [subscriber's](entity:Customer) [card](entity:Card) to charge. - * If it is not specified, the subscriber receives an invoice via email. For an example to - * create a customer profile for a subscriber and add a card on file, see [Subscriptions - * Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). + * If it is not specified, the subscriber receives an invoice via email with a link to pay for their + * subscription. * * @maps card_id */ @@ -380,6 +415,30 @@ public function setSource(?SubscriptionSource $source): void $this->source = $source; } + /** + * Returns Phases. + * array of phases for this subscription + * + * @return Phase[]|null + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * Sets Phases. + * array of phases for this subscription + * + * @maps phases + * + * @param Phase[]|null $phases + */ + public function setPhases(?array $phases): void + { + $this->phases = $phases; + } + /** * Encode this object to JSON * @@ -396,7 +455,12 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) $json['idempotency_key'] = $this->idempotencyKey; } $json['location_id'] = $this->locationId; - $json['plan_id'] = $this->planId; + if (isset($this->planId)) { + $json['plan_id'] = $this->planId; + } + if (isset($this->planVariationId)) { + $json['plan_variation_id'] = $this->planVariationId; + } $json['customer_id'] = $this->customerId; if (isset($this->startDate)) { $json['start_date'] = $this->startDate; @@ -419,6 +483,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->source)) { $json['source'] = $this->source; } + if (isset($this->phases)) { + $json['phases'] = $this->phases; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/CreateSubscriptionResponse.php b/src/Models/CreateSubscriptionResponse.php index bf592777..61195a14 100644 --- a/src/Models/CreateSubscriptionResponse.php +++ b/src/Models/CreateSubscriptionResponse.php @@ -48,11 +48,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -61,11 +60,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/DataCollectionOptions.php b/src/Models/DataCollectionOptions.php new file mode 100644 index 00000000..005eecfd --- /dev/null +++ b/src/Models/DataCollectionOptions.php @@ -0,0 +1,150 @@ +title = $title; + $this->body = $body; + $this->inputType = $inputType; + } + + /** + * Returns Title. + * The title text to display in the data collection flow on the Terminal. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text to display in the data collection flow on the Terminal. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Returns Body. + * The body text to display under the title in the data collection screen flow on the + * Terminal. + */ + public function getBody(): string + { + return $this->body; + } + + /** + * Sets Body. + * The body text to display under the title in the data collection screen flow on the + * Terminal. + * + * @required + * @maps body + */ + public function setBody(string $body): void + { + $this->body = $body; + } + + /** + * Returns Input Type. + * Describes the input type of the data. + */ + public function getInputType(): string + { + return $this->inputType; + } + + /** + * Sets Input Type. + * Describes the input type of the data. + * + * @required + * @maps input_type + */ + public function setInputType(string $inputType): void + { + $this->inputType = $inputType; + } + + /** + * Returns Collected Data. + */ + public function getCollectedData(): ?CollectedData + { + return $this->collectedData; + } + + /** + * Sets Collected Data. + * + * @maps collected_data + */ + public function setCollectedData(?CollectedData $collectedData): void + { + $this->collectedData = $collectedData; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['title'] = $this->title; + $json['body'] = $this->body; + $json['input_type'] = $this->inputType; + if (isset($this->collectedData)) { + $json['collected_data'] = $this->collectedData; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/DataCollectionOptionsInputType.php b/src/Models/DataCollectionOptionsInputType.php new file mode 100644 index 00000000..605f948a --- /dev/null +++ b/src/Models/DataCollectionOptionsInputType.php @@ -0,0 +1,23 @@ +errors; + } + + /** + * Sets Errors. + * Information on errors encountered during the request. + * + * @maps errors + * + * @param Error[]|null $errors + */ + public function setErrors(?array $errors): void + { + $this->errors = $errors; + } + + /** + * Returns Action. + * Represents an action processed by the Square Terminal. + */ + public function getAction(): ?TerminalAction + { + return $this->action; + } + + /** + * Sets Action. + * Represents an action processed by the Square Terminal. + * + * @maps action + */ + public function setAction(?TerminalAction $action): void + { + $this->action = $action; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->errors)) { + $json['errors'] = $this->errors; + } + if (isset($this->action)) { + $json['action'] = $this->action; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/EmployeeWage.php b/src/Models/EmployeeWage.php index d33ade58..d0bd3cb7 100644 --- a/src/Models/EmployeeWage.php +++ b/src/Models/EmployeeWage.php @@ -7,9 +7,9 @@ use stdClass; /** - * The hourly wage rate that an employee earns on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use - * `TeamMemberWage` instead. + * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` + * property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity: + * TeamMemberWage). */ class EmployeeWage implements \JsonSerializable { diff --git a/src/Models/GetEmployeeWageResponse.php b/src/Models/GetEmployeeWageResponse.php index e138ff29..30427d09 100644 --- a/src/Models/GetEmployeeWageResponse.php +++ b/src/Models/GetEmployeeWageResponse.php @@ -25,9 +25,9 @@ class GetEmployeeWageResponse implements \JsonSerializable /** * Returns Employee Wage. - * The hourly wage rate that an employee earns on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use - * `TeamMemberWage` instead. + * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` + * property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity: + * TeamMemberWage). */ public function getEmployeeWage(): ?EmployeeWage { @@ -36,9 +36,9 @@ public function getEmployeeWage(): ?EmployeeWage /** * Sets Employee Wage. - * The hourly wage rate that an employee earns on a `Shift` for doing the job - * specified by the `title` property of this object. Deprecated at version 2020-08-26. Use - * `TeamMemberWage` instead. + * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` + * property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity: + * TeamMemberWage). * * @maps employee_wage */ diff --git a/src/Models/ListSubscriptionEventsRequest.php b/src/Models/ListSubscriptionEventsRequest.php index f84dd597..fc1a5cd5 100644 --- a/src/Models/ListSubscriptionEventsRequest.php +++ b/src/Models/ListSubscriptionEventsRequest.php @@ -29,8 +29,8 @@ class ListSubscriptionEventsRequest implements \JsonSerializable * specify the cursor returned from a preceding response here to fetch the next set of results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). */ public function getCursor(): ?string { @@ -46,8 +46,8 @@ public function getCursor(): ?string * specify the cursor returned from a preceding response here to fetch the next set of results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). * * @maps cursor */ @@ -62,8 +62,8 @@ public function setCursor(?string $cursor): void * specify the cursor returned from a preceding response here to fetch the next set of results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). */ public function unsetCursor(): void { diff --git a/src/Models/ListSubscriptionEventsResponse.php b/src/Models/ListSubscriptionEventsResponse.php index 98e47ba2..8b288f8a 100644 --- a/src/Models/ListSubscriptionEventsResponse.php +++ b/src/Models/ListSubscriptionEventsResponse.php @@ -82,8 +82,8 @@ public function setSubscriptionEvents(?array $subscriptionEvents): void * events. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). */ public function getCursor(): ?string { @@ -97,8 +97,8 @@ public function getCursor(): ?string * events. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). * * @maps cursor */ diff --git a/src/Models/ObtainTokenRequest.php b/src/Models/ObtainTokenRequest.php index 12844451..733ac210 100644 --- a/src/Models/ObtainTokenRequest.php +++ b/src/Models/ObtainTokenRequest.php @@ -70,7 +70,7 @@ public function __construct(string $clientId, string $grantType) /** * Returns Client Id. - * The Square-issued ID of your application, which is available in the OAuth page in the + * The Square-issued ID of your application, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). */ public function getClientId(): string @@ -80,7 +80,7 @@ public function getClientId(): string /** * Sets Client Id. - * The Square-issued ID of your application, which is available in the OAuth page in the + * The Square-issued ID of your application, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). * * @required @@ -93,11 +93,16 @@ public function setClientId(string $clientId): void /** * Returns Client Secret. - * The Square-issued application secret for your application, which is available in the OAuth page + * The Square-issued application secret for your application, which is available on the **OAuth** page * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when you are not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer. - * squareup.com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret`. + * when + * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. + * com/docs/oauth-api/overview#pkce-flow). + * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to + * `authorization_code`. + * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE + * flow only requires `client_id`, + * `grant_type`, and `refresh_token`. */ public function getClientSecret(): ?string { @@ -109,11 +114,16 @@ public function getClientSecret(): ?string /** * Sets Client Secret. - * The Square-issued application secret for your application, which is available in the OAuth page + * The Square-issued application secret for your application, which is available on the **OAuth** page * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when you are not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer. - * squareup.com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret`. + * when + * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. + * com/docs/oauth-api/overview#pkce-flow). + * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to + * `authorization_code`. + * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE + * flow only requires `client_id`, + * `grant_type`, and `refresh_token`. * * @maps client_secret */ @@ -124,11 +134,16 @@ public function setClientSecret(?string $clientSecret): void /** * Unsets Client Secret. - * The Square-issued application secret for your application, which is available in the OAuth page + * The Square-issued application secret for your application, which is available on the **OAuth** page * in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required - * when you are not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer. - * squareup.com/docs/oauth-api/overview#pkce-flow). - * The PKCE flow requires a `code_verifier` instead of a `client_secret`. + * when + * you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup. + * com/docs/oauth-api/overview#pkce-flow). + * The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to + * `authorization_code`. + * If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE + * flow only requires `client_id`, + * `grant_type`, and `refresh_token`. */ public function unsetClientSecret(): void { @@ -175,8 +190,8 @@ public function unsetCode(): void /** * Returns Redirect Uri. - * The redirect URL assigned in the OAuth page for your application in the [Developer Dashboard](https: - * //developer.squareup.com/apps). + * The redirect URL assigned on the **OAuth** page for your application in the [Developer + * Dashboard](https://developer.squareup.com/apps). */ public function getRedirectUri(): ?string { @@ -188,8 +203,8 @@ public function getRedirectUri(): ?string /** * Sets Redirect Uri. - * The redirect URL assigned in the OAuth page for your application in the [Developer Dashboard](https: - * //developer.squareup.com/apps). + * The redirect URL assigned on the **OAuth** page for your application in the [Developer + * Dashboard](https://developer.squareup.com/apps). * * @maps redirect_uri */ @@ -200,8 +215,8 @@ public function setRedirectUri(?string $redirectUri): void /** * Unsets Redirect Uri. - * The redirect URL assigned in the OAuth page for your application in the [Developer Dashboard](https: - * //developer.squareup.com/apps). + * The redirect URL assigned on the **OAuth** page for your application in the [Developer + * Dashboard](https://developer.squareup.com/apps). */ public function unsetRedirectUri(): void { @@ -410,7 +425,8 @@ public function unsetShortLived(): void /** * Returns Code Verifier. - * Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the + * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The + * `code_verifier` is used to verify against the * `code_challenge` associated with the `authorization_code`. */ public function getCodeVerifier(): ?string @@ -423,7 +439,8 @@ public function getCodeVerifier(): ?string /** * Sets Code Verifier. - * Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the + * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The + * `code_verifier` is used to verify against the * `code_challenge` associated with the `authorization_code`. * * @maps code_verifier @@ -435,7 +452,8 @@ public function setCodeVerifier(?string $codeVerifier): void /** * Unsets Code Verifier. - * Must be provided when using PKCE OAuth flow. The `code_verifier` will be used to verify against the + * Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The + * `code_verifier` is used to verify against the * `code_challenge` associated with the `authorization_code`. */ public function unsetCodeVerifier(): void diff --git a/src/Models/PauseSubscriptionResponse.php b/src/Models/PauseSubscriptionResponse.php index b57cbf54..4479d7f6 100644 --- a/src/Models/PauseSubscriptionResponse.php +++ b/src/Models/PauseSubscriptionResponse.php @@ -53,11 +53,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -66,11 +65,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/Payout.php b/src/Models/Payout.php index 7d0286a8..6a1a77a6 100644 --- a/src/Models/Payout.php +++ b/src/Models/Payout.php @@ -67,6 +67,11 @@ class Payout implements \JsonSerializable */ private $arrivalDate = []; + /** + * @var array + */ + private $endToEndId = []; + /** * @param string $id * @param string $locationId @@ -352,6 +357,44 @@ public function unsetArrivalDate(): void $this->arrivalDate = []; } + /** + * Returns End to End Id. + * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can + * use this ID to automate the process of reconciling each payout with the corresponding line item on + * the bank statement. + */ + public function getEndToEndId(): ?string + { + if (count($this->endToEndId) == 0) { + return null; + } + return $this->endToEndId['value']; + } + + /** + * Sets End to End Id. + * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can + * use this ID to automate the process of reconciling each payout with the corresponding line item on + * the bank statement. + * + * @maps end_to_end_id + */ + public function setEndToEndId(?string $endToEndId): void + { + $this->endToEndId['value'] = $endToEndId; + } + + /** + * Unsets End to End Id. + * A unique ID for each `Payout` object that might also appear on the seller’s bank statement. You can + * use this ID to automate the process of reconciling each payout with the corresponding line item on + * the bank statement. + */ + public function unsetEndToEndId(): void + { + $this->endToEndId = []; + } + /** * Encode this object to JSON * @@ -364,34 +407,37 @@ public function unsetArrivalDate(): void public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - $json['id'] = $this->id; + $json['id'] = $this->id; if (isset($this->status)) { - $json['status'] = $this->status; + $json['status'] = $this->status; } - $json['location_id'] = $this->locationId; + $json['location_id'] = $this->locationId; if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; + $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; + $json['updated_at'] = $this->updatedAt; } if (isset($this->amountMoney)) { - $json['amount_money'] = $this->amountMoney; + $json['amount_money'] = $this->amountMoney; } if (isset($this->destination)) { - $json['destination'] = $this->destination; + $json['destination'] = $this->destination; } if (isset($this->version)) { - $json['version'] = $this->version; + $json['version'] = $this->version; } if (isset($this->type)) { - $json['type'] = $this->type; + $json['type'] = $this->type; } if (!empty($this->payoutFee)) { - $json['payout_fee'] = $this->payoutFee['value']; + $json['payout_fee'] = $this->payoutFee['value']; } if (!empty($this->arrivalDate)) { - $json['arrival_date'] = $this->arrivalDate['value']; + $json['arrival_date'] = $this->arrivalDate['value']; + } + if (!empty($this->endToEndId)) { + $json['end_to_end_id'] = $this->endToEndId['value']; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/Phase.php b/src/Models/Phase.php new file mode 100644 index 00000000..e192884c --- /dev/null +++ b/src/Models/Phase.php @@ -0,0 +1,192 @@ +uid) == 0) { + return null; + } + return $this->uid['value']; + } + + /** + * Sets Uid. + * id of subscription phase + * + * @maps uid + */ + public function setUid(?string $uid): void + { + $this->uid['value'] = $uid; + } + + /** + * Unsets Uid. + * id of subscription phase + */ + public function unsetUid(): void + { + $this->uid = []; + } + + /** + * Returns Ordinal. + * index of phase in total subscription plan + */ + public function getOrdinal(): ?int + { + if (count($this->ordinal) == 0) { + return null; + } + return $this->ordinal['value']; + } + + /** + * Sets Ordinal. + * index of phase in total subscription plan + * + * @maps ordinal + */ + public function setOrdinal(?int $ordinal): void + { + $this->ordinal['value'] = $ordinal; + } + + /** + * Unsets Ordinal. + * index of phase in total subscription plan + */ + public function unsetOrdinal(): void + { + $this->ordinal = []; + } + + /** + * Returns Order Template Id. + * id of order to be used in billing + */ + public function getOrderTemplateId(): ?string + { + if (count($this->orderTemplateId) == 0) { + return null; + } + return $this->orderTemplateId['value']; + } + + /** + * Sets Order Template Id. + * id of order to be used in billing + * + * @maps order_template_id + */ + public function setOrderTemplateId(?string $orderTemplateId): void + { + $this->orderTemplateId['value'] = $orderTemplateId; + } + + /** + * Unsets Order Template Id. + * id of order to be used in billing + */ + public function unsetOrderTemplateId(): void + { + $this->orderTemplateId = []; + } + + /** + * Returns Plan Phase Uid. + * the uid from the plan's phase in catalog + */ + public function getPlanPhaseUid(): ?string + { + if (count($this->planPhaseUid) == 0) { + return null; + } + return $this->planPhaseUid['value']; + } + + /** + * Sets Plan Phase Uid. + * the uid from the plan's phase in catalog + * + * @maps plan_phase_uid + */ + public function setPlanPhaseUid(?string $planPhaseUid): void + { + $this->planPhaseUid['value'] = $planPhaseUid; + } + + /** + * Unsets Plan Phase Uid. + * the uid from the plan's phase in catalog + */ + public function unsetPlanPhaseUid(): void + { + $this->planPhaseUid = []; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (!empty($this->uid)) { + $json['uid'] = $this->uid['value']; + } + if (!empty($this->ordinal)) { + $json['ordinal'] = $this->ordinal['value']; + } + if (!empty($this->orderTemplateId)) { + $json['order_template_id'] = $this->orderTemplateId['value']; + } + if (!empty($this->planPhaseUid)) { + $json['plan_phase_uid'] = $this->planPhaseUid['value']; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/PhaseInput.php b/src/Models/PhaseInput.php new file mode 100644 index 00000000..4ebeecc6 --- /dev/null +++ b/src/Models/PhaseInput.php @@ -0,0 +1,107 @@ +ordinal = $ordinal; + } + + /** + * Returns Ordinal. + * index of phase in total subscription plan + */ + public function getOrdinal(): int + { + return $this->ordinal; + } + + /** + * Sets Ordinal. + * index of phase in total subscription plan + * + * @required + * @maps ordinal + */ + public function setOrdinal(int $ordinal): void + { + $this->ordinal = $ordinal; + } + + /** + * Returns Order Template Id. + * id of order to be used in billing + */ + public function getOrderTemplateId(): ?string + { + if (count($this->orderTemplateId) == 0) { + return null; + } + return $this->orderTemplateId['value']; + } + + /** + * Sets Order Template Id. + * id of order to be used in billing + * + * @maps order_template_id + */ + public function setOrderTemplateId(?string $orderTemplateId): void + { + $this->orderTemplateId['value'] = $orderTemplateId; + } + + /** + * Unsets Order Template Id. + * id of order to be used in billing + */ + public function unsetOrderTemplateId(): void + { + $this->orderTemplateId = []; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['ordinal'] = $this->ordinal; + if (!empty($this->orderTemplateId)) { + $json['order_template_id'] = $this->orderTemplateId['value']; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/QrCodeOptions.php b/src/Models/QrCodeOptions.php new file mode 100644 index 00000000..21d9b4ec --- /dev/null +++ b/src/Models/QrCodeOptions.php @@ -0,0 +1,127 @@ +title = $title; + $this->body = $body; + $this->barcodeContents = $barcodeContents; + } + + /** + * Returns Title. + * The title text to display in the QR code flow on the Terminal. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text to display in the QR code flow on the Terminal. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Returns Body. + * The body text to display in the QR code flow on the Terminal. + */ + public function getBody(): string + { + return $this->body; + } + + /** + * Sets Body. + * The body text to display in the QR code flow on the Terminal. + * + * @required + * @maps body + */ + public function setBody(string $body): void + { + $this->body = $body; + } + + /** + * Returns Barcode Contents. + * The text representation of the data to show in the QR code + * as UTF8-encoded data. + */ + public function getBarcodeContents(): string + { + return $this->barcodeContents; + } + + /** + * Sets Barcode Contents. + * The text representation of the data to show in the QR code + * as UTF8-encoded data. + * + * @required + * @maps barcode_contents + */ + public function setBarcodeContents(string $barcodeContents): void + { + $this->barcodeContents = $barcodeContents; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['title'] = $this->title; + $json['body'] = $this->body; + $json['barcode_contents'] = $this->barcodeContents; + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/ResumeSubscriptionResponse.php b/src/Models/ResumeSubscriptionResponse.php index dbd34014..92a6a239 100644 --- a/src/Models/ResumeSubscriptionResponse.php +++ b/src/Models/ResumeSubscriptionResponse.php @@ -53,11 +53,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -66,11 +65,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/RetrieveSubscriptionResponse.php b/src/Models/RetrieveSubscriptionResponse.php index eed90a2f..c48299bd 100644 --- a/src/Models/RetrieveSubscriptionResponse.php +++ b/src/Models/RetrieveSubscriptionResponse.php @@ -48,11 +48,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -61,11 +60,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/RetrieveTokenStatusResponse.php b/src/Models/RetrieveTokenStatusResponse.php index a25e074d..e3a5a6cf 100644 --- a/src/Models/RetrieveTokenStatusResponse.php +++ b/src/Models/RetrieveTokenStatusResponse.php @@ -8,7 +8,7 @@ /** * Defines the fields that are included in the response body of - * a request to the `RetrieveTokenStatus` endpoint + * a request to the `RetrieveTokenStatus` endpoint. */ class RetrieveTokenStatusResponse implements \JsonSerializable { @@ -63,7 +63,8 @@ public function setScopes(?array $scopes): void /** * Returns Expires At. - * The date and time when the `access_token` expires, in RFC 3339 format. Empty if token never expires. + * The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never + * expires. */ public function getExpiresAt(): ?string { @@ -72,7 +73,8 @@ public function getExpiresAt(): ?string /** * Sets Expires At. - * The date and time when the `access_token` expires, in RFC 3339 format. Empty if token never expires. + * The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never + * expires. * * @maps expires_at */ diff --git a/src/Models/RevokeTokenRequest.php b/src/Models/RevokeTokenRequest.php index ed54e088..945d1f38 100644 --- a/src/Models/RevokeTokenRequest.php +++ b/src/Models/RevokeTokenRequest.php @@ -30,7 +30,7 @@ class RevokeTokenRequest implements \JsonSerializable /** * Returns Client Id. - * The Square-issued ID for your application, which is available in the OAuth page in the + * The Square-issued ID for your application, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). */ public function getClientId(): ?string @@ -43,7 +43,7 @@ public function getClientId(): ?string /** * Sets Client Id. - * The Square-issued ID for your application, which is available in the OAuth page in the + * The Square-issued ID for your application, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). * * @maps client_id @@ -55,7 +55,7 @@ public function setClientId(?string $clientId): void /** * Unsets Client Id. - * The Square-issued ID for your application, which is available in the OAuth page in the + * The Square-issued ID for your application, which is available on the **OAuth** page in the * [Developer Dashboard](https://developer.squareup.com/apps). */ public function unsetClientId(): void diff --git a/src/Models/SearchSubscriptionsRequest.php b/src/Models/SearchSubscriptionsRequest.php index 5562aaba..6a2b692b 100644 --- a/src/Models/SearchSubscriptionsRequest.php +++ b/src/Models/SearchSubscriptionsRequest.php @@ -38,8 +38,8 @@ class SearchSubscriptionsRequest implements \JsonSerializable * specify the cursor returned from a preceding response here to fetch the next set of results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). */ public function getCursor(): ?string { @@ -52,8 +52,8 @@ public function getCursor(): ?string * specify the cursor returned from a preceding response here to fetch the next set of results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). * * @maps cursor */ diff --git a/src/Models/SearchSubscriptionsResponse.php b/src/Models/SearchSubscriptionsResponse.php index f3596b8e..67b81566 100644 --- a/src/Models/SearchSubscriptionsResponse.php +++ b/src/Models/SearchSubscriptionsResponse.php @@ -82,8 +82,8 @@ public function setSubscriptions(?array $subscriptions): void * results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). */ public function getCursor(): ?string { @@ -97,8 +97,8 @@ public function getCursor(): ?string * results. * If the cursor is unset, the response contains the last page of the results. * - * For more information, see [Pagination](https://developer.squareup.com/docs/working-with- - * apis/pagination). + * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api- + * patterns/pagination). * * @maps cursor */ diff --git a/src/Models/SelectOption.php b/src/Models/SelectOption.php new file mode 100644 index 00000000..4872d5e3 --- /dev/null +++ b/src/Models/SelectOption.php @@ -0,0 +1,93 @@ +referenceId = $referenceId; + $this->title = $title; + } + + /** + * Returns Reference Id. + * The reference id for the option. + */ + public function getReferenceId(): string + { + return $this->referenceId; + } + + /** + * Sets Reference Id. + * The reference id for the option. + * + * @required + * @maps reference_id + */ + public function setReferenceId(string $referenceId): void + { + $this->referenceId = $referenceId; + } + + /** + * Returns Title. + * The title text that displays in the select option button. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text that displays in the select option button. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['reference_id'] = $this->referenceId; + $json['title'] = $this->title; + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/SelectOptions.php b/src/Models/SelectOptions.php new file mode 100644 index 00000000..14c8ff8f --- /dev/null +++ b/src/Models/SelectOptions.php @@ -0,0 +1,152 @@ +title = $title; + $this->body = $body; + $this->options = $options; + } + + /** + * Returns Title. + * The title text to display in the select flow on the Terminal. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text to display in the select flow on the Terminal. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Returns Body. + * The body text to display in the select flow on the Terminal. + */ + public function getBody(): string + { + return $this->body; + } + + /** + * Sets Body. + * The body text to display in the select flow on the Terminal. + * + * @required + * @maps body + */ + public function setBody(string $body): void + { + $this->body = $body; + } + + /** + * Returns Options. + * Represents the buttons/options that should be displayed in the select flow on the Terminal. + * + * @return SelectOption[] + */ + public function getOptions(): array + { + return $this->options; + } + + /** + * Sets Options. + * Represents the buttons/options that should be displayed in the select flow on the Terminal. + * + * @required + * @maps options + * + * @param SelectOption[] $options + */ + public function setOptions(array $options): void + { + $this->options = $options; + } + + /** + * Returns Selected Option. + */ + public function getSelectedOption(): ?SelectOption + { + return $this->selectedOption; + } + + /** + * Sets Selected Option. + * + * @maps selected_option + */ + public function setSelectedOption(?SelectOption $selectedOption): void + { + $this->selectedOption = $selectedOption; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['title'] = $this->title; + $json['body'] = $this->body; + $json['options'] = $this->options; + if (isset($this->selectedOption)) { + $json['selected_option'] = $this->selectedOption; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/ShiftWage.php b/src/Models/ShiftWage.php index 8dc90bfd..3749312b 100644 --- a/src/Models/ShiftWage.php +++ b/src/Models/ShiftWage.php @@ -21,10 +21,14 @@ class ShiftWage implements \JsonSerializable */ private $hourlyRate; + /** + * @var string|null + */ + private $jobId; + /** * Returns Title. - * The name of the job performed during this shift. Square - * labor-reporting UIs might group shifts together by title. + * The name of the job performed during this shift. */ public function getTitle(): ?string { @@ -36,8 +40,7 @@ public function getTitle(): ?string /** * Sets Title. - * The name of the job performed during this shift. Square - * labor-reporting UIs might group shifts together by title. + * The name of the job performed during this shift. * * @maps title */ @@ -48,8 +51,7 @@ public function setTitle(?string $title): void /** * Unsets Title. - * The name of the job performed during this shift. Square - * labor-reporting UIs might group shifts together by title. + * The name of the job performed during this shift. */ public function unsetTitle(): void { @@ -88,6 +90,28 @@ public function setHourlyRate(?Money $hourlyRate): void $this->hourlyRate = $hourlyRate; } + /** + * Returns Job Id. + * The id of the job performed during this shift. Square + * labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. + */ + public function getJobId(): ?string + { + return $this->jobId; + } + + /** + * Sets Job Id. + * The id of the job performed during this shift. Square + * labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. + * + * @maps job_id + */ + public function setJobId(?string $jobId): void + { + $this->jobId = $jobId; + } + /** * Encode this object to JSON * @@ -106,6 +130,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->hourlyRate)) { $json['hourly_rate'] = $this->hourlyRate; } + if (isset($this->jobId)) { + $json['job_id'] = $this->jobId; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/SignatureImage.php b/src/Models/SignatureImage.php new file mode 100644 index 00000000..373f88b4 --- /dev/null +++ b/src/Models/SignatureImage.php @@ -0,0 +1,87 @@ +imageType; + } + + /** + * Sets Image Type. + * The mime/type of the image data. + * Use `image/png;base64` for png. + * + * @maps image_type + */ + public function setImageType(?string $imageType): void + { + $this->imageType = $imageType; + } + + /** + * Returns Data. + * The base64 representation of the image. + */ + public function getData(): ?string + { + return $this->data; + } + + /** + * Sets Data. + * The base64 representation of the image. + * + * @maps data + */ + public function setData(?string $data): void + { + $this->data = $data; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->imageType)) { + $json['image_type'] = $this->imageType; + } + if (isset($this->data)) { + $json['data'] = $this->data; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/SignatureOptions.php b/src/Models/SignatureOptions.php new file mode 100644 index 00000000..5c0bb07f --- /dev/null +++ b/src/Models/SignatureOptions.php @@ -0,0 +1,125 @@ +title = $title; + $this->body = $body; + } + + /** + * Returns Title. + * The title text to display in the signature capture flow on the Terminal. + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * Sets Title. + * The title text to display in the signature capture flow on the Terminal. + * + * @required + * @maps title + */ + public function setTitle(string $title): void + { + $this->title = $title; + } + + /** + * Returns Body. + * The body text to display in the signature capture flow on the Terminal. + */ + public function getBody(): string + { + return $this->body; + } + + /** + * Sets Body. + * The body text to display in the signature capture flow on the Terminal. + * + * @required + * @maps body + */ + public function setBody(string $body): void + { + $this->body = $body; + } + + /** + * Returns Signature. + * An image representation of the collected signature. + * + * @return SignatureImage[]|null + */ + public function getSignature(): ?array + { + return $this->signature; + } + + /** + * Sets Signature. + * An image representation of the collected signature. + * + * @maps signature + * + * @param SignatureImage[]|null $signature + */ + public function setSignature(?array $signature): void + { + $this->signature = $signature; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + $json['title'] = $this->title; + $json['body'] = $this->body; + if (isset($this->signature)) { + $json['signature'] = $this->signature; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/Subscription.php b/src/Models/Subscription.php index b813437e..98507559 100644 --- a/src/Models/Subscription.php +++ b/src/Models/Subscription.php @@ -7,11 +7,10 @@ use stdClass; /** - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ class Subscription implements \JsonSerializable { @@ -28,7 +27,7 @@ class Subscription implements \JsonSerializable /** * @var string|null */ - private $planId; + private $planVariationId; /** * @var string|null @@ -100,6 +99,11 @@ class Subscription implements \JsonSerializable */ private $actions = []; + /** + * @var Phase[]|null + */ + private $phases; + /** * Returns Id. * The Square-assigned ID of the subscription. @@ -141,23 +145,23 @@ public function setLocationId(?string $locationId): void } /** - * Returns Plan Id. - * The ID of the subscribed-to [subscription plan](entity:CatalogSubscriptionPlan). + * Returns Plan Variation Id. + * The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). */ - public function getPlanId(): ?string + public function getPlanVariationId(): ?string { - return $this->planId; + return $this->planVariationId; } /** - * Sets Plan Id. - * The ID of the subscribed-to [subscription plan](entity:CatalogSubscriptionPlan). + * Sets Plan Variation Id. + * The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). * - * @maps plan_id + * @maps plan_variation_id */ - public function setPlanId(?string $planId): void + public function setPlanVariationId(?string $planVariationId): void { - $this->planId = $planId; + $this->planVariationId = $planVariationId; } /** @@ -577,6 +581,30 @@ public function unsetActions(): void $this->actions = []; } + /** + * Returns Phases. + * array of phases for this subscription + * + * @return Phase[]|null + */ + public function getPhases(): ?array + { + return $this->phases; + } + + /** + * Sets Phases. + * array of phases for this subscription + * + * @maps phases + * + * @param Phase[]|null $phases + */ + public function setPhases(?array $phases): void + { + $this->phases = $phases; + } + /** * Encode this object to JSON * @@ -595,8 +623,8 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } - if (isset($this->planId)) { - $json['plan_id'] = $this->planId; + if (isset($this->planVariationId)) { + $json['plan_variation_id'] = $this->planVariationId; } if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; @@ -640,6 +668,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->actions)) { $json['actions'] = $this->actions['value']; } + if (isset($this->phases)) { + $json['phases'] = $this->phases; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/SubscriptionAction.php b/src/Models/SubscriptionAction.php index 361e4371..ba29b0e0 100644 --- a/src/Models/SubscriptionAction.php +++ b/src/Models/SubscriptionAction.php @@ -29,7 +29,12 @@ class SubscriptionAction implements \JsonSerializable /** * @var array */ - private $newPlanId = []; + private $phases = []; + + /** + * @var array + */ + private $newPlanVariationId = []; /** * Returns Id. @@ -104,35 +109,71 @@ public function unsetEffectiveDate(): void } /** - * Returns New Plan Id. - * The target subscription plan a subscription switches to, for a `SWAP_PLAN` action. + * Returns Phases. + * A list of Phases, to pass phase-specific information used in the swap. + * + * @return Phase[]|null */ - public function getNewPlanId(): ?string + public function getPhases(): ?array { - if (count($this->newPlanId) == 0) { + if (count($this->phases) == 0) { return null; } - return $this->newPlanId['value']; + return $this->phases['value']; } /** - * Sets New Plan Id. - * The target subscription plan a subscription switches to, for a `SWAP_PLAN` action. + * Sets Phases. + * A list of Phases, to pass phase-specific information used in the swap. + * + * @maps phases * - * @maps new_plan_id + * @param Phase[]|null $phases */ - public function setNewPlanId(?string $newPlanId): void + public function setPhases(?array $phases): void { - $this->newPlanId['value'] = $newPlanId; + $this->phases['value'] = $phases; } /** - * Unsets New Plan Id. - * The target subscription plan a subscription switches to, for a `SWAP_PLAN` action. + * Unsets Phases. + * A list of Phases, to pass phase-specific information used in the swap. */ - public function unsetNewPlanId(): void + public function unsetPhases(): void { - $this->newPlanId = []; + $this->phases = []; + } + + /** + * Returns New Plan Variation Id. + * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. + */ + public function getNewPlanVariationId(): ?string + { + if (count($this->newPlanVariationId) == 0) { + return null; + } + return $this->newPlanVariationId['value']; + } + + /** + * Sets New Plan Variation Id. + * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. + * + * @maps new_plan_variation_id + */ + public function setNewPlanVariationId(?string $newPlanVariationId): void + { + $this->newPlanVariationId['value'] = $newPlanVariationId; + } + + /** + * Unsets New Plan Variation Id. + * The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. + */ + public function unsetNewPlanVariationId(): void + { + $this->newPlanVariationId = []; } /** @@ -148,16 +189,19 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { - $json['id'] = $this->id; + $json['id'] = $this->id; } if (isset($this->type)) { - $json['type'] = $this->type; + $json['type'] = $this->type; } if (!empty($this->effectiveDate)) { - $json['effective_date'] = $this->effectiveDate['value']; + $json['effective_date'] = $this->effectiveDate['value']; + } + if (!empty($this->phases)) { + $json['phases'] = $this->phases['value']; } - if (!empty($this->newPlanId)) { - $json['new_plan_id'] = $this->newPlanId['value']; + if (!empty($this->newPlanVariationId)) { + $json['new_plan_variation_id'] = $this->newPlanVariationId['value']; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/SubscriptionEvent.php b/src/Models/SubscriptionEvent.php index 4d649d0e..0b011800 100644 --- a/src/Models/SubscriptionEvent.php +++ b/src/Models/SubscriptionEvent.php @@ -27,27 +27,36 @@ class SubscriptionEvent implements \JsonSerializable private $effectiveDate; /** - * @var string + * @var SubscriptionEventInfo|null */ - private $planId; + private $info; /** - * @var SubscriptionEventInfo|null + * @var array */ - private $info; + private $phases = []; + + /** + * @var string + */ + private $planVariationId; /** * @param string $id * @param string $subscriptionEventType * @param string $effectiveDate - * @param string $planId - */ - public function __construct(string $id, string $subscriptionEventType, string $effectiveDate, string $planId) - { + * @param string $planVariationId + */ + public function __construct( + string $id, + string $subscriptionEventType, + string $effectiveDate, + string $planVariationId + ) { $this->id = $id; $this->subscriptionEventType = $subscriptionEventType; $this->effectiveDate = $effectiveDate; - $this->planId = $planId; + $this->planVariationId = $planVariationId; } /** @@ -114,44 +123,80 @@ public function setEffectiveDate(string $effectiveDate): void } /** - * Returns Plan Id. - * The ID of the subscription plan associated with the subscription. + * Returns Info. + * Provides information about the subscription event. */ - public function getPlanId(): string + public function getInfo(): ?SubscriptionEventInfo { - return $this->planId; + return $this->info; } /** - * Sets Plan Id. - * The ID of the subscription plan associated with the subscription. + * Sets Info. + * Provides information about the subscription event. * - * @required - * @maps plan_id + * @maps info */ - public function setPlanId(string $planId): void + public function setInfo(?SubscriptionEventInfo $info): void { - $this->planId = $planId; + $this->info = $info; } /** - * Returns Info. - * Provides information about the subscription event. + * Returns Phases. + * A list of Phases, to pass phase-specific information used in the swap. + * + * @return Phase[]|null */ - public function getInfo(): ?SubscriptionEventInfo + public function getPhases(): ?array { - return $this->info; + if (count($this->phases) == 0) { + return null; + } + return $this->phases['value']; } /** - * Sets Info. - * Provides information about the subscription event. + * Sets Phases. + * A list of Phases, to pass phase-specific information used in the swap. * - * @maps info + * @maps phases + * + * @param Phase[]|null $phases */ - public function setInfo(?SubscriptionEventInfo $info): void + public function setPhases(?array $phases): void { - $this->info = $info; + $this->phases['value'] = $phases; + } + + /** + * Unsets Phases. + * A list of Phases, to pass phase-specific information used in the swap. + */ + public function unsetPhases(): void + { + $this->phases = []; + } + + /** + * Returns Plan Variation Id. + * The ID of the subscription plan variation associated with the subscription. + */ + public function getPlanVariationId(): string + { + return $this->planVariationId; + } + + /** + * Sets Plan Variation Id. + * The ID of the subscription plan variation associated with the subscription. + * + * @required + * @maps plan_variation_id + */ + public function setPlanVariationId(string $planVariationId): void + { + $this->planVariationId = $planVariationId; } /** @@ -169,10 +214,13 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) $json['id'] = $this->id; $json['subscription_event_type'] = $this->subscriptionEventType; $json['effective_date'] = $this->effectiveDate; - $json['plan_id'] = $this->planId; if (isset($this->info)) { $json['info'] = $this->info; } + if (!empty($this->phases)) { + $json['phases'] = $this->phases['value']; + } + $json['plan_variation_id'] = $this->planVariationId; $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/SubscriptionPhase.php b/src/Models/SubscriptionPhase.php index 34b6e3a3..4d85d603 100644 --- a/src/Models/SubscriptionPhase.php +++ b/src/Models/SubscriptionPhase.php @@ -7,9 +7,8 @@ use stdClass; /** - * Describes a phase in a subscription plan. For more information, see - * [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup- - * plan). + * Describes a phase in a subscription plan variation. For more information, see [Subscription Plans + * and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). */ class SubscriptionPhase implements \JsonSerializable { @@ -38,6 +37,11 @@ class SubscriptionPhase implements \JsonSerializable */ private $ordinal = []; + /** + * @var SubscriptionPricing|null + */ + private $pricing; + /** * @param string $cadence */ @@ -204,6 +208,26 @@ public function unsetOrdinal(): void $this->ordinal = []; } + /** + * Returns Pricing. + * Describes the pricing for the subscription. + */ + public function getPricing(): ?SubscriptionPricing + { + return $this->pricing; + } + + /** + * Sets Pricing. + * Describes the pricing for the subscription. + * + * @maps pricing + */ + public function setPricing(?SubscriptionPricing $pricing): void + { + $this->pricing = $pricing; + } + /** * Encode this object to JSON * @@ -229,6 +253,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (!empty($this->ordinal)) { $json['ordinal'] = $this->ordinal['value']; } + if (isset($this->pricing)) { + $json['pricing'] = $this->pricing; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/SubscriptionPricing.php b/src/Models/SubscriptionPricing.php new file mode 100644 index 00000000..e715fd14 --- /dev/null +++ b/src/Models/SubscriptionPricing.php @@ -0,0 +1,144 @@ +type; + } + + /** + * Sets Type. + * Determines the pricing of a [Subscription]($m/Subscription) + * + * @maps type + */ + public function setType(?string $type): void + { + $this->type = $type; + } + + /** + * Returns Discount Ids. + * The ids of the discount catalog objects + * + * @return string[]|null + */ + public function getDiscountIds(): ?array + { + if (count($this->discountIds) == 0) { + return null; + } + return $this->discountIds['value']; + } + + /** + * Sets Discount Ids. + * The ids of the discount catalog objects + * + * @maps discount_ids + * + * @param string[]|null $discountIds + */ + public function setDiscountIds(?array $discountIds): void + { + $this->discountIds['value'] = $discountIds; + } + + /** + * Unsets Discount Ids. + * The ids of the discount catalog objects + */ + public function unsetDiscountIds(): void + { + $this->discountIds = []; + } + + /** + * Returns Price Money. + * 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. + */ + public function getPriceMoney(): ?Money + { + return $this->priceMoney; + } + + /** + * Sets Price Money. + * 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. + * + * @maps price_money + */ + public function setPriceMoney(?Money $priceMoney): void + { + $this->priceMoney = $priceMoney; + } + + /** + * Encode this object to JSON + * + * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields + * are set. (default: false) + * + * @return array|stdClass + */ + #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1) + public function jsonSerialize(bool $asArrayWhenEmpty = false) + { + $json = []; + if (isset($this->type)) { + $json['type'] = $this->type; + } + if (!empty($this->discountIds)) { + $json['discount_ids'] = $this->discountIds['value']; + } + if (isset($this->priceMoney)) { + $json['price_money'] = $this->priceMoney; + } + $json = array_filter($json, function ($val) { + return $val !== null; + }); + + return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; + } +} diff --git a/src/Models/SubscriptionPricingType.php b/src/Models/SubscriptionPricingType.php new file mode 100644 index 00000000..10a2f1da --- /dev/null +++ b/src/Models/SubscriptionPricingType.php @@ -0,0 +1,21 @@ +name; + if (count($this->name) == 0) { + return null; + } + return $this->name['value']; } /** @@ -37,7 +40,18 @@ public function getName(): ?string */ public function setName(?string $name): void { - $this->name = $name; + $this->name['value'] = $name; + } + + /** + * Unsets Name. + * The name used to identify the place (physical or digital) that + * a subscription originates. If unset, the name defaults to the name + * of the application that created the subscription. + */ + public function unsetName(): void + { + $this->name = []; } /** @@ -52,8 +66,8 @@ public function setName(?string $name): void public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - if (isset($this->name)) { - $json['name'] = $this->name; + if (!empty($this->name)) { + $json['name'] = $this->name['value']; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/SwapPlanRequest.php b/src/Models/SwapPlanRequest.php index 7490ee3f..28bae885 100644 --- a/src/Models/SwapPlanRequest.php +++ b/src/Models/SwapPlanRequest.php @@ -13,37 +13,87 @@ class SwapPlanRequest implements \JsonSerializable { /** - * @var string + * @var array */ - private $newPlanId; + private $newPlanVariationId = []; /** - * @param string $newPlanId + * @var array */ - public function __construct(string $newPlanId) + private $phases = []; + + /** + * Returns New Plan Variation Id. + * The ID of the new subscription plan variation. + * + * This field is required. + */ + public function getNewPlanVariationId(): ?string + { + if (count($this->newPlanVariationId) == 0) { + return null; + } + return $this->newPlanVariationId['value']; + } + + /** + * Sets New Plan Variation Id. + * The ID of the new subscription plan variation. + * + * This field is required. + * + * @maps new_plan_variation_id + */ + public function setNewPlanVariationId(?string $newPlanVariationId): void + { + $this->newPlanVariationId['value'] = $newPlanVariationId; + } + + /** + * Unsets New Plan Variation Id. + * The ID of the new subscription plan variation. + * + * This field is required. + */ + public function unsetNewPlanVariationId(): void { - $this->newPlanId = $newPlanId; + $this->newPlanVariationId = []; } /** - * Returns New Plan Id. - * The ID of the new subscription plan. + * Returns Phases. + * A list of PhaseInputs, to pass phase-specific information used in the swap. + * + * @return PhaseInput[]|null */ - public function getNewPlanId(): string + public function getPhases(): ?array { - return $this->newPlanId; + if (count($this->phases) == 0) { + return null; + } + return $this->phases['value']; } /** - * Sets New Plan Id. - * The ID of the new subscription plan. + * Sets Phases. + * A list of PhaseInputs, to pass phase-specific information used in the swap. * - * @required - * @maps new_plan_id + * @maps phases + * + * @param PhaseInput[]|null $phases + */ + public function setPhases(?array $phases): void + { + $this->phases['value'] = $phases; + } + + /** + * Unsets Phases. + * A list of PhaseInputs, to pass phase-specific information used in the swap. */ - public function setNewPlanId(string $newPlanId): void + public function unsetPhases(): void { - $this->newPlanId = $newPlanId; + $this->phases = []; } /** @@ -58,7 +108,12 @@ public function setNewPlanId(string $newPlanId): void public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - $json['new_plan_id'] = $this->newPlanId; + if (!empty($this->newPlanVariationId)) { + $json['new_plan_variation_id'] = $this->newPlanVariationId['value']; + } + if (!empty($this->phases)) { + $json['phases'] = $this->phases['value']; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/SwapPlanResponse.php b/src/Models/SwapPlanResponse.php index 96e7e6f3..8b2e5c31 100644 --- a/src/Models/SwapPlanResponse.php +++ b/src/Models/SwapPlanResponse.php @@ -53,11 +53,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -66,11 +65,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/TeamMemberWage.php b/src/Models/TeamMemberWage.php index 6099d6b1..f738fbe3 100644 --- a/src/Models/TeamMemberWage.php +++ b/src/Models/TeamMemberWage.php @@ -32,6 +32,11 @@ class TeamMemberWage implements \JsonSerializable */ private $hourlyRate; + /** + * @var array + */ + private $jobId = []; + /** * Returns Id. * The UUID for this object. @@ -148,6 +153,41 @@ public function setHourlyRate(?Money $hourlyRate): void $this->hourlyRate = $hourlyRate; } + /** + * Returns Job Id. + * An identifier for the job that this wage relates to. This cannot be + * used to retrieve the job. + */ + public function getJobId(): ?string + { + if (count($this->jobId) == 0) { + return null; + } + return $this->jobId['value']; + } + + /** + * Sets Job Id. + * An identifier for the job that this wage relates to. This cannot be + * used to retrieve the job. + * + * @maps job_id + */ + public function setJobId(?string $jobId): void + { + $this->jobId['value'] = $jobId; + } + + /** + * Unsets Job Id. + * An identifier for the job that this wage relates to. This cannot be + * used to retrieve the job. + */ + public function unsetJobId(): void + { + $this->jobId = []; + } + /** * Encode this object to JSON * @@ -172,6 +212,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) if (isset($this->hourlyRate)) { $json['hourly_rate'] = $this->hourlyRate; } + if (!empty($this->jobId)) { + $json['job_id'] = $this->jobId['value']; + } $json = array_filter($json, function ($val) { return $val !== null; }); diff --git a/src/Models/TerminalAction.php b/src/Models/TerminalAction.php index b62cfdfd..6e9af8dd 100644 --- a/src/Models/TerminalAction.php +++ b/src/Models/TerminalAction.php @@ -56,21 +56,56 @@ class TerminalAction implements \JsonSerializable */ private $type; + /** + * @var QrCodeOptions|null + */ + private $qrCodeOptions; + /** * @var SaveCardOptions|null */ private $saveCardOptions; + /** + * @var SignatureOptions|null + */ + private $signatureOptions; + + /** + * @var ConfirmationOptions|null + */ + private $confirmationOptions; + /** * @var ReceiptOptions|null */ private $receiptOptions; + /** + * @var DataCollectionOptions|null + */ + private $dataCollectionOptions; + + /** + * @var SelectOptions|null + */ + private $selectOptions; + /** * @var DeviceMetadata|null */ private $deviceMetadata; + /** + * @var array + */ + private $awaitNextAction = []; + + /** + * @var array + */ + private $awaitNextActionDuration = []; + /** * Returns Id. * A unique ID for this `TerminalAction`. @@ -298,6 +333,26 @@ public function setType(?string $type): void $this->type = $type; } + /** + * Returns Qr Code Options. + * Fields to describe the action that displays QR-Codes. + */ + public function getQrCodeOptions(): ?QrCodeOptions + { + return $this->qrCodeOptions; + } + + /** + * Sets Qr Code Options. + * Fields to describe the action that displays QR-Codes. + * + * @maps qr_code_options + */ + public function setQrCodeOptions(?QrCodeOptions $qrCodeOptions): void + { + $this->qrCodeOptions = $qrCodeOptions; + } + /** * Returns Save Card Options. * Describes save-card action fields. @@ -318,6 +373,42 @@ public function setSaveCardOptions(?SaveCardOptions $saveCardOptions): void $this->saveCardOptions = $saveCardOptions; } + /** + * Returns Signature Options. + */ + public function getSignatureOptions(): ?SignatureOptions + { + return $this->signatureOptions; + } + + /** + * Sets Signature Options. + * + * @maps signature_options + */ + public function setSignatureOptions(?SignatureOptions $signatureOptions): void + { + $this->signatureOptions = $signatureOptions; + } + + /** + * Returns Confirmation Options. + */ + public function getConfirmationOptions(): ?ConfirmationOptions + { + return $this->confirmationOptions; + } + + /** + * Sets Confirmation Options. + * + * @maps confirmation_options + */ + public function setConfirmationOptions(?ConfirmationOptions $confirmationOptions): void + { + $this->confirmationOptions = $confirmationOptions; + } + /** * Returns Receipt Options. * Describes receipt action fields. @@ -338,6 +429,42 @@ public function setReceiptOptions(?ReceiptOptions $receiptOptions): void $this->receiptOptions = $receiptOptions; } + /** + * Returns Data Collection Options. + */ + public function getDataCollectionOptions(): ?DataCollectionOptions + { + return $this->dataCollectionOptions; + } + + /** + * Sets Data Collection Options. + * + * @maps data_collection_options + */ + public function setDataCollectionOptions(?DataCollectionOptions $dataCollectionOptions): void + { + $this->dataCollectionOptions = $dataCollectionOptions; + } + + /** + * Returns Select Options. + */ + public function getSelectOptions(): ?SelectOptions + { + return $this->selectOptions; + } + + /** + * Sets Select Options. + * + * @maps select_options + */ + public function setSelectOptions(?SelectOptions $selectOptions): void + { + $this->selectOptions = $selectOptions; + } + /** * Returns Device Metadata. */ @@ -356,6 +483,94 @@ public function setDeviceMetadata(?DeviceMetadata $deviceMetadata): void $this->deviceMetadata = $deviceMetadata; } + /** + * Returns Await Next Action. + * Indicates the action will be linked to another action and requires a waiting dialog to be + * displayed instead of returning to the idle screen on completion of the action. + * + * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. + */ + public function getAwaitNextAction(): ?bool + { + if (count($this->awaitNextAction) == 0) { + return null; + } + return $this->awaitNextAction['value']; + } + + /** + * Sets Await Next Action. + * Indicates the action will be linked to another action and requires a waiting dialog to be + * displayed instead of returning to the idle screen on completion of the action. + * + * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. + * + * @maps await_next_action + */ + public function setAwaitNextAction(?bool $awaitNextAction): void + { + $this->awaitNextAction['value'] = $awaitNextAction; + } + + /** + * Unsets Await Next Action. + * Indicates the action will be linked to another action and requires a waiting dialog to be + * displayed instead of returning to the idle screen on completion of the action. + * + * Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. + */ + public function unsetAwaitNextAction(): void + { + $this->awaitNextAction = []; + } + + /** + * Returns Await Next Action Duration. + * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the + * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. + * + * Default: 5 minutes from when the waiting dialog is displayed + * + * Maximum: 5 minutes + */ + public function getAwaitNextActionDuration(): ?string + { + if (count($this->awaitNextActionDuration) == 0) { + return null; + } + return $this->awaitNextActionDuration['value']; + } + + /** + * Sets Await Next Action Duration. + * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the + * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. + * + * Default: 5 minutes from when the waiting dialog is displayed + * + * Maximum: 5 minutes + * + * @maps await_next_action_duration + */ + public function setAwaitNextActionDuration(?string $awaitNextActionDuration): void + { + $this->awaitNextActionDuration['value'] = $awaitNextActionDuration; + } + + /** + * Unsets Await Next Action Duration. + * The timeout duration of the waiting dialog as an RFC 3339 duration, after which the + * waiting dialog will no longer be displayed and the Terminal will return to the idle screen. + * + * Default: 5 minutes from when the waiting dialog is displayed + * + * Maximum: 5 minutes + */ + public function unsetAwaitNextActionDuration(): void + { + $this->awaitNextActionDuration = []; + } + /** * Encode this object to JSON * @@ -369,40 +584,61 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { - $json['id'] = $this->id; + $json['id'] = $this->id; } if (!empty($this->deviceId)) { - $json['device_id'] = $this->deviceId['value']; + $json['device_id'] = $this->deviceId['value']; } if (!empty($this->deadlineDuration)) { - $json['deadline_duration'] = $this->deadlineDuration['value']; + $json['deadline_duration'] = $this->deadlineDuration['value']; } if (isset($this->status)) { - $json['status'] = $this->status; + $json['status'] = $this->status; } if (isset($this->cancelReason)) { - $json['cancel_reason'] = $this->cancelReason; + $json['cancel_reason'] = $this->cancelReason; } if (isset($this->createdAt)) { - $json['created_at'] = $this->createdAt; + $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { - $json['updated_at'] = $this->updatedAt; + $json['updated_at'] = $this->updatedAt; } if (isset($this->appId)) { - $json['app_id'] = $this->appId; + $json['app_id'] = $this->appId; } if (isset($this->type)) { - $json['type'] = $this->type; + $json['type'] = $this->type; + } + if (isset($this->qrCodeOptions)) { + $json['qr_code_options'] = $this->qrCodeOptions; } if (isset($this->saveCardOptions)) { - $json['save_card_options'] = $this->saveCardOptions; + $json['save_card_options'] = $this->saveCardOptions; + } + if (isset($this->signatureOptions)) { + $json['signature_options'] = $this->signatureOptions; + } + if (isset($this->confirmationOptions)) { + $json['confirmation_options'] = $this->confirmationOptions; } if (isset($this->receiptOptions)) { - $json['receipt_options'] = $this->receiptOptions; + $json['receipt_options'] = $this->receiptOptions; + } + if (isset($this->dataCollectionOptions)) { + $json['data_collection_options'] = $this->dataCollectionOptions; + } + if (isset($this->selectOptions)) { + $json['select_options'] = $this->selectOptions; } if (isset($this->deviceMetadata)) { - $json['device_metadata'] = $this->deviceMetadata; + $json['device_metadata'] = $this->deviceMetadata; + } + if (!empty($this->awaitNextAction)) { + $json['await_next_action'] = $this->awaitNextAction['value']; + } + if (!empty($this->awaitNextActionDuration)) { + $json['await_next_action_duration'] = $this->awaitNextActionDuration['value']; } $json = array_filter($json, function ($val) { return $val !== null; diff --git a/src/Models/TerminalActionActionType.php b/src/Models/TerminalActionActionType.php index 56355eea..f6b197a3 100644 --- a/src/Models/TerminalActionActionType.php +++ b/src/Models/TerminalActionActionType.php @@ -10,6 +10,12 @@ */ class TerminalActionActionType { + /** + * The action represents a request to display a QR code. Details are contained in + * the `qr_code_options` object. + */ + public const QR_CODE = 'QR_CODE'; + /** * The action represents a request to check if the specific device is * online or currently active with the merchant in question. Does not require an action options value. @@ -22,9 +28,33 @@ class TerminalActionActionType */ public const SAVE_CARD = 'SAVE_CARD'; + /** + * The action represents a request to capture a buyer's signature. Details are contained + * in the `signature_options` object. + */ + public const SIGNATURE = 'SIGNATURE'; + + /** + * The action represents a request to collect a buyer's confirmation decision to the + * displayed terms. Details are contained in the `confirmation_options` object. + */ + public const CONFIRMATION = 'CONFIRMATION'; + /** * The action represents a request to display the receipt screen options. Details are * contained in the `receipt_options` object. */ public const RECEIPT = 'RECEIPT'; + + /** + * The action represents a request to collect a buyer's text data. Details + * are contained in the `data_collection_options` object. + */ + public const DATA_COLLECTION = 'DATA_COLLECTION'; + + /** + * The action represents a request to allow the buyer to select from provided options. + * Details are contained in the `select_options` object. + */ + public const SELECT = 'SELECT'; } diff --git a/src/Models/UpdateSubscriptionRequest.php b/src/Models/UpdateSubscriptionRequest.php index 68a9b7cf..96e7f70c 100644 --- a/src/Models/UpdateSubscriptionRequest.php +++ b/src/Models/UpdateSubscriptionRequest.php @@ -19,11 +19,10 @@ class UpdateSubscriptionRequest implements \JsonSerializable /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -32,11 +31,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/Models/UpdateSubscriptionResponse.php b/src/Models/UpdateSubscriptionResponse.php index f6c5c741..3657ca1a 100644 --- a/src/Models/UpdateSubscriptionResponse.php +++ b/src/Models/UpdateSubscriptionResponse.php @@ -48,11 +48,10 @@ public function setErrors(?array $errors): void /** * Returns Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). */ public function getSubscription(): ?Subscription { @@ -61,11 +60,10 @@ public function getSubscription(): ?Subscription /** * Sets Subscription. - * Represents a subscription to a subscription plan by a subscriber. + * Represents a subscription purchased by a customer. * - * For an overview of the `Subscription` type, see - * [Subscription object](https://developer.squareup.com/docs/subscriptions-api/overview#subscription- - * object-overview). + * For more information, see + * [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). * * @maps subscription */ diff --git a/src/SquareClient.php b/src/SquareClient.php index 1afc5ed9..82451bc3 100644 --- a/src/SquareClient.php +++ b/src/SquareClient.php @@ -162,7 +162,7 @@ public function __construct(array $config = []) ->jsonHelper(ApiHelper::getJsonHelper()) ->apiCallback($this->config['httpCallback'] ?? null) ->userAgent( - 'Square-PHP-SDK/27.0.0.20230517 ({api-version}) {engine}/{engine-version} ({os-' . + 'Square-PHP-SDK/28.0.0.20230608 ({api-version}) {engine}/{engine-version} ({os-' . 'info}) {detail}' ) ->userAgentConfig( @@ -304,7 +304,7 @@ public function withConfiguration(array $config): self */ public function getSdkVersion(): string { - return '27.0.0.20230517'; + return '28.0.0.20230608'; } /**