From 5a9a2e54d0c88ba40306f2bbe4b4fedeecb54d6d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:29:46 +0000 Subject: [PATCH 1/2] SDK regeneration --- .fern/metadata.json | 7 +- LICENSE | 2 +- composer.json | 2 +- reference.md | 934 ++++++++++-------- src/ApplePay/ApplePayClient.php | 2 +- src/BankAccounts/BankAccountsClient.php | 127 ++- .../Requests/CreateBankAccountRequest.php | 99 ++ .../Requests/DisableBankAccountRequest.php | 41 + .../Requests/ListBankAccountsRequest.php | 27 + src/Bookings/BookingsClient.php | 2 +- .../CustomAttributeDefinitionsClient.php | 2 +- .../CustomAttributesClient.php | 2 +- .../LocationProfilesClient.php | 2 +- .../TeamMemberProfilesClient.php | 2 +- src/Cards/CardsClient.php | 2 +- src/CashDrawers/CashDrawersClient.php | 2 +- src/CashDrawers/Shifts/ShiftsClient.php | 2 +- src/Catalog/CatalogClient.php | 2 +- src/Catalog/Images/ImagesClient.php | 2 +- src/Catalog/Object/ObjectClient.php | 2 +- src/Channels/ChannelsClient.php | 2 +- src/Checkout/CheckoutClient.php | 2 +- .../PaymentLinks/PaymentLinksClient.php | 2 +- src/Core/Client/RawClient.php | 10 + src/Core/Client/RetryMiddleware.php | 81 +- src/Core/Json/JsonDeserializer.php | 4 +- src/Core/Json/JsonSerializer.php | 7 +- src/Customers/Cards/CardsClient.php | 2 +- .../CustomAttributeDefinitionsClient.php | 2 +- .../CustomAttributesClient.php | 2 +- src/Customers/CustomersClient.php | 2 +- src/Customers/Groups/GroupsClient.php | 2 +- src/Customers/Segments/SegmentsClient.php | 2 +- src/Devices/Codes/CodesClient.php | 2 +- src/Devices/DevicesClient.php | 2 +- src/Disputes/DisputesClient.php | 2 +- src/Disputes/Evidence/EvidenceClient.php | 2 +- src/Employees/EmployeesClient.php | 2 +- src/Events/EventsClient.php | 2 +- src/GiftCards/Activities/ActivitiesClient.php | 2 +- src/GiftCards/GiftCardsClient.php | 2 +- src/Inventory/InventoryClient.php | 2 +- src/Invoices/InvoicesClient.php | 2 +- src/Labor/BreakTypes/BreakTypesClient.php | 2 +- .../EmployeeWages/EmployeeWagesClient.php | 2 +- src/Labor/LaborClient.php | 2 +- src/Labor/Shifts/ShiftsClient.php | 2 +- .../TeamMemberWages/TeamMemberWagesClient.php | 2 +- .../WorkweekConfigs/WorkweekConfigsClient.php | 2 +- .../CustomAttributeDefinitionsClient.php | 2 +- .../CustomAttributesClient.php | 2 +- src/Locations/LocationsClient.php | 2 +- .../Transactions/TransactionsClient.php | 2 +- src/Loyalty/Accounts/AccountsClient.php | 2 +- src/Loyalty/LoyaltyClient.php | 2 +- src/Loyalty/Programs/ProgramsClient.php | 2 +- .../Programs/Promotions/PromotionsClient.php | 2 +- src/Loyalty/Rewards/RewardsClient.php | 2 +- .../CustomAttributeDefinitionsClient.php | 2 +- .../CustomAttributesClient.php | 2 +- src/Merchants/MerchantsClient.php | 2 +- src/Mobile/MobileClient.php | 31 +- .../CreateMobileAuthorizationCodeRequest.php | 43 - src/OAuth/OAuthClient.php | 2 +- src/OAuth/Requests/ObtainTokenRequest.php | 29 + .../CustomAttributeDefinitionsClient.php | 2 +- .../CustomAttributesClient.php | 2 +- src/Orders/OrdersClient.php | 2 +- src/Payments/PaymentsClient.php | 2 +- .../Requests/CreatePaymentRequest.php | 2 + src/Payouts/PayoutsClient.php | 2 +- src/Refunds/RefundsClient.php | 2 +- src/Sites/SitesClient.php | 2 +- src/Snippets/SnippetsClient.php | 2 +- src/SquareClient.php | 24 +- src/Subscriptions/SubscriptionsClient.php | 2 +- src/Team/TeamClient.php | 2 +- src/TeamMembers/TeamMembersClient.php | 2 +- .../WageSetting/WageSettingClient.php | 2 +- src/Terminal/Actions/ActionsClient.php | 2 +- src/Terminal/Checkouts/CheckoutsClient.php | 2 +- src/Terminal/Refunds/RefundsClient.php | 2 +- src/Terminal/TerminalClient.php | 2 +- src/TransferOrders/TransferOrdersClient.php | 2 +- src/Types/BankAccount.php | 25 + src/Types/BuyNowPayLaterDetails.php | 26 + src/Types/Card.php | 50 + src/Types/CatalogItem.php | 55 ++ src/Types/CatalogItemModifierListInfo.php | 63 +- src/Types/CatalogItemVariation.php | 30 + src/Types/CatalogModifier.php | 30 + src/Types/CatalogModifierOverride.php | 41 +- .../CatalogModifierToggleOverrideType.php | 10 + src/Types/CatalogProductSet.php | 4 +- src/Types/CreateBankAccountResponse.php | 80 ++ .../CreateMobileAuthorizationCodeResponse.php | 112 --- src/Types/DeviceCheckoutOptions.php | 30 + src/Types/DigitalWalletDetails.php | 28 +- src/Types/DisableBankAccountResponse.php | 80 ++ src/Types/ErrorCode.php | 2 + src/Types/FulfillmentDeliveryDetails.php | 27 +- src/Types/FulfillmentPickupDetails.php | 22 +- src/Types/GetBankAccountResponse.php | 40 +- src/Types/ListBankAccountsResponse.php | 40 +- src/Types/OrderCardSurchargeTreatmentType.php | 9 + src/Types/OrderLineItem.php | 8 +- src/Types/OrderLineItemAppliedTax.php | 29 + src/Types/OrderLineItemPricingBlocklists.php | 30 + ...mPricingBlocklistsBlockedServiceCharge.php | 114 +++ src/Types/OrderReturnServiceCharge.php | 30 +- src/Types/OrderServiceCharge.php | 4 +- src/Types/SearchOrdersSourceFilter.php | 60 ++ src/Types/SubscriptionTestResult.php | 72 +- src/Types/TestWebhookSubscriptionResponse.php | 106 +- src/V1Transactions/V1TransactionsClient.php | 2 +- src/Vendors/VendorsClient.php | 2 +- src/Webhooks/EventTypes/EventTypesClient.php | 2 +- .../Subscriptions/SubscriptionsClient.php | 2 +- src/Webhooks/WebhooksClient.php | 2 +- tests/Core/Client/RawClientTest.php | 227 +++++ tests/Core/Json/ExhaustiveTest.php | 2 +- tests/Core/Json/UnionArrayTest.php | 2 +- 122 files changed, 2293 insertions(+), 809 deletions(-) create mode 100644 src/BankAccounts/Requests/CreateBankAccountRequest.php create mode 100644 src/BankAccounts/Requests/DisableBankAccountRequest.php delete mode 100644 src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php create mode 100644 src/Types/CatalogModifierToggleOverrideType.php create mode 100644 src/Types/CreateBankAccountResponse.php delete mode 100644 src/Types/CreateMobileAuthorizationCodeResponse.php create mode 100644 src/Types/DisableBankAccountResponse.php create mode 100644 src/Types/OrderCardSurchargeTreatmentType.php create mode 100644 src/Types/OrderLineItemPricingBlocklistsBlockedServiceCharge.php diff --git a/.fern/metadata.json b/.fern/metadata.json index 20275927..cb079b8b 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "2.8.1", + "cliVersion": "3.38.0", "generatorName": "fernapi/fern-php-sdk", - "generatorVersion": "1.22.3", + "generatorVersion": "1.25.2", "generatorConfig": { "clientName": "SquareClient", "namespace": "Square", @@ -22,5 +22,6 @@ "apimatic/core": "~0.3.12" } } - } + }, + "sdkVersion": "44.0.0.20260122" } \ No newline at end of file diff --git a/LICENSE b/LICENSE index f5669d1d..878ffc14 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Square. +Copyright (c) 2026 Square. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index 83a0a938..aa3049f1 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "square/square", - "version": "43.3.0.20251016", + "version": "44.0.0.20260122", "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", "keywords": [ "square", diff --git a/reference.md b/reference.md index 5f2c7a4e..662f56d5 100644 --- a/reference.md +++ b/reference.md @@ -1,79 +1,6 @@ # Reference -## Mobile -
$client->mobile->authorizationCode($request) -> CreateMobileAuthorizationCodeResponse -
-
- -#### 📝 Description - -
-
- -
-
- -__Note:__ This endpoint is used by the deprecated Reader SDK. -Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. - -Generates code to authorize a mobile application to connect to a Square card reader. - -Authorization codes are one-time-use codes and expire 60 minutes after being issued. - -The `Authorization` header you provide to this endpoint must have the following format: - -``` -Authorization: Bearer ACCESS_TOKEN -``` - -Replace `ACCESS_TOKEN` with a -[valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->mobile->authorizationCode( - new CreateMobileAuthorizationCodeRequest([ - 'locationId' => 'YOUR_LOCATION_ID', - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$locationId:** `?string` — The Square location ID that the authorization code should be tied to. - -
-
-
-
- - -
-
-
- ## OAuth -
$client->oAuth->revokeToken($request) -> RevokeTokenResponse +
$client->oAuth->revokeToken($request) -> RevokeTokenResponse
@@ -182,7 +109,7 @@ Default: `false`
-
$client->oAuth->obtainToken($request) -> ObtainTokenResponse +
$client->oAuth->obtainToken($request) -> ObtainTokenResponse
@@ -383,6 +310,18 @@ provided in your authorization URL. Required for the PKCE flow if `grant_type` is `authorization_code`. +
+
+ +
+
+ +**$useJwt:** `?bool` + +Indicates whether to use a JWT (JSON Web Token) as the OAuth access token. +When set to `true`, the OAuth flow returns a JWT to your application, used in the +same way as a regular token. The default value is `false`. +
@@ -393,7 +332,7 @@ Required for the PKCE flow if `grant_type` is `authorization_code`.
-
$client->oAuth->retrieveTokenStatus() -> RetrieveTokenStatusResponse +
$client->oAuth->retrieveTokenStatus() -> RetrieveTokenStatusResponse
@@ -445,7 +384,7 @@ $client->oAuth->retrieveTokenStatus();
-
$client->oAuth->authorize() +
$client->oAuth->authorize()
@@ -471,7 +410,7 @@ $client->oAuth->authorize();
## V1Transactions -
$client->v1Transactions->v1ListOrders($request) -> array +
$client->v1Transactions->v1ListOrders($request) -> array
@@ -559,7 +498,7 @@ original query to the endpoint.
-
$client->v1Transactions->v1RetrieveOrder($request) -> V1Order +
$client->v1Transactions->v1RetrieveOrder($request) -> V1Order
@@ -626,7 +565,7 @@ $client->v1Transactions->v1RetrieveOrder(
-
$client->v1Transactions->v1UpdateOrder($request) -> V1Order +
$client->v1Transactions->v1UpdateOrder($request) -> V1Order
@@ -738,7 +677,7 @@ See [V1UpdateOrderRequestAction](#type-v1updateorderrequestaction) for possible
## ApplePay -
$client->applePay->registerDomain($request) -> RegisterDomainResponse +
$client->applePay->registerDomain($request) -> RegisterDomainResponse
@@ -810,7 +749,7 @@ $client->applePay->registerDomain(
## BankAccounts -
$client->bankAccounts->list($request) -> ListBankAccountsResponse +
$client->bankAccounts->list($request) -> ListBankAccountsResponse
@@ -842,6 +781,7 @@ $client->bankAccounts->list( 'cursor' => 'cursor', 'limit' => 1, 'locationId' => 'location_id', + 'customerId' => 'customer_id', ]), ); ``` @@ -861,7 +801,7 @@ $client->bankAccounts->list( **$cursor:** `?string` The pagination cursor returned by a previous call to this endpoint. -Use it in the next `ListBankAccounts` request to retrieve the next set +Use it in the next `ListBankAccounts` request to retrieve the next set of results. See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. @@ -874,8 +814,8 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin **$limit:** `?int` -Upper limit on the number of bank accounts to return in the response. -Currently, 1000 is the largest supported limit. You can specify a limit +Upper limit on the number of bank accounts to return in the response. +Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit.
@@ -886,9 +826,102 @@ of up to 1000 bank accounts. This is also the default limit. **$locationId:** `?string` -Location ID. You can specify this optional filter +Location ID. You can specify this optional filter to retrieve only the linked bank accounts belonging to a specific location. + +
+ +
+
+ +**$customerId:** `?string` + +Customer ID. You can specify this optional filter +to retrieve only the linked bank accounts belonging to a specific customer. + +
+
+ + + + + + +
+ +
$client->bankAccounts->createBankAccount($request) -> CreateBankAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Store a bank account on file for a square account +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->bankAccounts->createBankAccount( + new CreateBankAccountRequest([ + 'idempotencyKey' => '4e43559a-f0fd-47d3-9da2-7ea1f97d94be', + 'sourceId' => 'bnon:CA4SEHsQwr0rx6DbWLD5BQaqMnoYAQ', + 'customerId' => 'HM3B2D5JKGZ69359BTEHXM2V8M', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$idempotencyKey:** `string` + +Unique ID. For more information, see the +[Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). + +
+
+ +
+
+ +**$sourceId:** `string` + +The ID of the source that represents the bank account information to be stored. This field +accepts the payment token created by WebSDK + +
+
+ +
+
+ +**$customerId:** `?string` — The ID of the customer associated with the bank account to be stored. +
@@ -899,7 +932,7 @@ to retrieve only the linked bank accounts belonging to a specific location.
-
$client->bankAccounts->getByV1Id($request) -> GetBankAccountByV1IdResponse +
$client->bankAccounts->getByV1Id($request) -> GetBankAccountByV1IdResponse
@@ -960,7 +993,7 @@ Connect V1 ID of the desired `BankAccount`. For more information, see
-
$client->bankAccounts->get($request) -> GetBankAccountResponse +
$client->bankAccounts->get($request) -> GetBankAccountResponse
@@ -972,8 +1005,7 @@ Connect V1 ID of the desired `BankAccount`. For more information, see
-Returns details of a [BankAccount](entity:BankAccount) -linked to a Square account. +Retrieve details of a [BankAccount](entity:BankAccount) bank account linked to a Square account.
@@ -1015,12 +1047,70 @@ $client->bankAccounts->get(
+ + +
+ +
$client->bankAccounts->disableBankAccount($request) -> DisableBankAccountResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Disable a bank account. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->bankAccounts->disableBankAccount( + new DisableBankAccountRequest([ + 'bankAccountId' => 'bank_account_id', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$bankAccountId:** `string` — The ID of the bank account to disable. + +
+
+
+
+ +
## Bookings -
$client->bookings->list($request) -> ListBookingsResponse +
$client->bookings->list($request) -> ListBookingsResponse
@@ -1135,7 +1225,7 @@ $client->bookings->list(
-
$client->bookings->create($request) -> CreateBookingResponse +
$client->bookings->create($request) -> CreateBookingResponse
@@ -1214,7 +1304,7 @@ $client->bookings->create(
-
$client->bookings->searchAvailability($request) -> SearchAvailabilityResponse +
$client->bookings->searchAvailability($request) -> SearchAvailabilityResponse
@@ -1279,7 +1369,7 @@ $client->bookings->searchAvailability(
-
$client->bookings->bulkRetrieveBookings($request) -> BulkRetrieveBookingsResponse +
$client->bookings->bulkRetrieveBookings($request) -> BulkRetrieveBookingsResponse
@@ -1342,7 +1432,7 @@ $client->bookings->bulkRetrieveBookings(
-
$client->bookings->getBusinessProfile() -> GetBusinessBookingProfileResponse +
$client->bookings->getBusinessProfile() -> GetBusinessBookingProfileResponse
@@ -1381,7 +1471,7 @@ $client->bookings->getBusinessProfile();
-
$client->bookings->retrieveLocationBookingProfile($request) -> RetrieveLocationBookingProfileResponse +
$client->bookings->retrieveLocationBookingProfile($request) -> RetrieveLocationBookingProfileResponse
@@ -1439,7 +1529,7 @@ $client->bookings->retrieveLocationBookingProfile(
-
$client->bookings->bulkRetrieveTeamMemberBookingProfiles($request) -> BulkRetrieveTeamMemberBookingProfilesResponse +
$client->bookings->bulkRetrieveTeamMemberBookingProfiles($request) -> BulkRetrieveTeamMemberBookingProfilesResponse
@@ -1499,7 +1589,7 @@ $client->bookings->bulkRetrieveTeamMemberBookingProfiles(
-
$client->bookings->get($request) -> GetBookingResponse +
$client->bookings->get($request) -> GetBookingResponse
@@ -1560,7 +1650,7 @@ $client->bookings->get(
-
$client->bookings->update($request) -> UpdateBookingResponse +
$client->bookings->update($request) -> UpdateBookingResponse
@@ -1641,7 +1731,7 @@ $client->bookings->update(
-
$client->bookings->cancel($request) -> CancelBookingResponse +
$client->bookings->cancel($request) -> CancelBookingResponse
@@ -1722,7 +1812,7 @@ $client->bookings->cancel(
## Cards -
$client->cards->list($request) -> ListCardsResponse +
$client->cards->list($request) -> ListCardsResponse
@@ -1831,7 +1921,7 @@ This field defaults to ASC.
-
$client->cards->create($request) -> CreateCardResponse +
$client->cards->create($request) -> CreateCardResponse
@@ -1940,7 +2030,7 @@ See the [SCA Overview](https://developer.squareup.com/docs/sca-overview).
-
$client->cards->get($request) -> GetCardResponse +
$client->cards->get($request) -> GetCardResponse
@@ -1998,7 +2088,7 @@ $client->cards->get(
-
$client->cards->disable($request) -> DisableCardResponse +
$client->cards->disable($request) -> DisableCardResponse
@@ -2058,7 +2148,7 @@ $client->cards->disable(
## Catalog -
$client->catalog->batchDelete($request) -> BatchDeleteCatalogObjectsResponse +
$client->catalog->batchDelete($request) -> BatchDeleteCatalogObjectsResponse
@@ -2136,7 +2226,7 @@ CatalogItem will delete its CatalogItemVariation.
-
$client->catalog->batchGet($request) -> BatchGetCatalogObjectsResponse +
$client->catalog->batchGet($request) -> BatchGetCatalogObjectsResponse
@@ -2260,7 +2350,7 @@ in the response payload.
-
$client->catalog->batchUpsert($request) -> BatchUpsertCatalogObjectsResponse +
$client->catalog->batchUpsert($request) -> BatchUpsertCatalogObjectsResponse
@@ -2388,7 +2478,7 @@ be inserted or updated.
-
$client->catalog->info() -> CatalogInfoResponse +
$client->catalog->info() -> CatalogInfoResponse
@@ -2428,7 +2518,7 @@ $client->catalog->info();
-
$client->catalog->list($request) -> ListCatalogResponse +
$client->catalog->list($request) -> ListCatalogResponse
@@ -2535,7 +2625,7 @@ current version of the catalog.
-
$client->catalog->search($request) -> SearchCatalogObjectsResponse +
$client->catalog->search($request) -> SearchCatalogObjectsResponse
@@ -2708,7 +2798,7 @@ is higher than the maximum limit of 1,000, it will be ignored.
-
$client->catalog->searchItems($request) -> SearchCatalogItemsResponse +
$client->catalog->searchItems($request) -> SearchCatalogItemsResponse
@@ -2896,7 +2986,7 @@ a single call to the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItem
-
$client->catalog->updateItemModifierLists($request) -> UpdateItemModifierListsResponse +
$client->catalog->updateItemModifierLists($request) -> UpdateItemModifierListsResponse
@@ -2988,7 +3078,7 @@ At least one of `modifier_lists_to_enable` or `modifier_lists_to_disable` must b
-
$client->catalog->updateItemTaxes($request) -> UpdateItemTaxesResponse +
$client->catalog->updateItemTaxes($request) -> UpdateItemTaxesResponse
@@ -3083,7 +3173,7 @@ At least one of `taxes_to_enable` or `taxes_to_disable` must be specified.
## Channels -
$client->channels->list($request) -> ListChannelsResponse +
$client->channels->list($request) -> ListChannelsResponse
@@ -3180,7 +3270,7 @@ When not provided the returned results will be cap at 100 channels.
-
$client->channels->bulkRetrieve($request) -> BulkRetrieveChannelsResponse +
$client->channels->bulkRetrieve($request) -> BulkRetrieveChannelsResponse
@@ -3242,7 +3332,7 @@ $client->channels->bulkRetrieve(
-
$client->channels->get($request) -> RetrieveChannelResponse +
$client->channels->get($request) -> RetrieveChannelResponse
@@ -3301,7 +3391,7 @@ $client->channels->get(
## Customers -
$client->customers->list($request) -> ListCustomersResponse +
$client->customers->list($request) -> ListCustomersResponse
@@ -3422,7 +3512,7 @@ The default value is `false`.
-
$client->customers->create($request) -> CreateCustomerResponse +
$client->customers->create($request) -> CreateCustomerResponse
@@ -3634,7 +3724,7 @@ see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it
-
$client->customers->batchCreate($request) -> BulkCreateCustomersResponse +
$client->customers->batchCreate($request) -> BulkCreateCustomersResponse
@@ -3742,7 +3832,7 @@ customer profile.
-
$client->customers->bulkDeleteCustomers($request) -> BulkDeleteCustomersResponse +
$client->customers->bulkDeleteCustomers($request) -> BulkDeleteCustomersResponse
@@ -3806,7 +3896,7 @@ $client->customers->bulkDeleteCustomers(
-
$client->customers->bulkRetrieveCustomers($request) -> BulkRetrieveCustomersResponse +
$client->customers->bulkRetrieveCustomers($request) -> BulkRetrieveCustomersResponse
@@ -3870,7 +3960,7 @@ $client->customers->bulkRetrieveCustomers(
-
$client->customers->bulkUpdateCustomers($request) -> BulkUpdateCustomersResponse +
$client->customers->bulkUpdateCustomers($request) -> BulkUpdateCustomersResponse
@@ -3950,7 +4040,7 @@ update a field, specify the new value. To remove a field, specify `null`.
-
$client->customers->search($request) -> SearchCustomersResponse +
$client->customers->search($request) -> SearchCustomersResponse
@@ -4083,7 +4173,7 @@ The default value is `false`.
-
$client->customers->get($request) -> GetCustomerResponse +
$client->customers->get($request) -> GetCustomerResponse
@@ -4141,7 +4231,7 @@ $client->customers->get(
-
$client->customers->update($request) -> UpdateCustomerResponse +
$client->customers->update($request) -> UpdateCustomerResponse
@@ -4347,7 +4437,7 @@ see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it
-
$client->customers->delete($request) -> DeleteCustomerResponse +
$client->customers->delete($request) -> DeleteCustomerResponse
@@ -4421,7 +4511,7 @@ As a best practice, you should include this parameter to enable [optimistic conc
## Devices -
$client->devices->list($request) -> ListDevicesResponse +
$client->devices->list($request) -> ListDevicesResponse
@@ -4515,7 +4605,7 @@ The order in which results are listed.
-
$client->devices->get($request) -> GetDeviceResponse +
$client->devices->get($request) -> GetDeviceResponse
@@ -4574,7 +4664,7 @@ $client->devices->get(
## Disputes -
$client->disputes->list($request) -> ListDisputesResponse +
$client->disputes->list($request) -> ListDisputesResponse
@@ -4657,7 +4747,7 @@ If not specified, the endpoint returns disputes associated with all locations.
-
$client->disputes->get($request) -> GetDisputeResponse +
$client->disputes->get($request) -> GetDisputeResponse
@@ -4715,7 +4805,7 @@ $client->disputes->get(
-
$client->disputes->accept($request) -> AcceptDisputeResponse +
$client->disputes->accept($request) -> AcceptDisputeResponse
@@ -4777,7 +4867,7 @@ $client->disputes->accept(
-
$client->disputes->createEvidenceFile($request) -> CreateDisputeEvidenceFileResponse +
$client->disputes->createEvidenceFile($request) -> CreateDisputeEvidenceFileResponse
@@ -4836,7 +4926,7 @@ $client->disputes->createEvidenceFile(
-
$client->disputes->createEvidenceText($request) -> CreateDisputeEvidenceTextResponse +
$client->disputes->createEvidenceText($request) -> CreateDisputeEvidenceTextResponse
@@ -4924,7 +5014,7 @@ See [DisputeEvidenceType](#type-disputeevidencetype) for possible values
-
$client->disputes->submitEvidence($request) -> SubmitEvidenceResponse +
$client->disputes->submitEvidence($request) -> SubmitEvidenceResponse
@@ -4989,7 +5079,7 @@ $client->disputes->submitEvidence(
## Employees -
$client->employees->list($request) -> ListEmployeesResponse +
$client->employees->list($request) -> ListEmployeesResponse
@@ -5074,7 +5164,7 @@ $client->employees->list(
-
$client->employees->get($request) -> GetEmployeeResponse +
$client->employees->get($request) -> GetEmployeeResponse
@@ -5133,7 +5223,7 @@ $client->employees->get(
## Events -
$client->events->searchEvents($request) -> SearchEventsResponse +
$client->events->searchEvents($request) -> SearchEventsResponse
@@ -5215,7 +5305,7 @@ Default: 100
-
$client->events->disableEvents() -> DisableEventsResponse +
$client->events->disableEvents() -> DisableEventsResponse
@@ -5256,7 +5346,7 @@ $client->events->disableEvents();
-
$client->events->enableEvents() -> EnableEventsResponse +
$client->events->enableEvents() -> EnableEventsResponse
@@ -5295,7 +5385,7 @@ $client->events->enableEvents();
-
$client->events->listEventTypes($request) -> ListEventTypesResponse +
$client->events->listEventTypes($request) -> ListEventTypesResponse
@@ -5354,7 +5444,7 @@ $client->events->listEventTypes(
## GiftCards -
$client->giftCards->list($request) -> ListGiftCardsResponse +
$client->giftCards->list($request) -> ListGiftCardsResponse
@@ -5464,7 +5554,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/worki
-
$client->giftCards->create($request) -> CreateGiftCardResponse +
$client->giftCards->create($request) -> CreateGiftCardResponse
@@ -5569,7 +5659,7 @@ include `gan` and provide the GAN that is printed on the gift card.
-
$client->giftCards->getFromGan($request) -> GetGiftCardFromGanResponse +
$client->giftCards->getFromGan($request) -> GetGiftCardFromGanResponse
@@ -5631,7 +5721,7 @@ Square-issued gift cards have 16-digit GANs.
-
$client->giftCards->getFromNonce($request) -> GetGiftCardFromNonceResponse +
$client->giftCards->getFromNonce($request) -> GetGiftCardFromNonceResponse
@@ -5692,7 +5782,7 @@ Web Payments SDK or In-App Payments SDK.
-
$client->giftCards->linkCustomer($request) -> LinkCustomerToGiftCardResponse +
$client->giftCards->linkCustomer($request) -> LinkCustomerToGiftCardResponse
@@ -5759,7 +5849,7 @@ $client->giftCards->linkCustomer(
-
$client->giftCards->unlinkCustomer($request) -> UnlinkCustomerFromGiftCardResponse +
$client->giftCards->unlinkCustomer($request) -> UnlinkCustomerFromGiftCardResponse
@@ -5826,7 +5916,7 @@ $client->giftCards->unlinkCustomer(
-
$client->giftCards->get($request) -> GetGiftCardResponse +
$client->giftCards->get($request) -> GetGiftCardResponse
@@ -5885,7 +5975,7 @@ $client->giftCards->get(
## Inventory -
$client->inventory->deprecatedGetAdjustment($request) -> GetInventoryAdjustmentResponse +
$client->inventory->deprecatedGetAdjustment($request) -> GetInventoryAdjustmentResponse
@@ -5944,7 +6034,7 @@ $client->inventory->deprecatedGetAdjustment(
-
$client->inventory->getAdjustment($request) -> GetInventoryAdjustmentResponse +
$client->inventory->getAdjustment($request) -> GetInventoryAdjustmentResponse
@@ -6003,7 +6093,7 @@ $client->inventory->getAdjustment(
-
$client->inventory->deprecatedBatchChange($request) -> BatchChangeInventoryResponse +
$client->inventory->deprecatedBatchChange($request) -> BatchChangeInventoryResponse
@@ -6077,7 +6167,7 @@ $client->inventory->deprecatedBatchChange(
-
$client->inventory->deprecatedBatchGetChanges($request) -> BatchGetInventoryChangesResponse +
$client->inventory->deprecatedBatchGetChanges($request) -> BatchGetInventoryChangesResponse
@@ -6149,7 +6239,7 @@ $client->inventory->deprecatedBatchGetChanges(
-
$client->inventory->deprecatedBatchGetCounts($request) -> BatchGetInventoryCountsResponse +
$client->inventory->deprecatedBatchGetCounts($request) -> BatchGetInventoryCountsResponse
@@ -6214,7 +6304,7 @@ $client->inventory->deprecatedBatchGetCounts(
-
$client->inventory->batchCreateChanges($request) -> BatchChangeInventoryResponse +
$client->inventory->batchCreateChanges($request) -> BatchChangeInventoryResponse
@@ -6291,7 +6381,7 @@ $client->inventory->batchCreateChanges(
-
$client->inventory->batchGetChanges($request) -> BatchGetInventoryChangesResponse +
$client->inventory->batchGetChanges($request) -> BatchGetInventoryChangesResponse
@@ -6369,7 +6459,7 @@ $client->inventory->batchGetChanges(
-
$client->inventory->batchGetCounts($request) -> BatchGetInventoryCountsResponse +
$client->inventory->batchGetCounts($request) -> BatchGetInventoryCountsResponse
@@ -6443,7 +6533,7 @@ $client->inventory->batchGetCounts(
-
$client->inventory->deprecatedGetPhysicalCount($request) -> GetInventoryPhysicalCountResponse +
$client->inventory->deprecatedGetPhysicalCount($request) -> GetInventoryPhysicalCountResponse
@@ -6505,7 +6595,7 @@ ID of the
-
$client->inventory->getPhysicalCount($request) -> GetInventoryPhysicalCountResponse +
$client->inventory->getPhysicalCount($request) -> GetInventoryPhysicalCountResponse
@@ -6567,7 +6657,7 @@ ID of the
-
$client->inventory->getTransfer($request) -> GetInventoryTransferResponse +
$client->inventory->getTransfer($request) -> GetInventoryTransferResponse
@@ -6626,7 +6716,7 @@ $client->inventory->getTransfer(
-
$client->inventory->get($request) -> GetInventoryCountResponse +
$client->inventory->get($request) -> GetInventoryCountResponse
@@ -6713,7 +6803,7 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin
-
$client->inventory->changes($request) -> GetInventoryChangesResponse +
$client->inventory->changes($request) -> GetInventoryChangesResponse
@@ -6810,7 +6900,7 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin
## Invoices -
$client->invoices->list($request) -> ListInvoicesResponse +
$client->invoices->list($request) -> ListInvoicesResponse
@@ -6896,7 +6986,7 @@ If not provided, the server uses a default limit of 100 invoices.
-
$client->invoices->create($request) -> CreateInvoiceResponse +
$client->invoices->create($request) -> CreateInvoiceResponse
@@ -7019,7 +7109,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->invoices->search($request) -> SearchInvoicesResponse +
$client->invoices->search($request) -> SearchInvoicesResponse
@@ -7121,7 +7211,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->invoices->get($request) -> GetInvoiceResponse +
$client->invoices->get($request) -> GetInvoiceResponse
@@ -7179,7 +7269,7 @@ $client->invoices->get(
-
$client->invoices->update($request) -> UpdateInvoiceResponse +
$client->invoices->update($request) -> UpdateInvoiceResponse
@@ -7289,7 +7379,7 @@ recommend using null values or the `remove` field when possible. For examples, s
-
$client->invoices->delete($request) -> DeleteInvoiceResponse +
$client->invoices->delete($request) -> DeleteInvoiceResponse
@@ -7362,7 +7452,7 @@ If you do not know the version, you can call [GetInvoice](api-endpoint:Invoices-
-
$client->invoices->createInvoiceAttachment($request) -> CreateInvoiceAttachmentResponse +
$client->invoices->createInvoiceAttachment($request) -> CreateInvoiceAttachmentResponse
@@ -7427,7 +7517,7 @@ $client->invoices->createInvoiceAttachment(
-
$client->invoices->deleteInvoiceAttachment($request) -> DeleteInvoiceAttachmentResponse +
$client->invoices->deleteInvoiceAttachment($request) -> DeleteInvoiceAttachmentResponse
@@ -7495,7 +7585,7 @@ $client->invoices->deleteInvoiceAttachment(
-
$client->invoices->cancel($request) -> CancelInvoiceResponse +
$client->invoices->cancel($request) -> CancelInvoiceResponse
@@ -7569,7 +7659,7 @@ If you do not know the version, you can call
-
$client->invoices->publish($request) -> PublishInvoiceResponse +
$client->invoices->publish($request) -> PublishInvoiceResponse
@@ -7668,7 +7758,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
## Labor -
$client->labor->createScheduledShift($request) -> CreateScheduledShiftResponse +
$client->labor->createScheduledShift($request) -> CreateScheduledShiftResponse
@@ -7764,7 +7854,7 @@ shift location specified in `location_id`. Example for Pacific Standard Time: 20
-
$client->labor->bulkPublishScheduledShifts($request) -> BulkPublishScheduledShiftsResponse +
$client->labor->bulkPublishScheduledShifts($request) -> BulkPublishScheduledShiftsResponse
@@ -7849,7 +7939,7 @@ See [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudienc
-
$client->labor->searchScheduledShifts($request) -> SearchScheduledShiftsResponse +
$client->labor->searchScheduledShifts($request) -> SearchScheduledShiftsResponse
@@ -7938,7 +8028,7 @@ information, see [Pagination](https://developer.squareup.com/docs/build-basics/c
-
$client->labor->retrieveScheduledShift($request) -> RetrieveScheduledShiftResponse +
$client->labor->retrieveScheduledShift($request) -> RetrieveScheduledShiftResponse
@@ -7996,7 +8086,7 @@ $client->labor->retrieveScheduledShift(
-
$client->labor->updateScheduledShift($request) -> UpdateScheduledShiftResponse +
$client->labor->updateScheduledShift($request) -> UpdateScheduledShiftResponse
@@ -8097,7 +8187,7 @@ omitted, Square executes a blind write, potentially overwriting data from anothe
-
$client->labor->publishScheduledShift($request) -> PublishScheduledShiftResponse +
$client->labor->publishScheduledShift($request) -> PublishScheduledShiftResponse
@@ -8195,7 +8285,7 @@ See [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudienc
-
$client->labor->createTimecard($request) -> CreateTimecardResponse +
$client->labor->createTimecard($request) -> CreateTimecardResponse
@@ -8306,7 +8396,7 @@ $client->labor->createTimecard(
-
$client->labor->searchTimecards($request) -> SearchTimecardsResponse +
$client->labor->searchTimecards($request) -> SearchTimecardsResponse
@@ -8405,7 +8495,7 @@ $client->labor->searchTimecards(
-
$client->labor->retrieveTimecard($request) -> RetrieveTimecardResponse +
$client->labor->retrieveTimecard($request) -> RetrieveTimecardResponse
@@ -8463,7 +8553,7 @@ $client->labor->retrieveTimecard(
-
$client->labor->updateTimecard($request) -> UpdateTimecardResponse +
$client->labor->updateTimecard($request) -> UpdateTimecardResponse
@@ -8566,7 +8656,7 @@ $client->labor->updateTimecard(
-
$client->labor->deleteTimecard($request) -> DeleteTimecardResponse +
$client->labor->deleteTimecard($request) -> DeleteTimecardResponse
@@ -8625,7 +8715,7 @@ $client->labor->deleteTimecard(
## Locations -
$client->locations->list() -> ListLocationsResponse +
$client->locations->list() -> ListLocationsResponse
@@ -8665,7 +8755,7 @@ $client->locations->list();
-
$client->locations->create($request) -> CreateLocationResponse +
$client->locations->create($request) -> CreateLocationResponse
@@ -8742,7 +8832,7 @@ The remaining fields are automatically added based on the data from the [main lo
-
$client->locations->get($request) -> GetLocationResponse +
$client->locations->get($request) -> GetLocationResponse
@@ -8804,7 +8894,7 @@ The ID of the location to retrieve. Specify the string
-
$client->locations->update($request) -> UpdateLocationResponse +
$client->locations->update($request) -> UpdateLocationResponse
@@ -8892,7 +8982,7 @@ $client->locations->update(
-
$client->locations->checkouts($request) -> CreateCheckoutResponse +
$client->locations->checkouts($request) -> CreateCheckoutResponse
@@ -9181,7 +9271,7 @@ This value cannot exceed 60 characters.
## Loyalty -
$client->loyalty->searchEvents($request) -> SearchLoyaltyEventsResponse +
$client->loyalty->searchEvents($request) -> SearchLoyaltyEventsResponse
@@ -9283,7 +9373,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
## Merchants -
$client->merchants->list($request) -> ListMerchantsResponse +
$client->merchants->list($request) -> ListMerchantsResponse
@@ -9350,7 +9440,7 @@ $client->merchants->list(
-
$client->merchants->get($request) -> GetMerchantResponse +
$client->merchants->get($request) -> GetMerchantResponse
@@ -9412,7 +9502,7 @@ then retrieve the merchant that is currently accessible to this call.
## Checkout -
$client->checkout->retrieveLocationSettings($request) -> RetrieveLocationSettingsResponse +
$client->checkout->retrieveLocationSettings($request) -> RetrieveLocationSettingsResponse
@@ -9470,7 +9560,7 @@ $client->checkout->retrieveLocationSettings(
-
$client->checkout->updateLocationSettings($request) -> UpdateLocationSettingsResponse +
$client->checkout->updateLocationSettings($request) -> UpdateLocationSettingsResponse
@@ -9537,7 +9627,7 @@ $client->checkout->updateLocationSettings(
-
$client->checkout->retrieveMerchantSettings() -> RetrieveMerchantSettingsResponse +
$client->checkout->retrieveMerchantSettings() -> RetrieveMerchantSettingsResponse
@@ -9576,7 +9666,7 @@ $client->checkout->retrieveMerchantSettings();
-
$client->checkout->updateMerchantSettings($request) -> UpdateMerchantSettingsResponse +
$client->checkout->updateMerchantSettings($request) -> UpdateMerchantSettingsResponse
@@ -9635,7 +9725,7 @@ $client->checkout->updateMerchantSettings(
## Orders -
$client->orders->create($request) -> CreateOrderResponse +
$client->orders->create($request) -> CreateOrderResponse
@@ -9757,7 +9847,7 @@ $client->orders->create(
-
$client->orders->batchGet($request) -> BatchGetOrdersResponse +
$client->orders->batchGet($request) -> BatchGetOrdersResponse
@@ -9832,7 +9922,7 @@ orders within the scope of the current authorization's merchant ID.
-
$client->orders->calculate($request) -> CalculateOrderResponse +
$client->orders->calculate($request) -> CalculateOrderResponse
@@ -9931,7 +10021,7 @@ random strings used only to reference the reward tier.
-
$client->orders->clone($request) -> CloneOrderResponse +
$client->orders->clone($request) -> CloneOrderResponse
@@ -10022,7 +10112,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->orders->search($request) -> SearchOrdersResponse +
$client->orders->search($request) -> SearchOrdersResponse
@@ -10175,7 +10265,7 @@ Default: `false`.
-
$client->orders->get($request) -> GetOrderResponse +
$client->orders->get($request) -> GetOrderResponse
@@ -10233,7 +10323,7 @@ $client->orders->get(
-
$client->orders->update($request) -> UpdateOrderResponse +
$client->orders->update($request) -> UpdateOrderResponse
@@ -10365,7 +10455,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->orders->pay($request) -> PayOrderResponse +
$client->orders->pay($request) -> PayOrderResponse
@@ -10475,7 +10565,7 @@ The payment total must match the order total.
## Payments -
$client->payments->list($request) -> ListPaymentsResponse +
$client->payments->list($request) -> ListPaymentsResponse
@@ -10713,7 +10803,7 @@ range is determined using the `updated_at` field for each Payment.
-
$client->payments->create($request) -> CreatePaymentResponse +
$client->payments->create($request) -> CreatePaymentResponse
@@ -10837,6 +10927,8 @@ The amount must be specified in the smallest denomination of the applicable curr (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). +Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges. + The currency code must match the currency associated with the business that is accepting the payment. @@ -11115,7 +11207,7 @@ internal 1st-party callers only.
-
$client->payments->cancelByIdempotencyKey($request) -> CancelPaymentByIdempotencyKeyResponse +
$client->payments->cancelByIdempotencyKey($request) -> CancelPaymentByIdempotencyKeyResponse
@@ -11183,7 +11275,7 @@ $client->payments->cancelByIdempotencyKey(
-
$client->payments->get($request) -> GetPaymentResponse +
$client->payments->get($request) -> GetPaymentResponse
@@ -11241,7 +11333,7 @@ $client->payments->get(
-
$client->payments->update($request) -> UpdatePaymentResponse +
$client->payments->update($request) -> UpdatePaymentResponse
@@ -11333,7 +11425,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->payments->cancel($request) -> CancelPaymentResponse +
$client->payments->cancel($request) -> CancelPaymentResponse
@@ -11392,7 +11484,7 @@ $client->payments->cancel(
-
$client->payments->complete($request) -> CompletePaymentResponse +
$client->payments->complete($request) -> CompletePaymentResponse
@@ -11466,7 +11558,7 @@ the update fails and a response with a VERSION_MISMATCH error is returned.
## Payouts -
$client->payouts->list($request) -> ListPayoutsResponse +
$client->payouts->list($request) -> ListPayoutsResponse
@@ -11600,7 +11692,7 @@ Default: `100`
-
$client->payouts->get($request) -> GetPayoutResponse +
$client->payouts->get($request) -> GetPayoutResponse
@@ -11659,7 +11751,7 @@ $client->payouts->get(
-
$client->payouts->listEntries($request) -> ListPayoutEntriesResponse +
$client->payouts->listEntries($request) -> ListPayoutEntriesResponse
@@ -11757,7 +11849,7 @@ Default: `100`
## Refunds -
$client->refunds->list($request) -> ListPaymentRefundsResponse +
$client->refunds->list($request) -> ListPaymentRefundsResponse
@@ -11962,7 +12054,7 @@ Default: The current time.
-
$client->refunds->refundPayment($request) -> RefundPaymentResponse +
$client->refunds->refundPayment($request) -> RefundPaymentResponse
@@ -12193,7 +12285,7 @@ Additional details required when recording an unlinked external refund
-
$client->refunds->get($request) -> GetPaymentRefundResponse +
$client->refunds->get($request) -> GetPaymentRefundResponse
@@ -12252,7 +12344,7 @@ $client->refunds->get(
## Sites -
$client->sites->list() -> ListSitesResponse +
$client->sites->list() -> ListSitesResponse
@@ -12295,7 +12387,7 @@ $client->sites->list();
## Snippets -
$client->snippets->get($request) -> GetSnippetResponse +
$client->snippets->get($request) -> GetSnippetResponse
@@ -12358,7 +12450,7 @@ $client->snippets->get(
-
$client->snippets->upsert($request) -> UpsertSnippetResponse +
$client->snippets->upsert($request) -> UpsertSnippetResponse
@@ -12433,7 +12525,7 @@ $client->snippets->upsert(
-
$client->snippets->delete($request) -> DeleteSnippetResponse +
$client->snippets->delete($request) -> DeleteSnippetResponse
@@ -12497,7 +12589,7 @@ $client->snippets->delete(
## Subscriptions -
$client->subscriptions->create($request) -> CreateSubscriptionResponse +
$client->subscriptions->create($request) -> CreateSubscriptionResponse
@@ -12709,7 +12801,7 @@ a list of time zones, see [List of tz database time zones](https://en.wikipedia.
-
$client->subscriptions->bulkSwapPlan($request) -> BulkSwapPlanResponse +
$client->subscriptions->bulkSwapPlan($request) -> BulkSwapPlanResponse
@@ -12794,7 +12886,7 @@ day.
-
$client->subscriptions->search($request) -> SearchSubscriptionsResponse +
$client->subscriptions->search($request) -> SearchSubscriptionsResponse
@@ -12920,7 +13012,7 @@ The supported values are:
-
$client->subscriptions->get($request) -> GetSubscriptionResponse +
$client->subscriptions->get($request) -> GetSubscriptionResponse
@@ -12993,7 +13085,7 @@ The supported query parameter values are:
-
$client->subscriptions->update($request) -> UpdateSubscriptionResponse +
$client->subscriptions->update($request) -> UpdateSubscriptionResponse
@@ -13067,7 +13159,7 @@ be treated as a request to clear the relevant data.
-
$client->subscriptions->deleteAction($request) -> DeleteSubscriptionActionResponse +
$client->subscriptions->deleteAction($request) -> DeleteSubscriptionActionResponse
@@ -13134,7 +13226,7 @@ $client->subscriptions->deleteAction(
-
$client->subscriptions->changeBillingAnchorDate($request) -> ChangeBillingAnchorDateResponse +
$client->subscriptions->changeBillingAnchorDate($request) -> ChangeBillingAnchorDateResponse
@@ -13216,7 +13308,7 @@ is changed immediately.
-
$client->subscriptions->cancel($request) -> CancelSubscriptionResponse +
$client->subscriptions->cancel($request) -> CancelSubscriptionResponse
@@ -13276,7 +13368,7 @@ $client->subscriptions->cancel(
-
$client->subscriptions->listEvents($request) -> ListSubscriptionEventsResponse +
$client->subscriptions->listEvents($request) -> ListSubscriptionEventsResponse
@@ -13361,7 +13453,7 @@ in a paged response.
-
$client->subscriptions->pause($request) -> PauseSubscriptionResponse +
$client->subscriptions->pause($request) -> PauseSubscriptionResponse
@@ -13477,7 +13569,7 @@ See [ChangeTiming](#type-changetiming) for possible values
-
$client->subscriptions->resume($request) -> ResumeSubscriptionResponse +
$client->subscriptions->resume($request) -> ResumeSubscriptionResponse
@@ -13555,7 +13647,7 @@ See [ChangeTiming](#type-changetiming) for possible values
-
$client->subscriptions->swapPlan($request) -> SwapPlanResponse +
$client->subscriptions->swapPlan($request) -> SwapPlanResponse
@@ -13642,7 +13734,7 @@ This field is required.
## TeamMembers -
$client->teamMembers->create($request) -> CreateTeamMemberResponse +
$client->teamMembers->create($request) -> CreateTeamMemberResponse
@@ -13742,7 +13834,7 @@ $client->teamMembers->create(
-
$client->teamMembers->batchCreate($request) -> BatchCreateTeamMembersResponse +
$client->teamMembers->batchCreate($request) -> BatchCreateTeamMembersResponse
@@ -13840,7 +13932,7 @@ call [ListJobs](api-endpoint:Team-ListJobs).
-
$client->teamMembers->batchUpdate($request) -> BatchUpdateTeamMembersResponse +
$client->teamMembers->batchUpdate($request) -> BatchUpdateTeamMembersResponse
@@ -13942,7 +14034,7 @@ call [ListJobs](api-endpoint:Team-ListJobs) to get the required `job_id` values.
-
$client->teamMembers->search($request) -> SearchTeamMembersResponse +
$client->teamMembers->search($request) -> SearchTeamMembersResponse
@@ -14029,7 +14121,7 @@ The opaque cursor for fetching the next page. For more information, see
-
$client->teamMembers->get($request) -> GetTeamMemberResponse +
$client->teamMembers->get($request) -> GetTeamMemberResponse
@@ -14088,7 +14180,7 @@ $client->teamMembers->get(
-
$client->teamMembers->update($request) -> UpdateTeamMemberResponse +
$client->teamMembers->update($request) -> UpdateTeamMemberResponse
@@ -14195,7 +14287,7 @@ $client->teamMembers->update(
## Team -
$client->team->listJobs($request) -> ListJobsResponse +
$client->team->listJobs($request) -> ListJobsResponse
@@ -14257,7 +14349,7 @@ see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-pat
-
$client->team->createJob($request) -> CreateJobResponse +
$client->team->createJob($request) -> CreateJobResponse
@@ -14332,7 +14424,7 @@ but must be unique for each request. For more information, see
-
$client->team->retrieveJob($request) -> RetrieveJobResponse +
$client->team->retrieveJob($request) -> RetrieveJobResponse
@@ -14390,7 +14482,7 @@ $client->team->retrieveJob(
-
$client->team->updateJob($request) -> UpdateJobResponse +
$client->team->updateJob($request) -> UpdateJobResponse
@@ -14466,7 +14558,7 @@ to be included in the request. Optionally include `version` to enable optimistic
## Terminal -
$client->terminal->dismissTerminalAction($request) -> DismissTerminalActionResponse +
$client->terminal->dismissTerminalAction($request) -> DismissTerminalActionResponse
@@ -14526,7 +14618,7 @@ $client->terminal->dismissTerminalAction(
-
$client->terminal->dismissTerminalCheckout($request) -> DismissTerminalCheckoutResponse +
$client->terminal->dismissTerminalCheckout($request) -> DismissTerminalCheckoutResponse
@@ -14584,7 +14676,7 @@ $client->terminal->dismissTerminalCheckout(
-
$client->terminal->dismissTerminalRefund($request) -> DismissTerminalRefundResponse +
$client->terminal->dismissTerminalRefund($request) -> DismissTerminalRefundResponse
@@ -14643,7 +14735,7 @@ $client->terminal->dismissTerminalRefund(
## TransferOrders -
$client->transferOrders->create($request) -> CreateTransferOrderResponse +
$client->transferOrders->create($request) -> CreateTransferOrderResponse
@@ -14749,7 +14841,7 @@ any valid string but must be unique for every CreateTransferOrder request.
-
$client->transferOrders->search($request) -> SearchTransferOrdersResponse +
$client->transferOrders->search($request) -> SearchTransferOrdersResponse
@@ -14848,7 +14940,7 @@ $client->transferOrders->search(
-
$client->transferOrders->get($request) -> RetrieveTransferOrderResponse +
$client->transferOrders->get($request) -> RetrieveTransferOrderResponse
@@ -14912,7 +15004,7 @@ $client->transferOrders->get(
-
$client->transferOrders->update($request) -> UpdateTransferOrderResponse +
$client->transferOrders->update($request) -> UpdateTransferOrderResponse
@@ -15020,7 +15112,7 @@ $client->transferOrders->update(
-
$client->transferOrders->delete($request) -> DeleteTransferOrderResponse +
$client->transferOrders->delete($request) -> DeleteTransferOrderResponse
@@ -15091,7 +15183,7 @@ $client->transferOrders->delete(
-
$client->transferOrders->cancel($request) -> CancelTransferOrderResponse +
$client->transferOrders->cancel($request) -> CancelTransferOrderResponse
@@ -15179,7 +15271,7 @@ any valid string but must be unique for every UpdateTransferOrder request.
-
$client->transferOrders->receive($request) -> ReceiveTransferOrderResponse +
$client->transferOrders->receive($request) -> ReceiveTransferOrderResponse
@@ -15228,13 +15320,13 @@ $client->transferOrders->receive( 'receipt' => new TransferOrderGoodsReceipt([ 'lineItems' => [ new TransferOrderGoodsReceiptLineItem([ - 'transferOrderLineUid' => 'transfer_order_line_uid', + 'transferOrderLineUid' => '1', 'quantityReceived' => '3', 'quantityDamaged' => '1', 'quantityCanceled' => '1', ]), new TransferOrderGoodsReceiptLineItem([ - 'transferOrderLineUid' => 'transfer_order_line_uid', + 'transferOrderLineUid' => '2', 'quantityReceived' => '2', 'quantityCanceled' => '1', ]), @@ -15293,7 +15385,7 @@ $client->transferOrders->receive(
-
$client->transferOrders->start($request) -> StartTransferOrderResponse +
$client->transferOrders->start($request) -> StartTransferOrderResponse
@@ -15380,7 +15472,7 @@ any valid string but must be unique for every UpdateTransferOrder request.
## Vendors -
$client->vendors->batchCreate($request) -> BatchCreateVendorsResponse +
$client->vendors->batchCreate($request) -> BatchCreateVendorsResponse
@@ -15460,7 +15552,7 @@ $client->vendors->batchCreate(
-
$client->vendors->batchGet($request) -> BatchGetVendorsResponse +
$client->vendors->batchGet($request) -> BatchGetVendorsResponse
@@ -15520,7 +15612,7 @@ $client->vendors->batchGet(
-
$client->vendors->batchUpdate($request) -> BatchUpdateVendorsResponse +
$client->vendors->batchUpdate($request) -> BatchUpdateVendorsResponse
@@ -15588,7 +15680,7 @@ objects. The set is represented by a collection of `Vendor`-ID/`UpdateVendorReq
-
$client->vendors->create($request) -> CreateVendorResponse +
$client->vendors->create($request) -> CreateVendorResponse
@@ -15681,7 +15773,7 @@ information.
-
$client->vendors->search($request) -> SearchVendorsResponse +
$client->vendors->search($request) -> SearchVendorsResponse
@@ -15758,7 +15850,7 @@ See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagin
-
$client->vendors->get($request) -> GetVendorResponse +
$client->vendors->get($request) -> GetVendorResponse
@@ -15816,7 +15908,7 @@ $client->vendors->get(
-
$client->vendors->update($request) -> UpdateVendorResponse +
$client->vendors->update($request) -> UpdateVendorResponse
@@ -15887,12 +15979,38 @@ $client->vendors->update(
+ + +
+ +## Mobile +
$client->mobile->authorizationCode() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->mobile->authorizationCode(); +``` +
+
+
+
+ +
## Bookings CustomAttributeDefinitions -
$client->bookings->customAttributeDefinitions->list($request) -> ListBookingCustomAttributeDefinitionsResponse +
$client->bookings->customAttributeDefinitions->list($request) -> ListBookingCustomAttributeDefinitionsResponse
@@ -15970,7 +16088,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->bookings->customAttributeDefinitions->create($request) -> CreateBookingCustomAttributeDefinitionResponse +
$client->bookings->customAttributeDefinitions->create($request) -> CreateBookingCustomAttributeDefinitionResponse
@@ -16061,7 +16179,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->bookings->customAttributeDefinitions->get($request) -> RetrieveBookingCustomAttributeDefinitionResponse +
$client->bookings->customAttributeDefinitions->get($request) -> RetrieveBookingCustomAttributeDefinitionResponse
@@ -16139,7 +16257,7 @@ is higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->bookings->customAttributeDefinitions->update($request) -> UpdateBookingCustomAttributeDefinitionResponse +
$client->bookings->customAttributeDefinitions->update($request) -> UpdateBookingCustomAttributeDefinitionResponse
@@ -16236,7 +16354,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->bookings->customAttributeDefinitions->delete($request) -> DeleteBookingCustomAttributeDefinitionResponse +
$client->bookings->customAttributeDefinitions->delete($request) -> DeleteBookingCustomAttributeDefinitionResponse
@@ -16301,7 +16419,7 @@ $client->bookings->customAttributeDefinitions->delete(
## Bookings CustomAttributes -
$client->bookings->customAttributes->batchDelete($request) -> BulkDeleteBookingCustomAttributesResponse +
$client->bookings->customAttributes->batchDelete($request) -> BulkDeleteBookingCustomAttributesResponse
@@ -16374,7 +16492,7 @@ information needed to delete a custom attribute.
-
$client->bookings->customAttributes->batchUpsert($request) -> BulkUpsertBookingCustomAttributesResponse +
$client->bookings->customAttributes->batchUpsert($request) -> BulkUpsertBookingCustomAttributesResponse
@@ -16447,7 +16565,7 @@ information needed to create or update a custom attribute.
-
$client->bookings->customAttributes->list($request) -> ListBookingCustomAttributesResponse +
$client->bookings->customAttributes->list($request) -> ListBookingCustomAttributesResponse
@@ -16547,7 +16665,7 @@ attribute, information about the data type, or other definition details. The def
-
$client->bookings->customAttributes->get($request) -> RetrieveBookingCustomAttributeResponse +
$client->bookings->customAttributes->get($request) -> RetrieveBookingCustomAttributeResponse
@@ -16648,7 +16766,7 @@ higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->bookings->customAttributes->upsert($request) -> UpsertBookingCustomAttributeResponse +
$client->bookings->customAttributes->upsert($request) -> UpsertBookingCustomAttributeResponse
@@ -16754,7 +16872,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->bookings->customAttributes->delete($request) -> DeleteBookingCustomAttributeResponse +
$client->bookings->customAttributes->delete($request) -> DeleteBookingCustomAttributeResponse
@@ -16832,7 +16950,7 @@ definition owner, you must use the qualified key.
## Bookings LocationProfiles -
$client->bookings->locationProfiles->list($request) -> ListLocationBookingProfilesResponse +
$client->bookings->locationProfiles->list($request) -> ListLocationBookingProfilesResponse
@@ -16900,7 +17018,7 @@ $client->bookings->locationProfiles->list(
## Bookings TeamMemberProfiles -
$client->bookings->teamMemberProfiles->list($request) -> ListTeamMemberBookingProfilesResponse +
$client->bookings->teamMemberProfiles->list($request) -> ListTeamMemberBookingProfilesResponse
@@ -16985,7 +17103,7 @@ $client->bookings->teamMemberProfiles->list(
-
$client->bookings->teamMemberProfiles->get($request) -> GetTeamMemberBookingProfileResponse +
$client->bookings->teamMemberProfiles->get($request) -> GetTeamMemberBookingProfileResponse
@@ -17044,7 +17162,7 @@ $client->bookings->teamMemberProfiles->get(
## CashDrawers Shifts -
$client->cashDrawers->shifts->list($request) -> ListCashDrawerShiftsResponse +
$client->cashDrawers->shifts->list($request) -> ListCashDrawerShiftsResponse
@@ -17154,7 +17272,7 @@ default, 1000 max).
-
$client->cashDrawers->shifts->get($request) -> GetCashDrawerShiftResponse +
$client->cashDrawers->shifts->get($request) -> GetCashDrawerShiftResponse
@@ -17222,7 +17340,7 @@ $client->cashDrawers->shifts->get(
-
$client->cashDrawers->shifts->listEvents($request) -> ListCashDrawerShiftEventsResponse +
$client->cashDrawers->shifts->listEvents($request) -> ListCashDrawerShiftEventsResponse
@@ -17311,7 +17429,7 @@ default, 1000 max).
## Catalog Images -
$client->catalog->images->create($request) -> CreateCatalogImageResponse +
$client->catalog->images->create($request) -> CreateCatalogImageResponse
@@ -17357,7 +17475,7 @@ $client->catalog->images->create(
-
$client->catalog->images->update($request) -> UpdateCatalogImageResponse +
$client->catalog->images->update($request) -> UpdateCatalogImageResponse
@@ -17419,7 +17537,7 @@ $client->catalog->images->update(
## Catalog Object -
$client->catalog->object->upsert($request) -> UpsertCatalogObjectResponse +
$client->catalog->object->upsert($request) -> UpsertCatalogObjectResponse
@@ -17508,7 +17626,7 @@ A CatalogObject to be created or updated.
-
$client->catalog->object->get($request) -> GetCatalogObjectResponse +
$client->catalog->object->get($request) -> GetCatalogObjectResponse
@@ -17624,7 +17742,7 @@ in the response payload.
-
$client->catalog->object->delete($request) -> DeleteCatalogObjectResponse +
$client->catalog->object->delete($request) -> DeleteCatalogObjectResponse
@@ -17696,7 +17814,7 @@ catalog item will delete its catalog item variations).
## Checkout PaymentLinks -
$client->checkout->paymentLinks->list($request) -> ListPaymentLinksResponse +
$client->checkout->paymentLinks->list($request) -> ListPaymentLinksResponse
@@ -17774,7 +17892,7 @@ Default value: `100`
-
$client->checkout->paymentLinks->create($request) -> CreatePaymentLinkResponse +
$client->checkout->paymentLinks->create($request) -> CreatePaymentLinkResponse
@@ -17912,7 +18030,7 @@ For more information, see [Prepopulate the shipping address](https://developer.s
-
$client->checkout->paymentLinks->get($request) -> GetPaymentLinkResponse +
$client->checkout->paymentLinks->get($request) -> GetPaymentLinkResponse
@@ -17970,7 +18088,7 @@ $client->checkout->paymentLinks->get(
-
$client->checkout->paymentLinks->update($request) -> UpdatePaymentLinkResponse +
$client->checkout->paymentLinks->update($request) -> UpdatePaymentLinkResponse
@@ -18047,7 +18165,7 @@ For more information, see [Update a payment link](https://developer.squareup.com
-
$client->checkout->paymentLinks->delete($request) -> DeletePaymentLinkResponse +
$client->checkout->paymentLinks->delete($request) -> DeletePaymentLinkResponse
@@ -18106,7 +18224,7 @@ $client->checkout->paymentLinks->delete(
## Customers CustomAttributeDefinitions -
$client->customers->customAttributeDefinitions->list($request) -> ListCustomerCustomAttributeDefinitionsResponse +
$client->customers->customAttributeDefinitions->list($request) -> ListCustomerCustomAttributeDefinitionsResponse
@@ -18186,7 +18304,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->customers->customAttributeDefinitions->create($request) -> CreateCustomerCustomAttributeDefinitionResponse +
$client->customers->customAttributeDefinitions->create($request) -> CreateCustomerCustomAttributeDefinitionResponse
@@ -18280,7 +18398,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->customers->customAttributeDefinitions->get($request) -> GetCustomerCustomAttributeDefinitionResponse +
$client->customers->customAttributeDefinitions->get($request) -> GetCustomerCustomAttributeDefinitionResponse
@@ -18359,7 +18477,7 @@ is higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->customers->customAttributeDefinitions->update($request) -> UpdateCustomerCustomAttributeDefinitionResponse +
$client->customers->customAttributeDefinitions->update($request) -> UpdateCustomerCustomAttributeDefinitionResponse
@@ -18462,7 +18580,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->customers->customAttributeDefinitions->delete($request) -> DeleteCustomerCustomAttributeDefinitionResponse +
$client->customers->customAttributeDefinitions->delete($request) -> DeleteCustomerCustomAttributeDefinitionResponse
@@ -18525,7 +18643,7 @@ $client->customers->customAttributeDefinitions->delete(
-
$client->customers->customAttributeDefinitions->batchUpsert($request) -> BatchUpsertCustomerCustomAttributesResponse +
$client->customers->customAttributeDefinitions->batchUpsert($request) -> BatchUpsertCustomerCustomAttributesResponse
@@ -18637,7 +18755,7 @@ information needed to create or update a custom attribute.
## Customers Groups -
$client->customers->groups->list($request) -> ListCustomerGroupsResponse +
$client->customers->groups->list($request) -> ListCustomerGroupsResponse
@@ -18714,7 +18832,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->customers->groups->create($request) -> CreateCustomerGroupResponse +
$client->customers->groups->create($request) -> CreateCustomerGroupResponse
@@ -18784,7 +18902,7 @@ $client->customers->groups->create(
-
$client->customers->groups->get($request) -> GetCustomerGroupResponse +
$client->customers->groups->get($request) -> GetCustomerGroupResponse
@@ -18842,7 +18960,7 @@ $client->customers->groups->get(
-
$client->customers->groups->update($request) -> UpdateCustomerGroupResponse +
$client->customers->groups->update($request) -> UpdateCustomerGroupResponse
@@ -18911,7 +19029,7 @@ $client->customers->groups->update(
-
$client->customers->groups->delete($request) -> DeleteCustomerGroupResponse +
$client->customers->groups->delete($request) -> DeleteCustomerGroupResponse
@@ -18969,7 +19087,7 @@ $client->customers->groups->delete(
-
$client->customers->groups->add($request) -> AddGroupToCustomerResponse +
$client->customers->groups->add($request) -> AddGroupToCustomerResponse
@@ -19039,7 +19157,7 @@ $client->customers->groups->add(
-
$client->customers->groups->remove($request) -> RemoveGroupFromCustomerResponse +
$client->customers->groups->remove($request) -> RemoveGroupFromCustomerResponse
@@ -19110,7 +19228,7 @@ $client->customers->groups->remove(
## Customers Segments -
$client->customers->segments->list($request) -> ListCustomerSegmentsResponse +
$client->customers->segments->list($request) -> ListCustomerSegmentsResponse
@@ -19187,7 +19305,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->customers->segments->get($request) -> GetCustomerSegmentResponse +
$client->customers->segments->get($request) -> GetCustomerSegmentResponse
@@ -19246,7 +19364,7 @@ $client->customers->segments->get(
## Customers Cards -
$client->customers->cards->create($request) -> CreateCustomerCardResponse +
$client->customers->cards->create($request) -> CreateCustomerCardResponse
@@ -19369,7 +19487,7 @@ challenge results to indicate that Square has verified the buyer identity.
-
$client->customers->cards->delete($request) -> DeleteCustomerCardResponse +
$client->customers->cards->delete($request) -> DeleteCustomerCardResponse
@@ -19437,7 +19555,7 @@ $client->customers->cards->delete(
## Customers CustomAttributes -
$client->customers->customAttributes->list($request) -> ListCustomerCustomAttributesResponse +
$client->customers->customAttributes->list($request) -> ListCustomerCustomAttributesResponse
@@ -19541,7 +19659,7 @@ attribute, information about the data type, or other definition details. The def
-
$client->customers->customAttributes->get($request) -> GetCustomerCustomAttributeResponse +
$client->customers->customAttributes->get($request) -> GetCustomerCustomAttributeResponse
@@ -19646,7 +19764,7 @@ higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->customers->customAttributes->upsert($request) -> UpsertCustomerCustomAttributeResponse +
$client->customers->customAttributes->upsert($request) -> UpsertCustomerCustomAttributeResponse
@@ -19756,7 +19874,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->customers->customAttributes->delete($request) -> DeleteCustomerCustomAttributeResponse +
$client->customers->customAttributes->delete($request) -> DeleteCustomerCustomAttributeResponse
@@ -19832,7 +19950,7 @@ definition owner, you must use the qualified key.
## Devices Codes -
$client->devices->codes->list($request) -> ListDeviceCodesResponse +
$client->devices->codes->list($request) -> ListDeviceCodesResponse
@@ -19931,7 +20049,7 @@ Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.
-
$client->devices->codes->create($request) -> CreateDeviceCodeResponse +
$client->devices->codes->create($request) -> CreateDeviceCodeResponse
@@ -20008,7 +20126,7 @@ See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-a
-
$client->devices->codes->get($request) -> GetDeviceCodeResponse +
$client->devices->codes->get($request) -> GetDeviceCodeResponse
@@ -20067,7 +20185,7 @@ $client->devices->codes->get(
## Disputes Evidence -
$client->disputes->evidence->list($request) -> ListDisputeEvidenceResponse +
$client->disputes->evidence->list($request) -> ListDisputeEvidenceResponse
@@ -20138,7 +20256,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->disputes->evidence->get($request) -> GetDisputeEvidenceResponse +
$client->disputes->evidence->get($request) -> GetDisputeEvidenceResponse
@@ -20207,7 +20325,7 @@ $client->disputes->evidence->get(
-
$client->disputes->evidence->delete($request) -> DeleteDisputeEvidenceResponse +
$client->disputes->evidence->delete($request) -> DeleteDisputeEvidenceResponse
@@ -20276,7 +20394,7 @@ $client->disputes->evidence->delete(
## GiftCards Activities -
$client->giftCards->activities->list($request) -> ListGiftCardActivitiesResponse +
$client->giftCards->activities->list($request) -> ListGiftCardActivitiesResponse
@@ -20429,7 +20547,7 @@ The order in which the endpoint returns the activities, based on `created_at`.
-
$client->giftCards->activities->create($request) -> CreateGiftCardActivityResponse +
$client->giftCards->activities->create($request) -> CreateGiftCardActivityResponse
@@ -20509,7 +20627,7 @@ gift card, the `location_id` where the activity occurred, and the activity `type
## Labor BreakTypes -
$client->labor->breakTypes->list($request) -> ListBreakTypesResponse +
$client->labor->breakTypes->list($request) -> ListBreakTypesResponse
@@ -20591,7 +20709,7 @@ and 200. The default is 200.
-
$client->labor->breakTypes->create($request) -> CreateBreakTypeResponse +
$client->labor->breakTypes->create($request) -> CreateBreakTypeResponse
@@ -20676,7 +20794,7 @@ $client->labor->breakTypes->create(
-
$client->labor->breakTypes->get($request) -> GetBreakTypeResponse +
$client->labor->breakTypes->get($request) -> GetBreakTypeResponse
@@ -20734,7 +20852,7 @@ $client->labor->breakTypes->get(
-
$client->labor->breakTypes->update($request) -> UpdateBreakTypeResponse +
$client->labor->breakTypes->update($request) -> UpdateBreakTypeResponse
@@ -20807,7 +20925,7 @@ $client->labor->breakTypes->update(
-
$client->labor->breakTypes->delete($request) -> DeleteBreakTypeResponse +
$client->labor->breakTypes->delete($request) -> DeleteBreakTypeResponse
@@ -20868,7 +20986,7 @@ $client->labor->breakTypes->delete(
## Labor EmployeeWages -
$client->labor->employeeWages->list($request) -> ListEmployeeWagesResponse +
$client->labor->employeeWages->list($request) -> ListEmployeeWagesResponse
@@ -20947,7 +21065,7 @@ The maximum number of `EmployeeWage` results to return per page. The number can
-
$client->labor->employeeWages->get($request) -> GetEmployeeWageResponse +
$client->labor->employeeWages->get($request) -> GetEmployeeWageResponse
@@ -21006,7 +21124,7 @@ $client->labor->employeeWages->get(
## Labor Shifts -
$client->labor->shifts->create($request) -> CreateShiftResponse +
$client->labor->shifts->create($request) -> CreateShiftResponse
@@ -21117,7 +21235,7 @@ $client->labor->shifts->create(
-
$client->labor->shifts->search($request) -> SearchShiftsResponse +
$client->labor->shifts->search($request) -> SearchShiftsResponse
@@ -21216,7 +21334,7 @@ $client->labor->shifts->search(
-
$client->labor->shifts->get($request) -> GetShiftResponse +
$client->labor->shifts->get($request) -> GetShiftResponse
@@ -21274,7 +21392,7 @@ $client->labor->shifts->get(
-
$client->labor->shifts->update($request) -> UpdateShiftResponse +
$client->labor->shifts->update($request) -> UpdateShiftResponse
@@ -21376,7 +21494,7 @@ $client->labor->shifts->update(
-
$client->labor->shifts->delete($request) -> DeleteShiftResponse +
$client->labor->shifts->delete($request) -> DeleteShiftResponse
@@ -21435,7 +21553,7 @@ $client->labor->shifts->delete(
## Labor TeamMemberWages -
$client->labor->teamMemberWages->list($request) -> ListTeamMemberWagesResponse +
$client->labor->teamMemberWages->list($request) -> ListTeamMemberWagesResponse
@@ -21517,7 +21635,7 @@ The maximum number of `TeamMemberWage` results to return per page. The number ca
-
$client->labor->teamMemberWages->get($request) -> GetTeamMemberWageResponse +
$client->labor->teamMemberWages->get($request) -> GetTeamMemberWageResponse
@@ -21576,7 +21694,7 @@ $client->labor->teamMemberWages->get(
## Labor WorkweekConfigs -
$client->labor->workweekConfigs->list($request) -> ListWorkweekConfigsResponse +
$client->labor->workweekConfigs->list($request) -> ListWorkweekConfigsResponse
@@ -21643,7 +21761,7 @@ $client->labor->workweekConfigs->list(
-
$client->labor->workweekConfigs->get($request) -> UpdateWorkweekConfigResponse +
$client->labor->workweekConfigs->get($request) -> UpdateWorkweekConfigResponse
@@ -21715,7 +21833,7 @@ $client->labor->workweekConfigs->get(
## Locations CustomAttributeDefinitions -
$client->locations->customAttributeDefinitions->list($request) -> ListLocationCustomAttributeDefinitionsResponse +
$client->locations->customAttributeDefinitions->list($request) -> ListLocationCustomAttributeDefinitionsResponse
@@ -21802,7 +21920,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->locations->customAttributeDefinitions->create($request) -> CreateLocationCustomAttributeDefinitionResponse +
$client->locations->customAttributeDefinitions->create($request) -> CreateLocationCustomAttributeDefinitionResponse
@@ -21891,7 +22009,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->locations->customAttributeDefinitions->get($request) -> RetrieveLocationCustomAttributeDefinitionResponse +
$client->locations->customAttributeDefinitions->get($request) -> RetrieveLocationCustomAttributeDefinitionResponse
@@ -21968,7 +22086,7 @@ is higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->locations->customAttributeDefinitions->update($request) -> UpdateLocationCustomAttributeDefinitionResponse +
$client->locations->customAttributeDefinitions->update($request) -> UpdateLocationCustomAttributeDefinitionResponse
@@ -22067,7 +22185,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->locations->customAttributeDefinitions->delete($request) -> DeleteLocationCustomAttributeDefinitionResponse +
$client->locations->customAttributeDefinitions->delete($request) -> DeleteLocationCustomAttributeDefinitionResponse
@@ -22129,7 +22247,7 @@ $client->locations->customAttributeDefinitions->delete(
## Locations CustomAttributes -
$client->locations->customAttributes->batchDelete($request) -> BulkDeleteLocationCustomAttributesResponse +
$client->locations->customAttributes->batchDelete($request) -> BulkDeleteLocationCustomAttributesResponse
@@ -22202,7 +22320,7 @@ The keys must be unique and are used to map to the corresponding response.
-
$client->locations->customAttributes->batchUpsert($request) -> BulkUpsertLocationCustomAttributesResponse +
$client->locations->customAttributes->batchUpsert($request) -> BulkUpsertLocationCustomAttributesResponse
@@ -22295,7 +22413,7 @@ information needed to create or update a custom attribute.
-
$client->locations->customAttributes->list($request) -> ListLocationCustomAttributesResponse +
$client->locations->customAttributes->list($request) -> ListLocationCustomAttributesResponse
@@ -22406,7 +22524,7 @@ attribute, information about the data type, or other definition details. The def
-
$client->locations->customAttributes->get($request) -> RetrieveLocationCustomAttributeResponse +
$client->locations->customAttributes->get($request) -> RetrieveLocationCustomAttributeResponse
@@ -22508,7 +22626,7 @@ higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->locations->customAttributes->upsert($request) -> UpsertLocationCustomAttributeResponse +
$client->locations->customAttributes->upsert($request) -> UpsertLocationCustomAttributeResponse
@@ -22613,7 +22731,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->locations->customAttributes->delete($request) -> DeleteLocationCustomAttributeResponse +
$client->locations->customAttributes->delete($request) -> DeleteLocationCustomAttributeResponse
@@ -22687,7 +22805,7 @@ definition owner, you must use the qualified key.
## Locations Transactions -
$client->locations->transactions->list($request) -> ListTransactionsResponse +
$client->locations->transactions->list($request) -> ListTransactionsResponse
@@ -22808,7 +22926,7 @@ See [Paginating results](https://developer.squareup.com/docs/working-with-apis/p
-
$client->locations->transactions->get($request) -> GetTransactionResponse +
$client->locations->transactions->get($request) -> GetTransactionResponse
@@ -22875,7 +22993,7 @@ $client->locations->transactions->get(
-
$client->locations->transactions->capture($request) -> CaptureTransactionResponse +
$client->locations->transactions->capture($request) -> CaptureTransactionResponse
@@ -22947,7 +23065,7 @@ $client->locations->transactions->capture(
-
$client->locations->transactions->void($request) -> VoidTransactionResponse +
$client->locations->transactions->void($request) -> VoidTransactionResponse
@@ -23020,7 +23138,7 @@ $client->locations->transactions->void(
## Loyalty Accounts -
$client->loyalty->accounts->create($request) -> CreateLoyaltyAccountResponse +
$client->loyalty->accounts->create($request) -> CreateLoyaltyAccountResponse
@@ -23095,7 +23213,7 @@ Keys can be any valid string, but must be unique for every request.
-
$client->loyalty->accounts->search($request) -> SearchLoyaltyAccountsResponse +
$client->loyalty->accounts->search($request) -> SearchLoyaltyAccountsResponse
@@ -23187,7 +23305,7 @@ see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-pat
-
$client->loyalty->accounts->get($request) -> GetLoyaltyAccountResponse +
$client->loyalty->accounts->get($request) -> GetLoyaltyAccountResponse
@@ -23245,7 +23363,7 @@ $client->loyalty->accounts->get(
-
$client->loyalty->accounts->accumulatePoints($request) -> AccumulateLoyaltyPointsResponse +
$client->loyalty->accounts->accumulatePoints($request) -> AccumulateLoyaltyPointsResponse
@@ -23352,7 +23470,7 @@ Keys can be any valid string but must be unique for every request.
-
$client->loyalty->accounts->adjust($request) -> AdjustLoyaltyPointsResponse +
$client->loyalty->accounts->adjust($request) -> AdjustLoyaltyPointsResponse
@@ -23454,7 +23572,7 @@ the specified number of points would result in a negative balance. The default v
## Loyalty Programs -
$client->loyalty->programs->list() -> ListLoyaltyProgramsResponse +
$client->loyalty->programs->list() -> ListLoyaltyProgramsResponse
@@ -23497,7 +23615,7 @@ $client->loyalty->programs->list();
-
$client->loyalty->programs->get($request) -> GetLoyaltyProgramResponse +
$client->loyalty->programs->get($request) -> GetLoyaltyProgramResponse
@@ -23557,7 +23675,7 @@ $client->loyalty->programs->get(
-
$client->loyalty->programs->calculate($request) -> CalculateLoyaltyPointsResponse +
$client->loyalty->programs->calculate($request) -> CalculateLoyaltyPointsResponse
@@ -23673,7 +23791,7 @@ for regardless of the trigger limit.
## Loyalty Rewards -
$client->loyalty->rewards->create($request) -> CreateLoyaltyRewardResponse +
$client->loyalty->rewards->create($request) -> CreateLoyaltyRewardResponse
@@ -23754,7 +23872,7 @@ Keys can be any valid string, but must be unique for every request.
-
$client->loyalty->rewards->search($request) -> SearchLoyaltyRewardsResponse +
$client->loyalty->rewards->search($request) -> SearchLoyaltyRewardsResponse
@@ -23846,7 +23964,7 @@ see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-pat
-
$client->loyalty->rewards->get($request) -> GetLoyaltyRewardResponse +
$client->loyalty->rewards->get($request) -> GetLoyaltyRewardResponse
@@ -23904,7 +24022,7 @@ $client->loyalty->rewards->get(
-
$client->loyalty->rewards->delete($request) -> DeleteLoyaltyRewardResponse +
$client->loyalty->rewards->delete($request) -> DeleteLoyaltyRewardResponse
@@ -23970,7 +24088,7 @@ $client->loyalty->rewards->delete(
-
$client->loyalty->rewards->redeem($request) -> RedeemLoyaltyRewardResponse +
$client->loyalty->rewards->redeem($request) -> RedeemLoyaltyRewardResponse
@@ -24060,7 +24178,7 @@ Keys can be any valid string, but must be unique for every request.
## Loyalty Programs Promotions -
$client->loyalty->programs->promotions->list($request) -> ListLoyaltyPromotionsResponse +
$client->loyalty->programs->promotions->list($request) -> ListLoyaltyPromotionsResponse
@@ -24161,7 +24279,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->loyalty->programs->promotions->create($request) -> CreateLoyaltyPromotionResponse +
$client->loyalty->programs->promotions->create($request) -> CreateLoyaltyPromotionResponse
@@ -24279,7 +24397,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->loyalty->programs->promotions->get($request) -> GetLoyaltyPromotionResponse +
$client->loyalty->programs->promotions->get($request) -> GetLoyaltyPromotionResponse
@@ -24349,7 +24467,7 @@ call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using
-
$client->loyalty->programs->promotions->cancel($request) -> CancelLoyaltyPromotionResponse +
$client->loyalty->programs->promotions->cancel($request) -> CancelLoyaltyPromotionResponse
@@ -24425,7 +24543,7 @@ promotion that has an `ACTIVE` or `SCHEDULED` status.
## Merchants CustomAttributeDefinitions -
$client->merchants->customAttributeDefinitions->list($request) -> ListMerchantCustomAttributeDefinitionsResponse +
$client->merchants->customAttributeDefinitions->list($request) -> ListMerchantCustomAttributeDefinitionsResponse
@@ -24512,7 +24630,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/build
-
$client->merchants->customAttributeDefinitions->create($request) -> CreateMerchantCustomAttributeDefinitionResponse +
$client->merchants->customAttributeDefinitions->create($request) -> CreateMerchantCustomAttributeDefinitionResponse
@@ -24601,7 +24719,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->merchants->customAttributeDefinitions->get($request) -> RetrieveMerchantCustomAttributeDefinitionResponse +
$client->merchants->customAttributeDefinitions->get($request) -> RetrieveMerchantCustomAttributeDefinitionResponse
@@ -24678,7 +24796,7 @@ is higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->merchants->customAttributeDefinitions->update($request) -> UpdateMerchantCustomAttributeDefinitionResponse +
$client->merchants->customAttributeDefinitions->update($request) -> UpdateMerchantCustomAttributeDefinitionResponse
@@ -24776,7 +24894,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->merchants->customAttributeDefinitions->delete($request) -> DeleteMerchantCustomAttributeDefinitionResponse +
$client->merchants->customAttributeDefinitions->delete($request) -> DeleteMerchantCustomAttributeDefinitionResponse
@@ -24838,7 +24956,7 @@ $client->merchants->customAttributeDefinitions->delete(
## Merchants CustomAttributes -
$client->merchants->customAttributes->batchDelete($request) -> BulkDeleteMerchantCustomAttributesResponse +
$client->merchants->customAttributes->batchDelete($request) -> BulkDeleteMerchantCustomAttributesResponse
@@ -24908,7 +25026,7 @@ The keys must be unique and are used to map to the corresponding response.
-
$client->merchants->customAttributes->batchUpsert($request) -> BulkUpsertMerchantCustomAttributesResponse +
$client->merchants->customAttributes->batchUpsert($request) -> BulkUpsertMerchantCustomAttributesResponse
@@ -24994,7 +25112,7 @@ information needed to create or update a custom attribute.
-
$client->merchants->customAttributes->list($request) -> ListMerchantCustomAttributesResponse +
$client->merchants->customAttributes->list($request) -> ListMerchantCustomAttributesResponse
@@ -25105,7 +25223,7 @@ attribute, information about the data type, or other definition details. The def
-
$client->merchants->customAttributes->get($request) -> RetrieveMerchantCustomAttributeResponse +
$client->merchants->customAttributes->get($request) -> RetrieveMerchantCustomAttributeResponse
@@ -25207,7 +25325,7 @@ higher than the current version, Square returns a `BAD_REQUEST` error.
-
$client->merchants->customAttributes->upsert($request) -> UpsertMerchantCustomAttributeResponse +
$client->merchants->customAttributes->upsert($request) -> UpsertMerchantCustomAttributeResponse
@@ -25312,7 +25430,7 @@ see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-pa
-
$client->merchants->customAttributes->delete($request) -> DeleteMerchantCustomAttributeResponse +
$client->merchants->customAttributes->delete($request) -> DeleteMerchantCustomAttributeResponse
@@ -25386,7 +25504,7 @@ definition owner, you must use the qualified key.
## Orders CustomAttributeDefinitions -
$client->orders->customAttributeDefinitions->list($request) -> ListOrderCustomAttributeDefinitionsResponse +
$client->orders->customAttributeDefinitions->list($request) -> ListOrderCustomAttributeDefinitionsResponse
@@ -25476,7 +25594,7 @@ For more information, see [Pagination](https://developer.squareup.com/docs/worki
-
$client->orders->customAttributeDefinitions->create($request) -> CreateOrderCustomAttributeDefinitionResponse +
$client->orders->customAttributeDefinitions->create($request) -> CreateOrderCustomAttributeDefinitionResponse
@@ -25565,7 +25683,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->orders->customAttributeDefinitions->get($request) -> RetrieveOrderCustomAttributeDefinitionResponse +
$client->orders->customAttributeDefinitions->get($request) -> RetrieveOrderCustomAttributeDefinitionResponse
@@ -25639,7 +25757,7 @@ control, include this optional field and specify the current version of the cust
-
$client->orders->customAttributeDefinitions->update($request) -> UpdateOrderCustomAttributeDefinitionResponse +
$client->orders->customAttributeDefinitions->update($request) -> UpdateOrderCustomAttributeDefinitionResponse
@@ -25730,7 +25848,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->orders->customAttributeDefinitions->delete($request) -> DeleteOrderCustomAttributeDefinitionResponse +
$client->orders->customAttributeDefinitions->delete($request) -> DeleteOrderCustomAttributeDefinitionResponse
@@ -25791,7 +25909,7 @@ $client->orders->customAttributeDefinitions->delete(
## Orders CustomAttributes -
$client->orders->customAttributes->batchDelete($request) -> BulkDeleteOrderCustomAttributesResponse +
$client->orders->customAttributes->batchDelete($request) -> BulkDeleteOrderCustomAttributesResponse
@@ -25871,7 +25989,7 @@ $client->orders->customAttributes->batchDelete(
-
$client->orders->customAttributes->batchUpsert($request) -> BulkUpsertOrderCustomAttributesResponse +
$client->orders->customAttributes->batchUpsert($request) -> BulkUpsertOrderCustomAttributesResponse
@@ -25959,7 +26077,7 @@ $client->orders->customAttributes->batchUpsert(
-
$client->orders->customAttributes->list($request) -> ListOrderCustomAttributesResponse +
$client->orders->customAttributes->list($request) -> ListOrderCustomAttributesResponse
@@ -26073,7 +26191,7 @@ information about the data type, or other definition details. The default value
-
$client->orders->customAttributes->get($request) -> RetrieveOrderCustomAttributeResponse +
$client->orders->customAttributes->get($request) -> RetrieveOrderCustomAttributeResponse
@@ -26175,7 +26293,7 @@ information about the data type, or other definition details. The default value
-
$client->orders->customAttributes->upsert($request) -> UpsertOrderCustomAttributeResponse +
$client->orders->customAttributes->upsert($request) -> UpsertOrderCustomAttributeResponse
@@ -26285,7 +26403,7 @@ For more information, see [Idempotency](https://developer.squareup.com/docs/buil
-
$client->orders->customAttributes->delete($request) -> DeleteOrderCustomAttributeResponse +
$client->orders->customAttributes->delete($request) -> DeleteOrderCustomAttributeResponse
@@ -26360,7 +26478,7 @@ existing custom attribute definition.
## TeamMembers WageSetting -
$client->teamMembers->wageSetting->get($request) -> GetWageSettingResponse +
$client->teamMembers->wageSetting->get($request) -> GetWageSettingResponse
@@ -26423,7 +26541,7 @@ $client->teamMembers->wageSetting->get(
-
$client->teamMembers->wageSetting->update($request) -> UpdateWageSettingResponse +
$client->teamMembers->wageSetting->update($request) -> UpdateWageSettingResponse
@@ -26525,7 +26643,7 @@ This value is ignored if `job_id` is also provided.
## Terminal Actions -
$client->terminal->actions->create($request) -> CreateTerminalActionResponse +
$client->terminal->actions->create($request) -> CreateTerminalActionResponse
@@ -26606,7 +26724,7 @@ information.
-
$client->terminal->actions->search($request) -> SearchTerminalActionsResponse +
$client->terminal->actions->search($request) -> SearchTerminalActionsResponse
@@ -26698,7 +26816,7 @@ information.
-
$client->terminal->actions->get($request) -> GetTerminalActionResponse +
$client->terminal->actions->get($request) -> GetTerminalActionResponse
@@ -26756,7 +26874,7 @@ $client->terminal->actions->get(
-
$client->terminal->actions->cancel($request) -> CancelTerminalActionResponse +
$client->terminal->actions->cancel($request) -> CancelTerminalActionResponse
@@ -26815,7 +26933,7 @@ $client->terminal->actions->cancel(
## Terminal Checkouts -
$client->terminal->checkouts->create($request) -> CreateTerminalCheckoutResponse +
$client->terminal->checkouts->create($request) -> CreateTerminalCheckoutResponse
@@ -26898,7 +27016,7 @@ See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-a
-
$client->terminal->checkouts->search($request) -> SearchTerminalCheckoutsResponse +
$client->terminal->checkouts->search($request) -> SearchTerminalCheckoutsResponse
@@ -26984,7 +27102,7 @@ See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-pat
-
$client->terminal->checkouts->get($request) -> GetTerminalCheckoutResponse +
$client->terminal->checkouts->get($request) -> GetTerminalCheckoutResponse
@@ -27042,7 +27160,7 @@ $client->terminal->checkouts->get(
-
$client->terminal->checkouts->cancel($request) -> CancelTerminalCheckoutResponse +
$client->terminal->checkouts->cancel($request) -> CancelTerminalCheckoutResponse
@@ -27101,7 +27219,7 @@ $client->terminal->checkouts->cancel(
## Terminal Refunds -
$client->terminal->refunds->create($request) -> CreateTerminalRefundResponse +
$client->terminal->refunds->create($request) -> CreateTerminalRefundResponse
@@ -27181,7 +27299,7 @@ See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-a
-
$client->terminal->refunds->search($request) -> SearchTerminalRefundsResponse +
$client->terminal->refunds->search($request) -> SearchTerminalRefundsResponse
@@ -27267,7 +27385,7 @@ Provide this cursor to retrieve the next set of results for the original query.
-
$client->terminal->refunds->get($request) -> GetTerminalRefundResponse +
$client->terminal->refunds->get($request) -> GetTerminalRefundResponse
@@ -27325,7 +27443,7 @@ $client->terminal->refunds->get(
-
$client->terminal->refunds->cancel($request) -> CancelTerminalRefundResponse +
$client->terminal->refunds->cancel($request) -> CancelTerminalRefundResponse
@@ -27384,7 +27502,7 @@ $client->terminal->refunds->cancel(
## Webhooks EventTypes -
$client->webhooks->eventTypes->list($request) -> ListWebhookEventTypesResponse +
$client->webhooks->eventTypes->list($request) -> ListWebhookEventTypesResponse
@@ -27443,7 +27561,7 @@ $client->webhooks->eventTypes->list(
## Webhooks Subscriptions -
$client->webhooks->subscriptions->list($request) -> ListWebhookSubscriptionsResponse +
$client->webhooks->subscriptions->list($request) -> ListWebhookSubscriptionsResponse
@@ -27545,7 +27663,7 @@ Default: 100
-
$client->webhooks->subscriptions->create($request) -> CreateWebhookSubscriptionResponse +
$client->webhooks->subscriptions->create($request) -> CreateWebhookSubscriptionResponse
@@ -27620,7 +27738,7 @@ $client->webhooks->subscriptions->create(
-
$client->webhooks->subscriptions->get($request) -> GetWebhookSubscriptionResponse +
$client->webhooks->subscriptions->get($request) -> GetWebhookSubscriptionResponse
@@ -27678,7 +27796,7 @@ $client->webhooks->subscriptions->get(
-
$client->webhooks->subscriptions->update($request) -> UpdateWebhookSubscriptionResponse +
$client->webhooks->subscriptions->update($request) -> UpdateWebhookSubscriptionResponse
@@ -27748,7 +27866,7 @@ $client->webhooks->subscriptions->update(
-
$client->webhooks->subscriptions->delete($request) -> DeleteWebhookSubscriptionResponse +
$client->webhooks->subscriptions->delete($request) -> DeleteWebhookSubscriptionResponse
@@ -27806,7 +27924,7 @@ $client->webhooks->subscriptions->delete(
-
$client->webhooks->subscriptions->updateSignatureKey($request) -> UpdateWebhookSubscriptionSignatureKeyResponse +
$client->webhooks->subscriptions->updateSignatureKey($request) -> UpdateWebhookSubscriptionSignatureKeyResponse
@@ -27873,7 +27991,7 @@ $client->webhooks->subscriptions->updateSignatureKey(
-
$client->webhooks->subscriptions->test($request) -> TestWebhookSubscriptionResponse +
$client->webhooks->subscriptions->test($request) -> TestWebhookSubscriptionResponse
diff --git a/src/ApplePay/ApplePayClient.php b/src/ApplePay/ApplePayClient.php index c9baba06..ec987646 100644 --- a/src/ApplePay/ApplePayClient.php +++ b/src/ApplePay/ApplePayClient.php @@ -24,7 +24,7 @@ class ApplePayClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/BankAccounts/BankAccountsClient.php b/src/BankAccounts/BankAccountsClient.php index b050feba..8ff2ebfe 100644 --- a/src/BankAccounts/BankAccountsClient.php +++ b/src/BankAccounts/BankAccountsClient.php @@ -9,8 +9,8 @@ use Square\Types\BankAccount; use Square\Core\Pagination\CursorPager; use Square\Types\ListBankAccountsResponse; -use Square\BankAccounts\Requests\GetByV1IdBankAccountsRequest; -use Square\Types\GetBankAccountByV1IdResponse; +use Square\BankAccounts\Requests\CreateBankAccountRequest; +use Square\Types\CreateBankAccountResponse; use Square\Exceptions\SquareException; use Square\Exceptions\SquareApiException; use Square\Core\Json\JsonApiRequest; @@ -19,8 +19,12 @@ use JsonException; use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; +use Square\BankAccounts\Requests\GetByV1IdBankAccountsRequest; +use Square\Types\GetBankAccountByV1IdResponse; use Square\BankAccounts\Requests\GetBankAccountsRequest; use Square\Types\GetBankAccountResponse; +use Square\BankAccounts\Requests\DisableBankAccountRequest; +use Square\Types\DisableBankAccountResponse; class BankAccountsClient { @@ -31,7 +35,7 @@ class BankAccountsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; @@ -87,6 +91,62 @@ public function list(ListBankAccountsRequest $request = new ListBankAccountsRequ ); } + /** + * Store a bank account on file for a square account + * + * @param CreateBankAccountRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return CreateBankAccountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function createBankAccount(CreateBankAccountRequest $request, ?array $options = null): CreateBankAccountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bank-accounts", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return CreateBankAccountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. * @@ -143,8 +203,7 @@ public function getByV1Id(GetByV1IdBankAccountsRequest $request, ?array $options } /** - * Returns details of a [BankAccount](entity:BankAccount) - * linked to a Square account. + * Retrieve details of a [BankAccount](entity:BankAccount) bank account linked to a Square account. * * @param GetBankAccountsRequest $request * @param ?array{ @@ -198,6 +257,61 @@ public function get(GetBankAccountsRequest $request, ?array $options = null): Ge ); } + /** + * Disable a bank account. + * + * @param DisableBankAccountRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return DisableBankAccountResponse + * @throws SquareException + * @throws SquareApiException + */ + public function disableBankAccount(DisableBankAccountRequest $request, ?array $options = null): DisableBankAccountResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, + path: "v2/bank-accounts/{$request->getBankAccountId()}/disable", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + return DisableBankAccountResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (RequestException $e) { + $response = $e->getResponse(); + if ($response === null) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: "API request failed", + statusCode: $response->getStatusCode(), + body: $response->getBody()->getContents(), + ); + } catch (ClientExceptionInterface $e) { + throw new SquareException(message: $e->getMessage(), previous: $e); + } + throw new SquareApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. * @@ -227,6 +341,9 @@ private function _list(ListBankAccountsRequest $request = new ListBankAccountsRe if ($request->getLocationId() != null) { $query['location_id'] = $request->getLocationId(); } + if ($request->getCustomerId() != null) { + $query['customer_id'] = $request->getCustomerId(); + } try { $response = $this->client->sendRequest( new JsonApiRequest( diff --git a/src/BankAccounts/Requests/CreateBankAccountRequest.php b/src/BankAccounts/Requests/CreateBankAccountRequest.php new file mode 100644 index 00000000..f88fc6d3 --- /dev/null +++ b/src/BankAccounts/Requests/CreateBankAccountRequest.php @@ -0,0 +1,99 @@ +idempotencyKey = $values['idempotencyKey']; + $this->sourceId = $values['sourceId']; + $this->customerId = $values['customerId'] ?? null; + } + + /** + * @return string + */ + public function getIdempotencyKey(): string + { + return $this->idempotencyKey; + } + + /** + * @param string $value + */ + public function setIdempotencyKey(string $value): self + { + $this->idempotencyKey = $value; + return $this; + } + + /** + * @return string + */ + public function getSourceId(): string + { + return $this->sourceId; + } + + /** + * @param string $value + */ + public function setSourceId(string $value): self + { + $this->sourceId = $value; + return $this; + } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } +} diff --git a/src/BankAccounts/Requests/DisableBankAccountRequest.php b/src/BankAccounts/Requests/DisableBankAccountRequest.php new file mode 100644 index 00000000..3494c50a --- /dev/null +++ b/src/BankAccounts/Requests/DisableBankAccountRequest.php @@ -0,0 +1,41 @@ +bankAccountId = $values['bankAccountId']; + } + + /** + * @return string + */ + public function getBankAccountId(): string + { + return $this->bankAccountId; + } + + /** + * @param string $value + */ + public function setBankAccountId(string $value): self + { + $this->bankAccountId = $value; + return $this; + } +} diff --git a/src/BankAccounts/Requests/ListBankAccountsRequest.php b/src/BankAccounts/Requests/ListBankAccountsRequest.php index a627afdf..d5f18a1d 100644 --- a/src/BankAccounts/Requests/ListBankAccountsRequest.php +++ b/src/BankAccounts/Requests/ListBankAccountsRequest.php @@ -34,11 +34,20 @@ class ListBankAccountsRequest extends JsonSerializableType */ private ?string $locationId; + /** + * Customer ID. You can specify this optional filter + * to retrieve only the linked bank accounts belonging to a specific customer. + * + * @var ?string $customerId + */ + private ?string $customerId; + /** * @param array{ * cursor?: ?string, * limit?: ?int, * locationId?: ?string, + * customerId?: ?string, * } $values */ public function __construct( @@ -47,6 +56,7 @@ public function __construct( $this->cursor = $values['cursor'] ?? null; $this->limit = $values['limit'] ?? null; $this->locationId = $values['locationId'] ?? null; + $this->customerId = $values['customerId'] ?? null; } /** @@ -99,4 +109,21 @@ public function setLocationId(?string $value = null): self $this->locationId = $value; return $this; } + + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } } diff --git a/src/Bookings/BookingsClient.php b/src/Bookings/BookingsClient.php index 55bd1929..5cb38b2d 100644 --- a/src/Bookings/BookingsClient.php +++ b/src/Bookings/BookingsClient.php @@ -68,7 +68,7 @@ class BookingsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php index f2cf45bf..af660c74 100644 --- a/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php +++ b/src/Bookings/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -35,7 +35,7 @@ class CustomAttributeDefinitionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Bookings/CustomAttributes/CustomAttributesClient.php b/src/Bookings/CustomAttributes/CustomAttributesClient.php index 0c5fbacb..1e5e4c45 100644 --- a/src/Bookings/CustomAttributes/CustomAttributesClient.php +++ b/src/Bookings/CustomAttributes/CustomAttributesClient.php @@ -37,7 +37,7 @@ class CustomAttributesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Bookings/LocationProfiles/LocationProfilesClient.php b/src/Bookings/LocationProfiles/LocationProfilesClient.php index ec6a8366..ef0458de 100644 --- a/src/Bookings/LocationProfiles/LocationProfilesClient.php +++ b/src/Bookings/LocationProfiles/LocationProfilesClient.php @@ -27,7 +27,7 @@ class LocationProfilesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php b/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php index c0d68dae..3fb1dd96 100644 --- a/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php +++ b/src/Bookings/TeamMemberProfiles/TeamMemberProfilesClient.php @@ -29,7 +29,7 @@ class TeamMemberProfilesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Cards/CardsClient.php b/src/Cards/CardsClient.php index 215833dc..998a4cc2 100644 --- a/src/Cards/CardsClient.php +++ b/src/Cards/CardsClient.php @@ -33,7 +33,7 @@ class CardsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/CashDrawers/CashDrawersClient.php b/src/CashDrawers/CashDrawersClient.php index f1e06b41..98956c4a 100644 --- a/src/CashDrawers/CashDrawersClient.php +++ b/src/CashDrawers/CashDrawersClient.php @@ -20,7 +20,7 @@ class CashDrawersClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/CashDrawers/Shifts/ShiftsClient.php b/src/CashDrawers/Shifts/ShiftsClient.php index ea978aa6..c41546eb 100644 --- a/src/CashDrawers/Shifts/ShiftsClient.php +++ b/src/CashDrawers/Shifts/ShiftsClient.php @@ -32,7 +32,7 @@ class ShiftsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Catalog/CatalogClient.php b/src/Catalog/CatalogClient.php index 7d4ed18a..4e7d4cb9 100644 --- a/src/Catalog/CatalogClient.php +++ b/src/Catalog/CatalogClient.php @@ -54,7 +54,7 @@ class CatalogClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Catalog/Images/ImagesClient.php b/src/Catalog/Images/ImagesClient.php index 298fc491..23216a34 100644 --- a/src/Catalog/Images/ImagesClient.php +++ b/src/Catalog/Images/ImagesClient.php @@ -27,7 +27,7 @@ class ImagesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Catalog/Object/ObjectClient.php b/src/Catalog/Object/ObjectClient.php index 0404225b..96178406 100644 --- a/src/Catalog/Object/ObjectClient.php +++ b/src/Catalog/Object/ObjectClient.php @@ -28,7 +28,7 @@ class ObjectClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Channels/ChannelsClient.php b/src/Channels/ChannelsClient.php index 37a4a0a6..60e2b86f 100644 --- a/src/Channels/ChannelsClient.php +++ b/src/Channels/ChannelsClient.php @@ -31,7 +31,7 @@ class ChannelsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Checkout/CheckoutClient.php b/src/Checkout/CheckoutClient.php index b99e3576..99c8941f 100644 --- a/src/Checkout/CheckoutClient.php +++ b/src/Checkout/CheckoutClient.php @@ -35,7 +35,7 @@ class CheckoutClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Checkout/PaymentLinks/PaymentLinksClient.php b/src/Checkout/PaymentLinks/PaymentLinksClient.php index e584ab17..b58ca58d 100644 --- a/src/Checkout/PaymentLinks/PaymentLinksClient.php +++ b/src/Checkout/PaymentLinks/PaymentLinksClient.php @@ -35,7 +35,7 @@ class PaymentLinksClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Core/Client/RawClient.php b/src/Core/Client/RawClient.php index 32318c4f..d5672cc2 100644 --- a/src/Core/Client/RawClient.php +++ b/src/Core/Client/RawClient.php @@ -28,11 +28,17 @@ class RawClient */ private array $headers; + /** + * @var ?(callable(): array) $getAuthHeaders + */ + private $getAuthHeaders; + /** * @param ?array{ * baseUrl?: string, * client?: ClientInterface, * headers?: array, + * getAuthHeaders?: callable(): array, * } $options */ public function __construct( @@ -41,6 +47,7 @@ public function __construct( $this->client = $this->options['client'] ?? $this->createDefaultClient(); $this->headers = $this->options['headers'] ?? []; + $this->getAuthHeaders = $this->options['getAuthHeaders'] ?? null; } /** @@ -128,6 +135,7 @@ private function encodeHeaders( BaseApiRequest $request, array $options, ): array { + $authHeaders = $this->getAuthHeaders !== null ? ($this->getAuthHeaders)() : []; return match (get_class($request)) { JsonApiRequest::class => array_merge( [ @@ -135,11 +143,13 @@ private function encodeHeaders( "Accept" => "*/*", ], $this->headers, + $authHeaders, $request->headers, $options['headers'] ?? [], ), MultipartApiRequest::class => array_merge( $this->headers, + $authHeaders, $request->headers, $options['headers'] ?? [], ), diff --git a/src/Core/Client/RetryMiddleware.php b/src/Core/Client/RetryMiddleware.php index 2b3fabd3..adb3dcb2 100644 --- a/src/Core/Client/RetryMiddleware.php +++ b/src/Core/Client/RetryMiddleware.php @@ -16,6 +16,8 @@ class RetryMiddleware 'baseDelay' => 1000 ]; private const RETRY_STATUS_CODES = [408, 429]; + private const MAX_RETRY_DELAY = 60000; // 60 seconds in milliseconds + private const JITTER_FACTOR = 0.2; // 20% random jitter /** * @var callable(RequestInterface, array): PromiseInterface @@ -133,7 +135,7 @@ private function onFulfilled(RequestInterface $request, array $options): callabl return $value; } - return $this->doRetry($request, $options); + return $this->doRetry($request, $options, $value); }; } @@ -171,14 +173,87 @@ private function onRejected(RequestInterface $req, array $options): callable * delay: int, * retryAttempt: int, * } $options + * @param ?ResponseInterface $response * @return PromiseInterface */ - private function doRetry(RequestInterface $request, array $options): PromiseInterface + private function doRetry(RequestInterface $request, array $options, ?ResponseInterface $response = null): PromiseInterface { - $options['delay'] = $this->exponentialDelay(++$options['retryAttempt']); + $options['delay'] = $this->getRetryDelay(++$options['retryAttempt'], $response); return $this($request, $options); } + /** + * Calculate the retry delay based on response headers or exponential backoff. + * + * @param int $retryAttempt + * @param ?ResponseInterface $response + * @return int milliseconds + */ + private function getRetryDelay(int $retryAttempt, ?ResponseInterface $response): int + { + if ($response !== null) { + // Check Retry-After header + $retryAfter = $response->getHeaderLine('Retry-After'); + if ($retryAfter !== '') { + // Try parsing as integer (seconds) + if (is_numeric($retryAfter)) { + $retryAfterSeconds = (int)$retryAfter; + if ($retryAfterSeconds > 0) { + return min($retryAfterSeconds * 1000, self::MAX_RETRY_DELAY); + } + } + + // Try parsing as HTTP date + $retryAfterDate = strtotime($retryAfter); + if ($retryAfterDate !== false) { + $delay = ($retryAfterDate - time()) * 1000; + if ($delay > 0) { + return min(max($delay, 0), self::MAX_RETRY_DELAY); + } + } + } + + // Check X-RateLimit-Reset header + $rateLimitReset = $response->getHeaderLine('X-RateLimit-Reset'); + if ($rateLimitReset !== '' && is_numeric($rateLimitReset)) { + $resetTime = (int)$rateLimitReset; + $delay = ($resetTime * 1000) - (int)(microtime(true) * 1000); + if ($delay > 0) { + return $this->addPositiveJitter(min($delay, self::MAX_RETRY_DELAY)); + } + } + } + + // Fall back to exponential backoff with symmetric jitter + return $this->addSymmetricJitter( + min($this->exponentialDelay($retryAttempt), self::MAX_RETRY_DELAY) + ); + } + + /** + * Add positive jitter (0% to +20%) to the delay. + * + * @param int $delay + * @return int + */ + private function addPositiveJitter(int $delay): int + { + $jitterMultiplier = 1 + (mt_rand() / mt_getrandmax()) * self::JITTER_FACTOR; + return (int)($delay * $jitterMultiplier); + } + + /** + * Add symmetric jitter (-10% to +10%) to the delay. + * + * @param int $delay + * @return int + */ + private function addSymmetricJitter(int $delay): int + { + $jitterMultiplier = 1 + ((mt_rand() / mt_getrandmax()) - 0.5) * self::JITTER_FACTOR; + return (int)($delay * $jitterMultiplier); + } + /** * Default exponential backoff delay function. * diff --git a/src/Core/Json/JsonDeserializer.php b/src/Core/Json/JsonDeserializer.php index 7f659cd3..16b3a87b 100644 --- a/src/Core/Json/JsonDeserializer.php +++ b/src/Core/Json/JsonDeserializer.php @@ -95,7 +95,9 @@ public static function deserializeUnion(mixed $data, Union $type): mixed foreach ($type->types as $unionType) { try { return self::deserializeValue($data, $unionType); - } catch (Exception) { + } catch (\Throwable) { + // Catching Throwable instead of Exception to handle TypeError + // that occurs when assigning null to non-nullable typed properties continue; } } diff --git a/src/Core/Json/JsonSerializer.php b/src/Core/Json/JsonSerializer.php index d3039ce0..0a31ab9e 100644 --- a/src/Core/Json/JsonSerializer.php +++ b/src/Core/Json/JsonSerializer.php @@ -24,13 +24,18 @@ public static function serializeDate(DateTime $date): string /** * Serializes a DateTime object into a string using the date-time format. + * Normalizes UTC times to use 'Z' suffix instead of '+00:00'. * * @param DateTime $date The DateTime object to serialize. * @return string The serialized date-time string. */ public static function serializeDateTime(DateTime $date): string { - return $date->format(Constant::DateTimeFormat); + $formatted = $date->format(Constant::DateTimeFormat); + if (str_ends_with($formatted, '+00:00')) { + return substr($formatted, 0, -6) . 'Z'; + } + return $formatted; } /** diff --git a/src/Customers/Cards/CardsClient.php b/src/Customers/Cards/CardsClient.php index faa3a824..6e9cca3e 100644 --- a/src/Customers/Cards/CardsClient.php +++ b/src/Customers/Cards/CardsClient.php @@ -26,7 +26,7 @@ class CardsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php index 69836d21..fa339b57 100644 --- a/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php +++ b/src/Customers/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -37,7 +37,7 @@ class CustomAttributeDefinitionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Customers/CustomAttributes/CustomAttributesClient.php b/src/Customers/CustomAttributes/CustomAttributesClient.php index 782c12d2..fd76884f 100644 --- a/src/Customers/CustomAttributes/CustomAttributesClient.php +++ b/src/Customers/CustomAttributes/CustomAttributesClient.php @@ -33,7 +33,7 @@ class CustomAttributesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Customers/CustomersClient.php b/src/Customers/CustomersClient.php index ad0c9be4..a984980e 100644 --- a/src/Customers/CustomersClient.php +++ b/src/Customers/CustomersClient.php @@ -75,7 +75,7 @@ class CustomersClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Customers/Groups/GroupsClient.php b/src/Customers/Groups/GroupsClient.php index 9395e72b..a3c4f356 100644 --- a/src/Customers/Groups/GroupsClient.php +++ b/src/Customers/Groups/GroupsClient.php @@ -39,7 +39,7 @@ class GroupsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Customers/Segments/SegmentsClient.php b/src/Customers/Segments/SegmentsClient.php index f1869330..a332846f 100644 --- a/src/Customers/Segments/SegmentsClient.php +++ b/src/Customers/Segments/SegmentsClient.php @@ -29,7 +29,7 @@ class SegmentsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Devices/Codes/CodesClient.php b/src/Devices/Codes/CodesClient.php index ae4e670f..d0a42dc3 100644 --- a/src/Devices/Codes/CodesClient.php +++ b/src/Devices/Codes/CodesClient.php @@ -31,7 +31,7 @@ class CodesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Devices/DevicesClient.php b/src/Devices/DevicesClient.php index 84133f50..3a1880fb 100644 --- a/src/Devices/DevicesClient.php +++ b/src/Devices/DevicesClient.php @@ -35,7 +35,7 @@ class DevicesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Disputes/DisputesClient.php b/src/Disputes/DisputesClient.php index 06377251..c816ddcb 100644 --- a/src/Disputes/DisputesClient.php +++ b/src/Disputes/DisputesClient.php @@ -45,7 +45,7 @@ class DisputesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Disputes/Evidence/EvidenceClient.php b/src/Disputes/Evidence/EvidenceClient.php index e5b6fd5b..fe64cc1f 100644 --- a/src/Disputes/Evidence/EvidenceClient.php +++ b/src/Disputes/Evidence/EvidenceClient.php @@ -31,7 +31,7 @@ class EvidenceClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Employees/EmployeesClient.php b/src/Employees/EmployeesClient.php index b4c2e25a..b4ab48bd 100644 --- a/src/Employees/EmployeesClient.php +++ b/src/Employees/EmployeesClient.php @@ -29,7 +29,7 @@ class EmployeesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Events/EventsClient.php b/src/Events/EventsClient.php index 76425ef6..635a67e5 100644 --- a/src/Events/EventsClient.php +++ b/src/Events/EventsClient.php @@ -28,7 +28,7 @@ class EventsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/GiftCards/Activities/ActivitiesClient.php b/src/GiftCards/Activities/ActivitiesClient.php index a432453a..556138de 100644 --- a/src/GiftCards/Activities/ActivitiesClient.php +++ b/src/GiftCards/Activities/ActivitiesClient.php @@ -29,7 +29,7 @@ class ActivitiesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/GiftCards/GiftCardsClient.php b/src/GiftCards/GiftCardsClient.php index 1e20719f..0c4467f5 100644 --- a/src/GiftCards/GiftCardsClient.php +++ b/src/GiftCards/GiftCardsClient.php @@ -45,7 +45,7 @@ class GiftCardsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Inventory/InventoryClient.php b/src/Inventory/InventoryClient.php index 93804ebc..9b481af5 100644 --- a/src/Inventory/InventoryClient.php +++ b/src/Inventory/InventoryClient.php @@ -44,7 +44,7 @@ class InventoryClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Invoices/InvoicesClient.php b/src/Invoices/InvoicesClient.php index 5e6ba7b0..6f82d10d 100644 --- a/src/Invoices/InvoicesClient.php +++ b/src/Invoices/InvoicesClient.php @@ -47,7 +47,7 @@ class InvoicesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/BreakTypes/BreakTypesClient.php b/src/Labor/BreakTypes/BreakTypesClient.php index a6205b9d..35a8c5ee 100644 --- a/src/Labor/BreakTypes/BreakTypesClient.php +++ b/src/Labor/BreakTypes/BreakTypesClient.php @@ -35,7 +35,7 @@ class BreakTypesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/EmployeeWages/EmployeeWagesClient.php b/src/Labor/EmployeeWages/EmployeeWagesClient.php index 4a064c66..2108dd9d 100644 --- a/src/Labor/EmployeeWages/EmployeeWagesClient.php +++ b/src/Labor/EmployeeWages/EmployeeWagesClient.php @@ -29,7 +29,7 @@ class EmployeeWagesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/LaborClient.php b/src/Labor/LaborClient.php index 168c0486..f95d92bd 100644 --- a/src/Labor/LaborClient.php +++ b/src/Labor/LaborClient.php @@ -74,7 +74,7 @@ class LaborClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/Shifts/ShiftsClient.php b/src/Labor/Shifts/ShiftsClient.php index 654b7b88..b61e429c 100644 --- a/src/Labor/Shifts/ShiftsClient.php +++ b/src/Labor/Shifts/ShiftsClient.php @@ -32,7 +32,7 @@ class ShiftsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/TeamMemberWages/TeamMemberWagesClient.php b/src/Labor/TeamMemberWages/TeamMemberWagesClient.php index 12ec3250..6f5b4462 100644 --- a/src/Labor/TeamMemberWages/TeamMemberWagesClient.php +++ b/src/Labor/TeamMemberWages/TeamMemberWagesClient.php @@ -29,7 +29,7 @@ class TeamMemberWagesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php b/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php index fc29afcc..cf196c7e 100644 --- a/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php +++ b/src/Labor/WorkweekConfigs/WorkweekConfigsClient.php @@ -29,7 +29,7 @@ class WorkweekConfigsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php index a2e4b604..b939d511 100644 --- a/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php +++ b/src/Locations/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -35,7 +35,7 @@ class CustomAttributeDefinitionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Locations/CustomAttributes/CustomAttributesClient.php b/src/Locations/CustomAttributes/CustomAttributesClient.php index 6bcd3f60..8b67edf0 100644 --- a/src/Locations/CustomAttributes/CustomAttributesClient.php +++ b/src/Locations/CustomAttributes/CustomAttributesClient.php @@ -37,7 +37,7 @@ class CustomAttributesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Locations/LocationsClient.php b/src/Locations/LocationsClient.php index 3d2dbfb2..de293946 100644 --- a/src/Locations/LocationsClient.php +++ b/src/Locations/LocationsClient.php @@ -49,7 +49,7 @@ class LocationsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Locations/Transactions/TransactionsClient.php b/src/Locations/Transactions/TransactionsClient.php index ec5f2747..ff9e7195 100644 --- a/src/Locations/Transactions/TransactionsClient.php +++ b/src/Locations/Transactions/TransactionsClient.php @@ -30,7 +30,7 @@ class TransactionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Loyalty/Accounts/AccountsClient.php b/src/Loyalty/Accounts/AccountsClient.php index 814b6769..4c54fc14 100644 --- a/src/Loyalty/Accounts/AccountsClient.php +++ b/src/Loyalty/Accounts/AccountsClient.php @@ -32,7 +32,7 @@ class AccountsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Loyalty/LoyaltyClient.php b/src/Loyalty/LoyaltyClient.php index 40949973..3054cf93 100644 --- a/src/Loyalty/LoyaltyClient.php +++ b/src/Loyalty/LoyaltyClient.php @@ -42,7 +42,7 @@ class LoyaltyClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Loyalty/Programs/ProgramsClient.php b/src/Loyalty/Programs/ProgramsClient.php index eb8483f2..bfc4f4e5 100644 --- a/src/Loyalty/Programs/ProgramsClient.php +++ b/src/Loyalty/Programs/ProgramsClient.php @@ -33,7 +33,7 @@ class ProgramsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Loyalty/Programs/Promotions/PromotionsClient.php b/src/Loyalty/Programs/Promotions/PromotionsClient.php index 2cde943d..5fc28fb0 100644 --- a/src/Loyalty/Programs/Promotions/PromotionsClient.php +++ b/src/Loyalty/Programs/Promotions/PromotionsClient.php @@ -33,7 +33,7 @@ class PromotionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Loyalty/Rewards/RewardsClient.php b/src/Loyalty/Rewards/RewardsClient.php index 95925dfd..934c8098 100644 --- a/src/Loyalty/Rewards/RewardsClient.php +++ b/src/Loyalty/Rewards/RewardsClient.php @@ -32,7 +32,7 @@ class RewardsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php index d08f4bf7..354f9664 100644 --- a/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php +++ b/src/Merchants/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -35,7 +35,7 @@ class CustomAttributeDefinitionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Merchants/CustomAttributes/CustomAttributesClient.php b/src/Merchants/CustomAttributes/CustomAttributesClient.php index 177e5701..a65b161c 100644 --- a/src/Merchants/CustomAttributes/CustomAttributesClient.php +++ b/src/Merchants/CustomAttributes/CustomAttributesClient.php @@ -37,7 +37,7 @@ class CustomAttributesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Merchants/MerchantsClient.php b/src/Merchants/MerchantsClient.php index f72b1a6e..bdb76451 100644 --- a/src/Merchants/MerchantsClient.php +++ b/src/Merchants/MerchantsClient.php @@ -41,7 +41,7 @@ class MerchantsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Mobile/MobileClient.php b/src/Mobile/MobileClient.php index ec5ce928..cbbb64aa 100644 --- a/src/Mobile/MobileClient.php +++ b/src/Mobile/MobileClient.php @@ -4,14 +4,11 @@ use GuzzleHttp\ClientInterface; use Square\Core\Client\RawClient; -use Square\Mobile\Requests\CreateMobileAuthorizationCodeRequest; -use Square\Types\CreateMobileAuthorizationCodeResponse; use Square\Exceptions\SquareException; use Square\Exceptions\SquareApiException; use Square\Core\Json\JsonApiRequest; use Square\Environments; use Square\Core\Client\HttpMethod; -use JsonException; use GuzzleHttp\Exception\RequestException; use Psr\Http\Client\ClientExceptionInterface; @@ -24,7 +21,7 @@ class MobileClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; @@ -52,23 +49,6 @@ public function __construct( } /** - * __Note:__ This endpoint is used by the deprecated Reader SDK. - * Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. - * - * Generates code to authorize a mobile application to connect to a Square card reader. - * - * Authorization codes are one-time-use codes and expire 60 minutes after being issued. - * - * The `Authorization` header you provide to this endpoint must have the following format: - * - * ``` - * Authorization: Bearer ACCESS_TOKEN - * ``` - * - * Replace `ACCESS_TOKEN` with a - * [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). - * - * @param CreateMobileAuthorizationCodeRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -77,11 +57,10 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return CreateMobileAuthorizationCodeResponse * @throws SquareException * @throws SquareApiException */ - public function authorizationCode(CreateMobileAuthorizationCodeRequest $request = new CreateMobileAuthorizationCodeRequest(), ?array $options = null): CreateMobileAuthorizationCodeResponse + public function authorizationCode(?array $options = null): void { $options = array_merge($this->options, $options ?? []); try { @@ -90,17 +69,13 @@ public function authorizationCode(CreateMobileAuthorizationCodeRequest $request baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Production->value, path: "mobile/authorization-code", method: HttpMethod::POST, - body: $request, ), $options, ); $statusCode = $response->getStatusCode(); if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - return CreateMobileAuthorizationCodeResponse::fromJson($json); + return; } - } catch (JsonException $e) { - throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); } catch (RequestException $e) { $response = $e->getResponse(); if ($response === null) { diff --git a/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php b/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php deleted file mode 100644 index 273e1f09..00000000 --- a/src/Mobile/Requests/CreateMobileAuthorizationCodeRequest.php +++ /dev/null @@ -1,43 +0,0 @@ -locationId = $values['locationId'] ?? null; - } - - /** - * @return ?string - */ - public function getLocationId(): ?string - { - return $this->locationId; - } - - /** - * @param ?string $value - */ - public function setLocationId(?string $value = null): self - { - $this->locationId = $value; - return $this; - } -} diff --git a/src/OAuth/OAuthClient.php b/src/OAuth/OAuthClient.php index f2cd8a9d..bca77c84 100644 --- a/src/OAuth/OAuthClient.php +++ b/src/OAuth/OAuthClient.php @@ -27,7 +27,7 @@ class OAuthClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/OAuth/Requests/ObtainTokenRequest.php b/src/OAuth/Requests/ObtainTokenRequest.php index 39523432..9406ce26 100644 --- a/src/OAuth/Requests/ObtainTokenRequest.php +++ b/src/OAuth/Requests/ObtainTokenRequest.php @@ -126,6 +126,16 @@ class ObtainTokenRequest extends JsonSerializableType #[JsonProperty('code_verifier')] private ?string $codeVerifier; + /** + * Indicates whether to use a JWT (JSON Web Token) as the OAuth access token. + * When set to `true`, the OAuth flow returns a JWT to your application, used in the + * same way as a regular token. The default value is `false`. + * + * @var ?bool $useJwt + */ + #[JsonProperty('use_jwt')] + private ?bool $useJwt; + /** * @param array{ * clientId: string, @@ -138,6 +148,7 @@ class ObtainTokenRequest extends JsonSerializableType * scopes?: ?array, * shortLived?: ?bool, * codeVerifier?: ?string, + * useJwt?: ?bool, * } $values */ public function __construct( @@ -153,6 +164,7 @@ public function __construct( $this->scopes = $values['scopes'] ?? null; $this->shortLived = $values['shortLived'] ?? null; $this->codeVerifier = $values['codeVerifier'] ?? null; + $this->useJwt = $values['useJwt'] ?? null; } /** @@ -324,4 +336,21 @@ public function setCodeVerifier(?string $value = null): self $this->codeVerifier = $value; return $this; } + + /** + * @return ?bool + */ + public function getUseJwt(): ?bool + { + return $this->useJwt; + } + + /** + * @param ?bool $value + */ + public function setUseJwt(?bool $value = null): self + { + $this->useJwt = $value; + return $this; + } } diff --git a/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php b/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php index b463aee6..7ee2b03e 100644 --- a/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php +++ b/src/Orders/CustomAttributeDefinitions/CustomAttributeDefinitionsClient.php @@ -35,7 +35,7 @@ class CustomAttributeDefinitionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Orders/CustomAttributes/CustomAttributesClient.php b/src/Orders/CustomAttributes/CustomAttributesClient.php index df0e4ca9..2afb30b8 100644 --- a/src/Orders/CustomAttributes/CustomAttributesClient.php +++ b/src/Orders/CustomAttributes/CustomAttributesClient.php @@ -37,7 +37,7 @@ class CustomAttributesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Orders/OrdersClient.php b/src/Orders/OrdersClient.php index 0f9304cb..98996e72 100644 --- a/src/Orders/OrdersClient.php +++ b/src/Orders/OrdersClient.php @@ -50,7 +50,7 @@ class OrdersClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Payments/PaymentsClient.php b/src/Payments/PaymentsClient.php index f4f6dbeb..45b9f050 100644 --- a/src/Payments/PaymentsClient.php +++ b/src/Payments/PaymentsClient.php @@ -39,7 +39,7 @@ class PaymentsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Payments/Requests/CreatePaymentRequest.php b/src/Payments/Requests/CreatePaymentRequest.php index dc99d246..56005061 100644 --- a/src/Payments/Requests/CreatePaymentRequest.php +++ b/src/Payments/Requests/CreatePaymentRequest.php @@ -63,6 +63,8 @@ class CreatePaymentRequest extends JsonSerializableType * (for example, US dollar amounts are specified in cents). For more information, see * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). * + * Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges. + * * The currency code must match the currency associated with the business * that is accepting the payment. * diff --git a/src/Payouts/PayoutsClient.php b/src/Payouts/PayoutsClient.php index d6b28f47..d4aac3aa 100644 --- a/src/Payouts/PayoutsClient.php +++ b/src/Payouts/PayoutsClient.php @@ -32,7 +32,7 @@ class PayoutsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Refunds/RefundsClient.php b/src/Refunds/RefundsClient.php index 1241f916..57d76e8c 100644 --- a/src/Refunds/RefundsClient.php +++ b/src/Refunds/RefundsClient.php @@ -31,7 +31,7 @@ class RefundsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Sites/SitesClient.php b/src/Sites/SitesClient.php index 40e466ff..23cc9e4c 100644 --- a/src/Sites/SitesClient.php +++ b/src/Sites/SitesClient.php @@ -23,7 +23,7 @@ class SitesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Snippets/SnippetsClient.php b/src/Snippets/SnippetsClient.php index 60756494..0080842d 100644 --- a/src/Snippets/SnippetsClient.php +++ b/src/Snippets/SnippetsClient.php @@ -28,7 +28,7 @@ class SnippetsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/SquareClient.php b/src/SquareClient.php index e8d20c07..b68ca716 100644 --- a/src/SquareClient.php +++ b/src/SquareClient.php @@ -2,7 +2,6 @@ namespace Square; -use Square\Mobile\MobileClient; use Square\OAuth\OAuthClient; use Square\V1Transactions\V1TransactionsClient; use Square\ApplePay\ApplePayClient; @@ -36,6 +35,7 @@ use Square\Terminal\TerminalClient; use Square\TransferOrders\TransferOrdersClient; use Square\Vendors\VendorsClient; +use Square\Mobile\MobileClient; use Square\CashDrawers\CashDrawersClient; use Square\Webhooks\WebhooksClient; use GuzzleHttp\ClientInterface; @@ -44,11 +44,6 @@ class SquareClient { - /** - * @var MobileClient $mobile - */ - public MobileClient $mobile; - /** * @var OAuthClient $oAuth */ @@ -214,6 +209,11 @@ class SquareClient */ public VendorsClient $vendors; + /** + * @var MobileClient $mobile + */ + public MobileClient $mobile; + /** * @var CashDrawersClient $cashDrawers */ @@ -231,7 +231,7 @@ class SquareClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; @@ -259,28 +259,27 @@ public function __construct( $token ??= $this->getFromEnvOrThrow('SQUARE_TOKEN', 'Please pass in token or set the environment variable SQUARE_TOKEN.'); $defaultHeaders = [ 'Authorization' => "Bearer $token", - 'Square-Version' => '2025-10-16', + 'Square-Version' => '2026-01-22', 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'Square', - 'X-Fern-SDK-Version' => '43.3.0.20251016', - 'User-Agent' => 'square/square/43.3.0.20251016', + 'X-Fern-SDK-Version' => '44.0.0.20260122', + 'User-Agent' => 'square/square/44.0.0.20260122', ]; if ($version != null) { $defaultHeaders['Square-Version'] = $version; } $this->options = $options ?? []; + $this->options['headers'] = array_merge( $defaultHeaders, $this->options['headers'] ?? [], ); - $this->client = new RawClient( options: $this->options, ); - $this->mobile = new MobileClient($this->client, $this->options); $this->oAuth = new OAuthClient($this->client, $this->options); $this->v1Transactions = new V1TransactionsClient($this->client, $this->options); $this->applePay = new ApplePayClient($this->client, $this->options); @@ -314,6 +313,7 @@ public function __construct( $this->terminal = new TerminalClient($this->client, $this->options); $this->transferOrders = new TransferOrdersClient($this->client, $this->options); $this->vendors = new VendorsClient($this->client, $this->options); + $this->mobile = new MobileClient($this->client, $this->options); $this->cashDrawers = new CashDrawersClient($this->client, $this->options); $this->webhooks = new WebhooksClient($this->client, $this->options); } diff --git a/src/Subscriptions/SubscriptionsClient.php b/src/Subscriptions/SubscriptionsClient.php index d9629e5a..84206b30 100644 --- a/src/Subscriptions/SubscriptionsClient.php +++ b/src/Subscriptions/SubscriptionsClient.php @@ -49,7 +49,7 @@ class SubscriptionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Team/TeamClient.php b/src/Team/TeamClient.php index 347c5380..1748606c 100644 --- a/src/Team/TeamClient.php +++ b/src/Team/TeamClient.php @@ -30,7 +30,7 @@ class TeamClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/TeamMembers/TeamMembersClient.php b/src/TeamMembers/TeamMembersClient.php index 86b79e44..b3157ec6 100644 --- a/src/TeamMembers/TeamMembersClient.php +++ b/src/TeamMembers/TeamMembersClient.php @@ -40,7 +40,7 @@ class TeamMembersClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/TeamMembers/WageSetting/WageSettingClient.php b/src/TeamMembers/WageSetting/WageSettingClient.php index 43cace58..631173f8 100644 --- a/src/TeamMembers/WageSetting/WageSettingClient.php +++ b/src/TeamMembers/WageSetting/WageSettingClient.php @@ -26,7 +26,7 @@ class WageSettingClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Terminal/Actions/ActionsClient.php b/src/Terminal/Actions/ActionsClient.php index 92cc7cf9..a26e10af 100644 --- a/src/Terminal/Actions/ActionsClient.php +++ b/src/Terminal/Actions/ActionsClient.php @@ -30,7 +30,7 @@ class ActionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Terminal/Checkouts/CheckoutsClient.php b/src/Terminal/Checkouts/CheckoutsClient.php index 198a3ae2..bad02ea0 100644 --- a/src/Terminal/Checkouts/CheckoutsClient.php +++ b/src/Terminal/Checkouts/CheckoutsClient.php @@ -30,7 +30,7 @@ class CheckoutsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Terminal/Refunds/RefundsClient.php b/src/Terminal/Refunds/RefundsClient.php index f8917809..ae556b91 100644 --- a/src/Terminal/Refunds/RefundsClient.php +++ b/src/Terminal/Refunds/RefundsClient.php @@ -30,7 +30,7 @@ class RefundsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Terminal/TerminalClient.php b/src/Terminal/TerminalClient.php index b85a5315..261928c2 100644 --- a/src/Terminal/TerminalClient.php +++ b/src/Terminal/TerminalClient.php @@ -46,7 +46,7 @@ class TerminalClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/TransferOrders/TransferOrdersClient.php b/src/TransferOrders/TransferOrdersClient.php index a84d5654..7f57c11d 100644 --- a/src/TransferOrders/TransferOrdersClient.php +++ b/src/TransferOrders/TransferOrdersClient.php @@ -41,7 +41,7 @@ class TransferOrdersClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Types/BankAccount.php b/src/Types/BankAccount.php index 529abdc7..71547b0a 100644 --- a/src/Types/BankAccount.php +++ b/src/Types/BankAccount.php @@ -153,6 +153,12 @@ class BankAccount extends JsonSerializableType #[JsonProperty('bank_name')] private ?string $bankName; + /** + * @var ?string $customerId The ID of the customer who owns the bank account + */ + #[JsonProperty('customer_id')] + private ?string $customerId; + /** * @param array{ * id: string, @@ -172,6 +178,7 @@ class BankAccount extends JsonSerializableType * fingerprint?: ?string, * version?: ?int, * bankName?: ?string, + * customerId?: ?string, * } $values */ public function __construct( @@ -194,6 +201,7 @@ public function __construct( $this->fingerprint = $values['fingerprint'] ?? null; $this->version = $values['version'] ?? null; $this->bankName = $values['bankName'] ?? null; + $this->customerId = $values['customerId'] ?? null; } /** @@ -485,6 +493,23 @@ public function setBankName(?string $value = null): self return $this; } + /** + * @return ?string + */ + public function getCustomerId(): ?string + { + return $this->customerId; + } + + /** + * @param ?string $value + */ + public function setCustomerId(?string $value = null): self + { + $this->customerId = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/BuyNowPayLaterDetails.php b/src/Types/BuyNowPayLaterDetails.php index 84fe4ca1..7ee6b1bf 100644 --- a/src/Types/BuyNowPayLaterDetails.php +++ b/src/Types/BuyNowPayLaterDetails.php @@ -4,6 +4,7 @@ use Square\Core\Json\JsonSerializableType; use Square\Core\Json\JsonProperty; +use Square\Core\Types\ArrayType; /** * Additional details about a Buy Now Pay Later payment type. @@ -37,11 +38,18 @@ class BuyNowPayLaterDetails extends JsonSerializableType #[JsonProperty('clearpay_details')] private ?ClearpayDetails $clearpayDetails; + /** + * @var ?array $errors Information about errors encountered during the payment. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + /** * @param array{ * brand?: ?string, * afterpayDetails?: ?AfterpayDetails, * clearpayDetails?: ?ClearpayDetails, + * errors?: ?array, * } $values */ public function __construct( @@ -50,6 +58,7 @@ public function __construct( $this->brand = $values['brand'] ?? null; $this->afterpayDetails = $values['afterpayDetails'] ?? null; $this->clearpayDetails = $values['clearpayDetails'] ?? null; + $this->errors = $values['errors'] ?? null; } /** @@ -103,6 +112,23 @@ public function setClearpayDetails(?ClearpayDetails $value = null): self return $this; } + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/Card.php b/src/Types/Card.php index 99b1cb2d..d66295dd 100644 --- a/src/Types/Card.php +++ b/src/Types/Card.php @@ -126,6 +126,18 @@ class Card extends JsonSerializableType #[JsonProperty('bin')] private ?string $bin; + /** + * @var ?string $createdAt Timestamp for when the card object was created on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + #[JsonProperty('created_at')] + private ?string $createdAt; + + /** + * @var ?string $disabledAt Timestamp for when the card object was disabled on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + */ + #[JsonProperty('disabled_at')] + private ?string $disabledAt; + /** * Current version number of the card. Increments with each card update. Requests to update an * existing Card object will be rejected unless the version in the request matches the current @@ -196,6 +208,8 @@ class Card extends JsonSerializableType * cardType?: ?value-of, * prepaidType?: ?value-of, * bin?: ?string, + * createdAt?: ?string, + * disabledAt?: ?string, * version?: ?int, * cardCoBrand?: ?value-of, * issuerAlert?: ?'ISSUER_ALERT_CARD_CLOSED', @@ -221,6 +235,8 @@ public function __construct( $this->cardType = $values['cardType'] ?? null; $this->prepaidType = $values['prepaidType'] ?? null; $this->bin = $values['bin'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->disabledAt = $values['disabledAt'] ?? null; $this->version = $values['version'] ?? null; $this->cardCoBrand = $values['cardCoBrand'] ?? null; $this->issuerAlert = $values['issuerAlert'] ?? null; @@ -483,6 +499,40 @@ public function setBin(?string $value = null): self return $this; } + /** + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->createdAt; + } + + /** + * @param ?string $value + */ + public function setCreatedAt(?string $value = null): self + { + $this->createdAt = $value; + return $this; + } + + /** + * @return ?string + */ + public function getDisabledAt(): ?string + { + return $this->disabledAt; + } + + /** + * @param ?string $value + */ + public function setDisabledAt(?string $value = null): self + { + $this->disabledAt = $value; + return $this; + } + /** * @return ?int */ diff --git a/src/Types/CatalogItem.php b/src/Types/CatalogItem.php index 43b56c5b..d33854e1 100644 --- a/src/Types/CatalogItem.php +++ b/src/Types/CatalogItem.php @@ -58,6 +58,12 @@ class CatalogItem extends JsonSerializableType #[JsonProperty('category_id')] private ?string $categoryId; + /** + * @var ?string $buyerFacingName The override to a product name to display to users + */ + #[JsonProperty('buyer_facing_name')] + private ?string $buyerFacingName; + /** * A set of IDs indicating the taxes enabled for * this item. When updating an item, any taxes listed here will be added to the item. @@ -202,6 +208,17 @@ class CatalogItem extends JsonSerializableType #[JsonProperty('description_plaintext')] private ?string $descriptionPlaintext; + /** + * (Optional) Name that the restaurant wants to display to their kitchen workers + * instead of the customer-facing name. + * e.g., customer name might be "Big John's Mega Burger" and the + * kitchen name is "12oz beef burger" + * + * @var ?string $kitchenName + */ + #[JsonProperty('kitchen_name')] + private ?string $kitchenName; + /** * A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. * This field is read only and cannot be edited. @@ -249,6 +266,7 @@ class CatalogItem extends JsonSerializableType * labelColor?: ?string, * isTaxable?: ?bool, * categoryId?: ?string, + * buyerFacingName?: ?string, * taxIds?: ?array, * modifierListInfo?: ?array, * variations?: ?array, @@ -262,6 +280,7 @@ class CatalogItem extends JsonSerializableType * categories?: ?array, * descriptionHtml?: ?string, * descriptionPlaintext?: ?string, + * kitchenName?: ?string, * channels?: ?array, * isArchived?: ?bool, * ecomSeoData?: ?CatalogEcomSeoData, @@ -279,6 +298,7 @@ public function __construct( $this->labelColor = $values['labelColor'] ?? null; $this->isTaxable = $values['isTaxable'] ?? null; $this->categoryId = $values['categoryId'] ?? null; + $this->buyerFacingName = $values['buyerFacingName'] ?? null; $this->taxIds = $values['taxIds'] ?? null; $this->modifierListInfo = $values['modifierListInfo'] ?? null; $this->variations = $values['variations'] ?? null; @@ -292,6 +312,7 @@ public function __construct( $this->categories = $values['categories'] ?? null; $this->descriptionHtml = $values['descriptionHtml'] ?? null; $this->descriptionPlaintext = $values['descriptionPlaintext'] ?? null; + $this->kitchenName = $values['kitchenName'] ?? null; $this->channels = $values['channels'] ?? null; $this->isArchived = $values['isArchived'] ?? null; $this->ecomSeoData = $values['ecomSeoData'] ?? null; @@ -402,6 +423,23 @@ public function setCategoryId(?string $value = null): self return $this; } + /** + * @return ?string + */ + public function getBuyerFacingName(): ?string + { + return $this->buyerFacingName; + } + + /** + * @param ?string $value + */ + public function setBuyerFacingName(?string $value = null): self + { + $this->buyerFacingName = $value; + return $this; + } + /** * @return ?array */ @@ -623,6 +661,23 @@ public function setDescriptionPlaintext(?string $value = null): self return $this; } + /** + * @return ?string + */ + public function getKitchenName(): ?string + { + return $this->kitchenName; + } + + /** + * @param ?string $value + */ + public function setKitchenName(?string $value = null): self + { + $this->kitchenName = $value; + return $this; + } + /** * @return ?array */ diff --git a/src/Types/CatalogItemModifierListInfo.php b/src/Types/CatalogItemModifierListInfo.php index 6e4a16e6..f7616f83 100644 --- a/src/Types/CatalogItemModifierListInfo.php +++ b/src/Types/CatalogItemModifierListInfo.php @@ -70,22 +70,43 @@ class CatalogItemModifierListInfo extends JsonSerializableType private ?int $ordinal; /** - * @var mixed $allowQuantities + * Controls whether multiple quantities of the same modifier can be selected for this item. + * - `YES` means that every modifier in the `CatalogModifierList` can have multiple quantities + * selected for this item. + * - `NO` means that each modifier in the `CatalogModifierList` can be selected only once for this item. + * - `NOT_SET` means that the `allow_quantities` setting on the `CatalogModifierList` is obeyed. + * See [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values + * + * @var ?value-of $allowQuantities */ #[JsonProperty('allow_quantities')] - private mixed $allowQuantities; + private ?string $allowQuantities; /** - * @var mixed $isConversational + * Controls whether conversational mode is enabled for modifiers on this item. + * + * - `YES` means conversational mode is enabled for every modifier in the `CatalogModifierList`. + * - `NO` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`. + * - `NOT_SET` means that conversational mode is not enabled for any modifier in the `CatalogModifierList`. + * See [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values + * + * @var ?value-of $isConversational */ #[JsonProperty('is_conversational')] - private mixed $isConversational; + private ?string $isConversational; /** - * @var mixed $hiddenFromCustomerOverride + * Controls whether all modifiers for this item are hidden from customer receipts. + * - `YES` means that all modifiers in the `CatalogModifierList` are hidden from customer + * receipts for this item. + * - `NO` means that all modifiers in the `CatalogModifierList` are visible on customer receipts for this item. + * - `NOT_SET` means that the `hidden_from_customer` setting on the `CatalogModifierList` is obeyed. + * See [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values + * + * @var ?value-of $hiddenFromCustomerOverride */ #[JsonProperty('hidden_from_customer_override')] - private mixed $hiddenFromCustomerOverride; + private ?string $hiddenFromCustomerOverride; /** * @param array{ @@ -95,9 +116,9 @@ class CatalogItemModifierListInfo extends JsonSerializableType * maxSelectedModifiers?: ?int, * enabled?: ?bool, * ordinal?: ?int, - * allowQuantities?: mixed, - * isConversational?: mixed, - * hiddenFromCustomerOverride?: mixed, + * allowQuantities?: ?value-of, + * isConversational?: ?value-of, + * hiddenFromCustomerOverride?: ?value-of, * } $values */ public function __construct( @@ -217,51 +238,51 @@ public function setOrdinal(?int $value = null): self } /** - * @return mixed + * @return ?value-of */ - public function getAllowQuantities(): mixed + public function getAllowQuantities(): ?string { return $this->allowQuantities; } /** - * @param mixed $value + * @param ?value-of $value */ - public function setAllowQuantities(mixed $value = null): self + public function setAllowQuantities(?string $value = null): self { $this->allowQuantities = $value; return $this; } /** - * @return mixed + * @return ?value-of */ - public function getIsConversational(): mixed + public function getIsConversational(): ?string { return $this->isConversational; } /** - * @param mixed $value + * @param ?value-of $value */ - public function setIsConversational(mixed $value = null): self + public function setIsConversational(?string $value = null): self { $this->isConversational = $value; return $this; } /** - * @return mixed + * @return ?value-of */ - public function getHiddenFromCustomerOverride(): mixed + public function getHiddenFromCustomerOverride(): ?string { return $this->hiddenFromCustomerOverride; } /** - * @param mixed $value + * @param ?value-of $value */ - public function setHiddenFromCustomerOverride(mixed $value = null): self + public function setHiddenFromCustomerOverride(?string $value = null): self { $this->hiddenFromCustomerOverride = $value; return $this; diff --git a/src/Types/CatalogItemVariation.php b/src/Types/CatalogItemVariation.php index 9bd27efe..4d939719 100644 --- a/src/Types/CatalogItemVariation.php +++ b/src/Types/CatalogItemVariation.php @@ -211,6 +211,17 @@ class CatalogItemVariation extends JsonSerializableType #[JsonProperty('stockable_conversion')] private ?CatalogStockConversion $stockableConversion; + /** + * (Optional) Name that the restaurant wants to display to their kitchen workers + * instead of the customer-facing name. + * e.g., customer name might be "Mega-Jumbo Triplesized" and the + * kitchen name is "Large container" + * + * @var ?string $kitchenName + */ + #[JsonProperty('kitchen_name')] + private ?string $kitchenName; + /** * @param array{ * itemId?: ?string, @@ -234,6 +245,7 @@ class CatalogItemVariation extends JsonSerializableType * imageIds?: ?array, * teamMemberIds?: ?array, * stockableConversion?: ?CatalogStockConversion, + * kitchenName?: ?string, * } $values */ public function __construct( @@ -260,6 +272,7 @@ public function __construct( $this->imageIds = $values['imageIds'] ?? null; $this->teamMemberIds = $values['teamMemberIds'] ?? null; $this->stockableConversion = $values['stockableConversion'] ?? null; + $this->kitchenName = $values['kitchenName'] ?? null; } /** @@ -619,6 +632,23 @@ public function setStockableConversion(?CatalogStockConversion $value = null): s return $this; } + /** + * @return ?string + */ + public function getKitchenName(): ?string + { + return $this->kitchenName; + } + + /** + * @param ?string $value + */ + public function setKitchenName(?string $value = null): self + { + $this->kitchenName = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/CatalogModifier.php b/src/Types/CatalogModifier.php index 716713ef..c58849ba 100644 --- a/src/Types/CatalogModifier.php +++ b/src/Types/CatalogModifier.php @@ -50,6 +50,17 @@ class CatalogModifier extends JsonSerializableType #[JsonProperty('location_overrides'), ArrayType([ModifierLocationOverrides::class])] private ?array $locationOverrides; + /** + * (Optional) Name that the restaurant wants to display to their kitchen workers + * instead of the customer-facing name. + * e.g., customer name might be "Double Baconize" and the + * kitchen name is "Add 2x bacon" + * + * @var ?string $kitchenName + */ + #[JsonProperty('kitchen_name')] + private ?string $kitchenName; + /** * The ID of the image associated with this `CatalogModifier` instance. * Currently this image is not displayed by Square, but is free to be displayed in 3rd party applications. @@ -73,6 +84,7 @@ class CatalogModifier extends JsonSerializableType * ordinal?: ?int, * modifierListId?: ?string, * locationOverrides?: ?array, + * kitchenName?: ?string, * imageId?: ?string, * hiddenOnline?: ?bool, * } $values @@ -86,6 +98,7 @@ public function __construct( $this->ordinal = $values['ordinal'] ?? null; $this->modifierListId = $values['modifierListId'] ?? null; $this->locationOverrides = $values['locationOverrides'] ?? null; + $this->kitchenName = $values['kitchenName'] ?? null; $this->imageId = $values['imageId'] ?? null; $this->hiddenOnline = $values['hiddenOnline'] ?? null; } @@ -192,6 +205,23 @@ public function setLocationOverrides(?array $value = null): self return $this; } + /** + * @return ?string + */ + public function getKitchenName(): ?string + { + return $this->kitchenName; + } + + /** + * @param ?string $value + */ + public function setKitchenName(?string $value = null): self + { + $this->kitchenName = $value; + return $this; + } + /** * @return ?string */ diff --git a/src/Types/CatalogModifierOverride.php b/src/Types/CatalogModifierOverride.php index 30bb4297..1cda2ad3 100644 --- a/src/Types/CatalogModifierOverride.php +++ b/src/Types/CatalogModifierOverride.php @@ -23,23 +23,36 @@ class CatalogModifierOverride extends JsonSerializableType private ?bool $onByDefault; /** - * @var mixed $hiddenOnlineOverride + * If `YES`, this setting overrides the `hidden_online` setting on the `CatalogModifier` object, + * and the modifier is always hidden from online sales channels. + * If `NO`, the modifier is not hidden. It is always visible in online sales channels for this catalog item. + * `NOT_SET` means the `hidden_online` setting on the `CatalogModifier` object is obeyed. + * See [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values + * + * @var ?value-of $hiddenOnlineOverride */ #[JsonProperty('hidden_online_override')] - private mixed $hiddenOnlineOverride; + private ?string $hiddenOnlineOverride; /** - * @var mixed $onByDefaultOverride + * If `YES`, this setting overrides the `on_by_default` setting on the `CatalogModifier` object, + * and the modifier is always selected by default for the catalog item. + * + * If `NO`, the modifier is not selected by default for this catalog item. + * `NOT_SET` means the `on_by_default` setting on the `CatalogModifier` object is obeyed. + * See [CatalogModifierToggleOverrideType](#type-catalogmodifiertoggleoverridetype) for possible values + * + * @var ?value-of $onByDefaultOverride */ #[JsonProperty('on_by_default_override')] - private mixed $onByDefaultOverride; + private ?string $onByDefaultOverride; /** * @param array{ * modifierId: string, * onByDefault?: ?bool, - * hiddenOnlineOverride?: mixed, - * onByDefaultOverride?: mixed, + * hiddenOnlineOverride?: ?value-of, + * onByDefaultOverride?: ?value-of, * } $values */ public function __construct( @@ -86,34 +99,34 @@ public function setOnByDefault(?bool $value = null): self } /** - * @return mixed + * @return ?value-of */ - public function getHiddenOnlineOverride(): mixed + public function getHiddenOnlineOverride(): ?string { return $this->hiddenOnlineOverride; } /** - * @param mixed $value + * @param ?value-of $value */ - public function setHiddenOnlineOverride(mixed $value = null): self + public function setHiddenOnlineOverride(?string $value = null): self { $this->hiddenOnlineOverride = $value; return $this; } /** - * @return mixed + * @return ?value-of */ - public function getOnByDefaultOverride(): mixed + public function getOnByDefaultOverride(): ?string { return $this->onByDefaultOverride; } /** - * @param mixed $value + * @param ?value-of $value */ - public function setOnByDefaultOverride(mixed $value = null): self + public function setOnByDefaultOverride(?string $value = null): self { $this->onByDefaultOverride = $value; return $this; diff --git a/src/Types/CatalogModifierToggleOverrideType.php b/src/Types/CatalogModifierToggleOverrideType.php new file mode 100644 index 00000000..8cfd68aa --- /dev/null +++ b/src/Types/CatalogModifierToggleOverrideType.php @@ -0,0 +1,10 @@ + $productIdsAny */ @@ -47,7 +47,7 @@ class CatalogProductSet extends JsonSerializableType * * Only one of `product_ids_all`, `product_ids_any`, or `all_products` can be set. * - * Max: 500 catalog object IDs. + * Max: 5000 catalog object IDs. * * @var ?array $productIdsAll */ diff --git a/src/Types/CreateBankAccountResponse.php b/src/Types/CreateBankAccountResponse.php new file mode 100644 index 00000000..01fc673b --- /dev/null +++ b/src/Types/CreateBankAccountResponse.php @@ -0,0 +1,80 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bankAccount?: ?BankAccount, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bankAccount = $values['bankAccount'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BankAccount + */ + public function getBankAccount(): ?BankAccount + { + return $this->bankAccount; + } + + /** + * @param ?BankAccount $value + */ + public function setBankAccount(?BankAccount $value = null): self + { + $this->bankAccount = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CreateMobileAuthorizationCodeResponse.php b/src/Types/CreateMobileAuthorizationCodeResponse.php deleted file mode 100644 index 807ca466..00000000 --- a/src/Types/CreateMobileAuthorizationCodeResponse.php +++ /dev/null @@ -1,112 +0,0 @@ - $errors Any errors that occurred during the request. - */ - #[JsonProperty('errors'), ArrayType([Error::class])] - private ?array $errors; - - /** - * @param array{ - * authorizationCode?: ?string, - * expiresAt?: ?string, - * errors?: ?array, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->authorizationCode = $values['authorizationCode'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->errors = $values['errors'] ?? null; - } - - /** - * @return ?string - */ - public function getAuthorizationCode(): ?string - { - return $this->authorizationCode; - } - - /** - * @param ?string $value - */ - public function setAuthorizationCode(?string $value = null): self - { - $this->authorizationCode = $value; - return $this; - } - - /** - * @return ?string - */ - public function getExpiresAt(): ?string - { - return $this->expiresAt; - } - - /** - * @param ?string $value - */ - public function setExpiresAt(?string $value = null): self - { - $this->expiresAt = $value; - return $this; - } - - /** - * @return ?array - */ - public function getErrors(): ?array - { - return $this->errors; - } - - /** - * @param ?array $value - */ - public function setErrors(?array $value = null): self - { - $this->errors = $value; - return $this; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DeviceCheckoutOptions.php b/src/Types/DeviceCheckoutOptions.php index 908c80ba..170c6ea3 100644 --- a/src/Types/DeviceCheckoutOptions.php +++ b/src/Types/DeviceCheckoutOptions.php @@ -44,6 +44,17 @@ class DeviceCheckoutOptions extends JsonSerializableType #[JsonProperty('show_itemized_cart')] private ?bool $showItemizedCart; + /** + * Controls whether the mobile client applies Auto Card Surcharge (ACS) during checkout. + * If true, ACS is applied based on Dashboard configuration. + * If false, ACS is not applied regardless of that configuration. + * For more information, see [Add a Card Surcharge](https://developer.squareupstaging.com/docs/terminal-api/additional-payment-checkout-features#add-a-card-surcharge). + * + * @var ?bool $allowAutoCardSurcharge + */ + #[JsonProperty('allow_auto_card_surcharge')] + private ?bool $allowAutoCardSurcharge; + /** * @param array{ * deviceId: string, @@ -51,6 +62,7 @@ class DeviceCheckoutOptions extends JsonSerializableType * collectSignature?: ?bool, * tipSettings?: ?TipSettings, * showItemizedCart?: ?bool, + * allowAutoCardSurcharge?: ?bool, * } $values */ public function __construct( @@ -61,6 +73,7 @@ public function __construct( $this->collectSignature = $values['collectSignature'] ?? null; $this->tipSettings = $values['tipSettings'] ?? null; $this->showItemizedCart = $values['showItemizedCart'] ?? null; + $this->allowAutoCardSurcharge = $values['allowAutoCardSurcharge'] ?? null; } /** @@ -148,6 +161,23 @@ public function setShowItemizedCart(?bool $value = null): self return $this; } + /** + * @return ?bool + */ + public function getAllowAutoCardSurcharge(): ?bool + { + return $this->allowAutoCardSurcharge; + } + + /** + * @param ?bool $value + */ + public function setAllowAutoCardSurcharge(?bool $value = null): self + { + $this->allowAutoCardSurcharge = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/DigitalWalletDetails.php b/src/Types/DigitalWalletDetails.php index 9fbb1b1f..c259e54e 100644 --- a/src/Types/DigitalWalletDetails.php +++ b/src/Types/DigitalWalletDetails.php @@ -4,6 +4,7 @@ use Square\Core\Json\JsonSerializableType; use Square\Core\Json\JsonProperty; +use Square\Core\Types\ArrayType; /** * Additional details about `WALLET` type payments. Contains only non-confidential information. @@ -21,7 +22,7 @@ class DigitalWalletDetails extends JsonSerializableType /** * The brand used for the `WALLET` payment. The brand can be `CASH_APP`, `PAYPAY`, `ALIPAY`, - * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY` or `UNKNOWN`. + * `RAKUTEN_PAY`, `AU_PAY`, `D_BARAI`, `MERPAY`, `WECHAT_PAY`, `LIGHTNING` or `UNKNOWN`. * * @var ?string $brand */ @@ -34,11 +35,18 @@ class DigitalWalletDetails extends JsonSerializableType #[JsonProperty('cash_app_details')] private ?CashAppDetails $cashAppDetails; + /** + * @var ?array $errors Information about errors encountered during the payment. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + /** * @param array{ * status?: ?string, * brand?: ?string, * cashAppDetails?: ?CashAppDetails, + * errors?: ?array, * } $values */ public function __construct( @@ -47,6 +55,7 @@ public function __construct( $this->status = $values['status'] ?? null; $this->brand = $values['brand'] ?? null; $this->cashAppDetails = $values['cashAppDetails'] ?? null; + $this->errors = $values['errors'] ?? null; } /** @@ -100,6 +109,23 @@ public function setCashAppDetails(?CashAppDetails $value = null): self return $this; } + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/DisableBankAccountResponse.php b/src/Types/DisableBankAccountResponse.php new file mode 100644 index 00000000..80704451 --- /dev/null +++ b/src/Types/DisableBankAccountResponse.php @@ -0,0 +1,80 @@ + $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + + /** + * @param array{ + * bankAccount?: ?BankAccount, + * errors?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->bankAccount = $values['bankAccount'] ?? null; + $this->errors = $values['errors'] ?? null; + } + + /** + * @return ?BankAccount + */ + public function getBankAccount(): ?BankAccount + { + return $this->bankAccount; + } + + /** + * @param ?BankAccount $value + */ + public function setBankAccount(?BankAccount $value = null): self + { + $this->bankAccount = $value; + return $this; + } + + /** + * @return ?array + */ + public function getErrors(): ?array + { + return $this->errors; + } + + /** + * @param ?array $value + */ + public function setErrors(?array $value = null): self + { + $this->errors = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ErrorCode.php b/src/Types/ErrorCode.php index b6499633..9b101b10 100644 --- a/src/Types/ErrorCode.php +++ b/src/Types/ErrorCode.php @@ -116,6 +116,7 @@ enum ErrorCode: string case UnsupportedLoyaltyRewardTier = "UNSUPPORTED_LOYALTY_REWARD_TIER"; case LocationMismatch = "LOCATION_MISMATCH"; case OrderUnpaidNotReturnable = "ORDER_UNPAID_NOT_RETURNABLE"; + case PartialPaymentDelayCaptureNotSupported = "PARTIAL_PAYMENT_DELAY_CAPTURE_NOT_SUPPORTED"; case IdempotencyKeyReused = "IDEMPOTENCY_KEY_REUSED"; case UnexpectedValue = "UNEXPECTED_VALUE"; case SandboxNotSupported = "SANDBOX_NOT_SUPPORTED"; @@ -131,6 +132,7 @@ enum ErrorCode: string case PlaidError = "PLAID_ERROR"; case PlaidErrorItemLoginRequired = "PLAID_ERROR_ITEM_LOGIN_REQUIRED"; case PlaidErrorRateLimit = "PLAID_ERROR_RATE_LIMIT"; + case PaymentSourceNotEnabledForTarget = "PAYMENT_SOURCE_NOT_ENABLED_FOR_TARGET"; case CardDeclined = "CARD_DECLINED"; case VerifyCvvFailure = "VERIFY_CVV_FAILURE"; case VerifyAvsFailure = "VERIFY_AVS_FAILURE"; diff --git a/src/Types/FulfillmentDeliveryDetails.php b/src/Types/FulfillmentDeliveryDetails.php index e6becec7..147c1c2d 100644 --- a/src/Types/FulfillmentDeliveryDetails.php +++ b/src/Types/FulfillmentDeliveryDetails.php @@ -18,7 +18,7 @@ class FulfillmentDeliveryDetails extends JsonSerializableType /** * Indicates the fulfillment delivery schedule type. If `SCHEDULED`, then - * `deliver_at` is required. If `ASAP`, then `prep_time_duration` is required. The default is `SCHEDULED`. + * `deliver_at` is required. The default is `SCHEDULED`. * See [OrderFulfillmentDeliveryDetailsScheduleType](#type-orderfulfillmentdeliverydetailsscheduletype) for possible values * * @var ?value-of $scheduleType @@ -41,23 +41,26 @@ class FulfillmentDeliveryDetails extends JsonSerializableType /** * The [timestamp](https://developer.squareup.com/docs/build-basics/working-with-dates) * that represents the start of the delivery period. - * When the fulfillment `schedule_type` is `ASAP`, the field is automatically - * set to the current time plus the `prep_time_duration`. - * Otherwise, the application can set this field while the fulfillment `state` is + * The application can set this field while the fulfillment `state` is * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the * terminal state such as `COMPLETED`, `CANCELED`, and `FAILED`). * * The timestamp must be in RFC 3339 format * (for example, "2016-09-04T23:59:33.123Z"). * + * For fulfillments with the schedule type `ASAP`, this is automatically set + * to the current time plus `prep_time_duration`, if available. + * * @var ?string $deliverAt */ #[JsonProperty('deliver_at')] private ?string $deliverAt; /** - * The duration of time it takes to prepare and deliver this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * needed to prepare and deliver this fulfillment. + * The duration must be in RFC 3339 format (for example, "PT30M" for 30 minutes). Don't confuse + * "M" for months with "M" for minutes. "P5M" means 5 months, while "PT5M" means 5 minutes. * * @var ?string $prepTimeDuration */ @@ -65,12 +68,14 @@ class FulfillmentDeliveryDetails extends JsonSerializableType private ?string $prepTimeDuration; /** - * The time period after `deliver_at` in which to deliver the order. + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * after `deliver_at` in which to deliver the order. * Applications can set this field when the fulfillment `state` is * `PROPOSED`, `RESERVED`, or `PREPARED` (any time before the terminal state * such as `COMPLETED`, `CANCELED`, and `FAILED`). * - * The duration must be in RFC 3339 format (for example, "P1W3D"). + * The duration must be in RFC 3339 format (for example, "PT30M" for 30 minutes). Don't confuse + * "M" for months with "M" for minutes. "P5M" means 5 months, while "PT5M" means 5 minutes. * * @var ?string $deliveryWindowDuration */ @@ -170,8 +175,10 @@ class FulfillmentDeliveryDetails extends JsonSerializableType private ?string $courierPickupAt; /** - * The time period after `courier_pickup_at` in which the courier should pick up the order. - * The duration must be in RFC 3339 format (for example, "P1W3D"). + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * after `courier_pickup_at` in which the courier should pick up the order. + * The duration must be in RFC 3339 format (for example, "PT30M" for 30 minutes). Don't confuse + * "M" for months with "M" for minutes. "P5M" means 5 months, while "PT5M" means 5 minutes. * * @var ?string $courierPickupWindowDuration */ diff --git a/src/Types/FulfillmentPickupDetails.php b/src/Types/FulfillmentPickupDetails.php index a6ea2850..0c2e69d7 100644 --- a/src/Types/FulfillmentPickupDetails.php +++ b/src/Types/FulfillmentPickupDetails.php @@ -32,8 +32,9 @@ class FulfillmentPickupDetails extends JsonSerializableType private ?string $expiresAt; /** - * The duration of time after which an in progress pickup fulfillment is automatically moved - * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "P1W3D"). + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * after which an in-progress pickup fulfillment is automatically moved + * to the `COMPLETED` state. The duration must be in RFC 3339 format (for example, "PT4H" for 4 hours). * * If not set, this pickup fulfillment remains in progress until it is canceled or completed. * @@ -57,7 +58,7 @@ class FulfillmentPickupDetails extends JsonSerializableType * "2016-09-04T23:59:33.123Z". * * For fulfillments with the schedule type `ASAP`, this is automatically set - * to the current time plus the expected duration to prepare the fulfillment. + * to the current time plus `prep_time_duration`, if available. * * @var ?string $pickupAt */ @@ -65,9 +66,12 @@ class FulfillmentPickupDetails extends JsonSerializableType private ?string $pickupAt; /** - * The window of time in which the order should be picked up after the `pickup_at` timestamp. - * Must be in RFC 3339 duration format, e.g., "P1W3D". Can be used as an - * informational guideline for merchants. + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * in which the order should be picked up after the `pickup_at` timestamp. + * The duration must be in RFC 3339 format (for example, "PT30M" for 30 minutes). Don't confuse + * "M" for months with "M" for minutes. "P5M" means 5 months, while "PT5M" means 5 minutes. + * + * Can be used as an informational guideline for merchants. * * @var ?string $pickupWindowDuration */ @@ -75,8 +79,10 @@ class FulfillmentPickupDetails extends JsonSerializableType private ?string $pickupWindowDuration; /** - * The duration of time it takes to prepare this fulfillment. - * The duration must be in RFC 3339 format (for example, "P1W3D"). + * The [duration](https://developer.squareup.com/docs/build-basics/working-with-dates) + * needed to prepare this fulfillment. + * The duration must be in RFC 3339 format (for example, "PT30M" for 30 minutes). Don't confuse + * "M" for months with "M" for minutes. "P5M" means 5 months, while "PT5M" means 5 minutes. * * @var ?string $prepTimeDuration */ diff --git a/src/Types/GetBankAccountResponse.php b/src/Types/GetBankAccountResponse.php index e7f76b7e..bdcc099e 100644 --- a/src/Types/GetBankAccountResponse.php +++ b/src/Types/GetBankAccountResponse.php @@ -11,62 +11,62 @@ */ class GetBankAccountResponse extends JsonSerializableType { - /** - * @var ?array $errors Information on errors encountered during the request. - */ - #[JsonProperty('errors'), ArrayType([Error::class])] - private ?array $errors; - /** * @var ?BankAccount $bankAccount The requested `BankAccount` object. */ #[JsonProperty('bank_account')] private ?BankAccount $bankAccount; + /** + * @var ?array $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + /** * @param array{ - * errors?: ?array, * bankAccount?: ?BankAccount, + * errors?: ?array, * } $values */ public function __construct( array $values = [], ) { - $this->errors = $values['errors'] ?? null; $this->bankAccount = $values['bankAccount'] ?? null; + $this->errors = $values['errors'] ?? null; } /** - * @return ?array + * @return ?BankAccount */ - public function getErrors(): ?array + public function getBankAccount(): ?BankAccount { - return $this->errors; + return $this->bankAccount; } /** - * @param ?array $value + * @param ?BankAccount $value */ - public function setErrors(?array $value = null): self + public function setBankAccount(?BankAccount $value = null): self { - $this->errors = $value; + $this->bankAccount = $value; return $this; } /** - * @return ?BankAccount + * @return ?array */ - public function getBankAccount(): ?BankAccount + public function getErrors(): ?array { - return $this->bankAccount; + return $this->errors; } /** - * @param ?BankAccount $value + * @param ?array $value */ - public function setBankAccount(?BankAccount $value = null): self + public function setErrors(?array $value = null): self { - $this->bankAccount = $value; + $this->errors = $value; return $this; } diff --git a/src/Types/ListBankAccountsResponse.php b/src/Types/ListBankAccountsResponse.php index b600af2b..dfff8fff 100644 --- a/src/Types/ListBankAccountsResponse.php +++ b/src/Types/ListBankAccountsResponse.php @@ -11,18 +11,18 @@ */ class ListBankAccountsResponse extends JsonSerializableType { - /** - * @var ?array $errors Information on errors encountered during the request. - */ - #[JsonProperty('errors'), ArrayType([Error::class])] - private ?array $errors; - /** * @var ?array $bankAccounts List of BankAccounts associated with this account. */ #[JsonProperty('bank_accounts'), ArrayType([BankAccount::class])] private ?array $bankAccounts; + /** + * @var ?array $errors Information on errors encountered during the request. + */ + #[JsonProperty('errors'), ArrayType([Error::class])] + private ?array $errors; + /** * When a response is truncated, it includes a cursor that you can * use in a subsequent request to fetch next set of bank accounts. @@ -37,50 +37,50 @@ class ListBankAccountsResponse extends JsonSerializableType /** * @param array{ - * errors?: ?array, * bankAccounts?: ?array, + * errors?: ?array, * cursor?: ?string, * } $values */ public function __construct( array $values = [], ) { - $this->errors = $values['errors'] ?? null; $this->bankAccounts = $values['bankAccounts'] ?? null; + $this->errors = $values['errors'] ?? null; $this->cursor = $values['cursor'] ?? null; } /** - * @return ?array + * @return ?array */ - public function getErrors(): ?array + public function getBankAccounts(): ?array { - return $this->errors; + return $this->bankAccounts; } /** - * @param ?array $value + * @param ?array $value */ - public function setErrors(?array $value = null): self + public function setBankAccounts(?array $value = null): self { - $this->errors = $value; + $this->bankAccounts = $value; return $this; } /** - * @return ?array + * @return ?array */ - public function getBankAccounts(): ?array + public function getErrors(): ?array { - return $this->bankAccounts; + return $this->errors; } /** - * @param ?array $value + * @param ?array $value */ - public function setBankAccounts(?array $value = null): self + public function setErrors(?array $value = null): self { - $this->bankAccounts = $value; + $this->errors = $value; return $this; } diff --git a/src/Types/OrderCardSurchargeTreatmentType.php b/src/Types/OrderCardSurchargeTreatmentType.php new file mode 100644 index 00000000..e7534c85 --- /dev/null +++ b/src/Types/OrderCardSurchargeTreatmentType.php @@ -0,0 +1,9 @@ +uid = $values['uid'] ?? null; $this->taxUid = $values['taxUid']; $this->appliedMoney = $values['appliedMoney'] ?? null; + $this->autoApplied = $values['autoApplied'] ?? null; } /** @@ -105,6 +117,23 @@ public function setAppliedMoney(?Money $value = null): self return $this; } + /** + * @return ?bool + */ + public function getAutoApplied(): ?bool + { + return $this->autoApplied; + } + + /** + * @param ?bool $value + */ + public function setAutoApplied(?bool $value = null): self + { + $this->autoApplied = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/OrderLineItemPricingBlocklists.php b/src/Types/OrderLineItemPricingBlocklists.php index e7ba0599..29a3b6a4 100644 --- a/src/Types/OrderLineItemPricingBlocklists.php +++ b/src/Types/OrderLineItemPricingBlocklists.php @@ -33,10 +33,22 @@ class OrderLineItemPricingBlocklists extends JsonSerializableType #[JsonProperty('blocked_taxes'), ArrayType([OrderLineItemPricingBlocklistsBlockedTax::class])] private ?array $blockedTaxes; + /** + * A list of service charges blocked from applying to the line item. + * Service charges can be blocked by the `service_charge_uid` (for ad hoc + * service charges) or the `service_charge_catalog_object_id` (for catalog + * service charges). + * + * @var ?array $blockedServiceCharges + */ + #[JsonProperty('blocked_service_charges'), ArrayType([OrderLineItemPricingBlocklistsBlockedServiceCharge::class])] + private ?array $blockedServiceCharges; + /** * @param array{ * blockedDiscounts?: ?array, * blockedTaxes?: ?array, + * blockedServiceCharges?: ?array, * } $values */ public function __construct( @@ -44,6 +56,7 @@ public function __construct( ) { $this->blockedDiscounts = $values['blockedDiscounts'] ?? null; $this->blockedTaxes = $values['blockedTaxes'] ?? null; + $this->blockedServiceCharges = $values['blockedServiceCharges'] ?? null; } /** @@ -80,6 +93,23 @@ public function setBlockedTaxes(?array $value = null): self return $this; } + /** + * @return ?array + */ + public function getBlockedServiceCharges(): ?array + { + return $this->blockedServiceCharges; + } + + /** + * @param ?array $value + */ + public function setBlockedServiceCharges(?array $value = null): self + { + $this->blockedServiceCharges = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/OrderLineItemPricingBlocklistsBlockedServiceCharge.php b/src/Types/OrderLineItemPricingBlocklistsBlockedServiceCharge.php new file mode 100644 index 00000000..3dcaabf1 --- /dev/null +++ b/src/Types/OrderLineItemPricingBlocklistsBlockedServiceCharge.php @@ -0,0 +1,114 @@ +uid = $values['uid'] ?? null; + $this->serviceChargeUid = $values['serviceChargeUid'] ?? null; + $this->serviceChargeCatalogObjectId = $values['serviceChargeCatalogObjectId'] ?? null; + } + + /** + * @return ?string + */ + public function getUid(): ?string + { + return $this->uid; + } + + /** + * @param ?string $value + */ + public function setUid(?string $value = null): self + { + $this->uid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getServiceChargeUid(): ?string + { + return $this->serviceChargeUid; + } + + /** + * @param ?string $value + */ + public function setServiceChargeUid(?string $value = null): self + { + $this->serviceChargeUid = $value; + return $this; + } + + /** + * @return ?string + */ + public function getServiceChargeCatalogObjectId(): ?string + { + return $this->serviceChargeCatalogObjectId; + } + + /** + * @param ?string $value + */ + public function setServiceChargeCatalogObjectId(?string $value = null): self + { + $this->serviceChargeCatalogObjectId = $value; + return $this; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OrderReturnServiceCharge.php b/src/Types/OrderReturnServiceCharge.php index 7c632770..b748b345 100644 --- a/src/Types/OrderReturnServiceCharge.php +++ b/src/Types/OrderReturnServiceCharge.php @@ -128,7 +128,7 @@ class OrderReturnServiceCharge extends JsonSerializableType private ?array $appliedTaxes; /** - * The treatment type of the service charge. + * Indicates whether the service charge will be treated as a value-holding line item or apportioned toward a line item. * See [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values * * @var ?value-of $treatmentType @@ -152,6 +152,15 @@ class OrderReturnServiceCharge extends JsonSerializableType #[JsonProperty('scope')] private ?string $scope; + /** + * The type of the service charge. + * See [OrderServiceChargeType](#type-orderservicechargetype) for possible values + * + * @var ?value-of $type + */ + #[JsonProperty('type')] + private ?string $type; + /** * @param array{ * uid?: ?string, @@ -169,6 +178,7 @@ class OrderReturnServiceCharge extends JsonSerializableType * appliedTaxes?: ?array, * treatmentType?: ?value-of, * scope?: ?value-of, + * type?: ?value-of, * } $values */ public function __construct( @@ -189,6 +199,7 @@ public function __construct( $this->appliedTaxes = $values['appliedTaxes'] ?? null; $this->treatmentType = $values['treatmentType'] ?? null; $this->scope = $values['scope'] ?? null; + $this->type = $values['type'] ?? null; } /** @@ -446,6 +457,23 @@ public function setScope(?string $value = null): self return $this; } + /** + * @return ?value-of + */ + public function getType(): ?string + { + return $this->type; + } + + /** + * @param ?value-of $value + */ + public function setType(?string $value = null): self + { + $this->type = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/OrderServiceCharge.php b/src/Types/OrderServiceCharge.php index 3e99f151..f52402bb 100644 --- a/src/Types/OrderServiceCharge.php +++ b/src/Types/OrderServiceCharge.php @@ -19,7 +19,7 @@ class OrderServiceCharge extends JsonSerializableType private ?string $uid; /** - * @var ?string $name The name of the service charge. + * @var ?string $name The name of the service charge. This is unused and null for AUTO_GRATUITY to match the behavior on Bills. */ #[JsonProperty('name')] private ?string $name; @@ -162,7 +162,7 @@ class OrderServiceCharge extends JsonSerializableType private ?string $type; /** - * The treatment type of the service charge. + * Indicates whether the service charge will be treated as a value-holding line item or apportioned toward a line item. * See [OrderServiceChargeTreatmentType](#type-orderservicechargetreatmenttype) for possible values * * @var ?value-of $treatmentType diff --git a/src/Types/SearchOrdersSourceFilter.php b/src/Types/SearchOrdersSourceFilter.php index 7cbc3ca2..ca60d326 100644 --- a/src/Types/SearchOrdersSourceFilter.php +++ b/src/Types/SearchOrdersSourceFilter.php @@ -22,15 +22,41 @@ class SearchOrdersSourceFilter extends JsonSerializableType #[JsonProperty('source_names'), ArrayType(['string'])] private ?array $sourceNames; + /** + * Filters by the [Source](entity:OrderSource) `applicationId`. The filter returns any orders + * with a `source.applicationId` that matches any of the listed source applicationIds. + * + * Max: 100 source applicationIds. + * + * @var ?array $sourceApplicationIds + */ + #[JsonProperty('source_application_ids'), ArrayType(['string'])] + private ?array $sourceApplicationIds; + + /** + * Filters by the [Source](entity:OrderSource) `clientOu`. The filter returns any orders + * with a `source.clientOu` that matches any of the listed source clientOus. + * + * Max: 100 source clientOus. + * + * @var ?array $sourceClientOus + */ + #[JsonProperty('source_client_ous'), ArrayType(['string'])] + private ?array $sourceClientOus; + /** * @param array{ * sourceNames?: ?array, + * sourceApplicationIds?: ?array, + * sourceClientOus?: ?array, * } $values */ public function __construct( array $values = [], ) { $this->sourceNames = $values['sourceNames'] ?? null; + $this->sourceApplicationIds = $values['sourceApplicationIds'] ?? null; + $this->sourceClientOus = $values['sourceClientOus'] ?? null; } /** @@ -50,6 +76,40 @@ public function setSourceNames(?array $value = null): self return $this; } + /** + * @return ?array + */ + public function getSourceApplicationIds(): ?array + { + return $this->sourceApplicationIds; + } + + /** + * @param ?array $value + */ + public function setSourceApplicationIds(?array $value = null): self + { + $this->sourceApplicationIds = $value; + return $this; + } + + /** + * @return ?array + */ + public function getSourceClientOus(): ?array + { + return $this->sourceClientOus; + } + + /** + * @param ?array $value + */ + public function setSourceClientOus(?array $value = null): self + { + $this->sourceClientOus = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/SubscriptionTestResult.php b/src/Types/SubscriptionTestResult.php index 599640d9..c359e02a 100644 --- a/src/Types/SubscriptionTestResult.php +++ b/src/Types/SubscriptionTestResult.php @@ -4,10 +4,10 @@ use Square\Core\Json\JsonSerializableType; use Square\Core\Json\JsonProperty; +use Square\Core\Types\ArrayType; /** - * Represents the details of a webhook subscription, including notification URL, - * event types, and signature key. + * Represents the result of testing a webhook subscription. Note: The actual API returns these fields at the root level of TestWebhookSubscriptionResponse, not nested under this object. */ class SubscriptionTestResult extends JsonSerializableType { @@ -18,16 +18,16 @@ class SubscriptionTestResult extends JsonSerializableType private ?string $id; /** - * @var ?int $statusCode The status code returned by the subscription notification URL. + * @var ?int $statusCode The HTTP status code returned by the notification URL. */ #[JsonProperty('status_code')] private ?int $statusCode; /** - * @var ?string $payload An object containing the payload of the test event. For example, a `payment.created` event. + * @var ?array $payload The payload that was sent in the test notification. */ - #[JsonProperty('payload')] - private ?string $payload; + #[JsonProperty('payload'), ArrayType(['string' => 'mixed'])] + private ?array $payload; /** * The timestamp of when the subscription was created, in RFC 3339 format. @@ -47,13 +47,27 @@ class SubscriptionTestResult extends JsonSerializableType #[JsonProperty('updated_at')] private ?string $updatedAt; + /** + * @var ?string $notificationUrl The URL that was used for the webhook notification test. + */ + #[JsonProperty('notification_url')] + private ?string $notificationUrl; + + /** + * @var ?bool $passesFilter Whether the notification passed any configured filters. + */ + #[JsonProperty('passes_filter')] + private ?bool $passesFilter; + /** * @param array{ * id?: ?string, * statusCode?: ?int, - * payload?: ?string, + * payload?: ?array, * createdAt?: ?string, * updatedAt?: ?string, + * notificationUrl?: ?string, + * passesFilter?: ?bool, * } $values */ public function __construct( @@ -64,6 +78,8 @@ public function __construct( $this->payload = $values['payload'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->updatedAt = $values['updatedAt'] ?? null; + $this->notificationUrl = $values['notificationUrl'] ?? null; + $this->passesFilter = $values['passesFilter'] ?? null; } /** @@ -101,17 +117,17 @@ public function setStatusCode(?int $value = null): self } /** - * @return ?string + * @return ?array */ - public function getPayload(): ?string + public function getPayload(): ?array { return $this->payload; } /** - * @param ?string $value + * @param ?array $value */ - public function setPayload(?string $value = null): self + public function setPayload(?array $value = null): self { $this->payload = $value; return $this; @@ -151,6 +167,40 @@ public function setUpdatedAt(?string $value = null): self return $this; } + /** + * @return ?string + */ + public function getNotificationUrl(): ?string + { + return $this->notificationUrl; + } + + /** + * @param ?string $value + */ + public function setNotificationUrl(?string $value = null): self + { + $this->notificationUrl = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPassesFilter(): ?bool + { + return $this->passesFilter; + } + + /** + * @param ?bool $value + */ + public function setPassesFilter(?bool $value = null): self + { + $this->passesFilter = $value; + return $this; + } + /** * @return string */ diff --git a/src/Types/TestWebhookSubscriptionResponse.php b/src/Types/TestWebhookSubscriptionResponse.php index c4b300b4..84190d45 100644 --- a/src/Types/TestWebhookSubscriptionResponse.php +++ b/src/Types/TestWebhookSubscriptionResponse.php @@ -7,11 +7,7 @@ use Square\Core\Types\ArrayType; /** - * Defines the fields that are included in the response body of - * a request to the [TestWebhookSubscription](api-endpoint:WebhookSubscriptions-TestWebhookSubscription) endpoint. - * - * Note: If there are errors processing the request, the [SubscriptionTestResult](entity:SubscriptionTestResult) field is not - * present. + * Defines the fields that are included in the response body of a request to the TestWebhookSubscription endpoint. */ class TestWebhookSubscriptionResponse extends JsonSerializableType { @@ -27,10 +23,38 @@ class TestWebhookSubscriptionResponse extends JsonSerializableType #[JsonProperty('subscription_test_result')] private ?SubscriptionTestResult $subscriptionTestResult; + /** + * @var ?string $notificationUrl The URL that was used for the webhook notification test. + */ + #[JsonProperty('notification_url')] + private ?string $notificationUrl; + + /** + * @var ?int $statusCode The HTTP status code returned by the notification URL. + */ + #[JsonProperty('status_code')] + private ?int $statusCode; + + /** + * @var ?bool $passesFilter Whether the notification passed any configured filters. + */ + #[JsonProperty('passes_filter')] + private ?bool $passesFilter; + + /** + * @var ?array $payload The payload that was sent in the test notification. + */ + #[JsonProperty('payload'), ArrayType(['string' => 'mixed'])] + private ?array $payload; + /** * @param array{ * errors?: ?array, * subscriptionTestResult?: ?SubscriptionTestResult, + * notificationUrl?: ?string, + * statusCode?: ?int, + * passesFilter?: ?bool, + * payload?: ?array, * } $values */ public function __construct( @@ -38,6 +62,10 @@ public function __construct( ) { $this->errors = $values['errors'] ?? null; $this->subscriptionTestResult = $values['subscriptionTestResult'] ?? null; + $this->notificationUrl = $values['notificationUrl'] ?? null; + $this->statusCode = $values['statusCode'] ?? null; + $this->passesFilter = $values['passesFilter'] ?? null; + $this->payload = $values['payload'] ?? null; } /** @@ -74,6 +102,74 @@ public function setSubscriptionTestResult(?SubscriptionTestResult $value = null) return $this; } + /** + * @return ?string + */ + public function getNotificationUrl(): ?string + { + return $this->notificationUrl; + } + + /** + * @param ?string $value + */ + public function setNotificationUrl(?string $value = null): self + { + $this->notificationUrl = $value; + return $this; + } + + /** + * @return ?int + */ + public function getStatusCode(): ?int + { + return $this->statusCode; + } + + /** + * @param ?int $value + */ + public function setStatusCode(?int $value = null): self + { + $this->statusCode = $value; + return $this; + } + + /** + * @return ?bool + */ + public function getPassesFilter(): ?bool + { + return $this->passesFilter; + } + + /** + * @param ?bool $value + */ + public function setPassesFilter(?bool $value = null): self + { + $this->passesFilter = $value; + return $this; + } + + /** + * @return ?array + */ + public function getPayload(): ?array + { + return $this->payload; + } + + /** + * @param ?array $value + */ + public function setPayload(?array $value = null): self + { + $this->payload = $value; + return $this; + } + /** * @return string */ diff --git a/src/V1Transactions/V1TransactionsClient.php b/src/V1Transactions/V1TransactionsClient.php index 27c0f4fe..cb7f578b 100644 --- a/src/V1Transactions/V1TransactionsClient.php +++ b/src/V1Transactions/V1TransactionsClient.php @@ -27,7 +27,7 @@ class V1TransactionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Vendors/VendorsClient.php b/src/Vendors/VendorsClient.php index f3f427f1..d20bf686 100644 --- a/src/Vendors/VendorsClient.php +++ b/src/Vendors/VendorsClient.php @@ -36,7 +36,7 @@ class VendorsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Webhooks/EventTypes/EventTypesClient.php b/src/Webhooks/EventTypes/EventTypesClient.php index c0cd4a2b..7e78b6dc 100644 --- a/src/Webhooks/EventTypes/EventTypesClient.php +++ b/src/Webhooks/EventTypes/EventTypesClient.php @@ -24,7 +24,7 @@ class EventTypesClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Webhooks/Subscriptions/SubscriptionsClient.php b/src/Webhooks/Subscriptions/SubscriptionsClient.php index 1738b5a0..66fc51b1 100644 --- a/src/Webhooks/Subscriptions/SubscriptionsClient.php +++ b/src/Webhooks/Subscriptions/SubscriptionsClient.php @@ -39,7 +39,7 @@ class SubscriptionsClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/src/Webhooks/WebhooksClient.php b/src/Webhooks/WebhooksClient.php index 4d8909ae..30ecf2f7 100644 --- a/src/Webhooks/WebhooksClient.php +++ b/src/Webhooks/WebhooksClient.php @@ -26,7 +26,7 @@ class WebhooksClient * maxRetries?: int, * timeout?: float, * headers?: array, - * } $options + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator */ private array $options; diff --git a/tests/Core/Client/RawClientTest.php b/tests/Core/Client/RawClientTest.php index 54d136da..a1ec187c 100644 --- a/tests/Core/Client/RawClientTest.php +++ b/tests/Core/Client/RawClientTest.php @@ -5,6 +5,8 @@ use GuzzleHttp\Client; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; +use GuzzleHttp\Promise as P; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; use Psr\Http\Client\ClientExceptionInterface; @@ -441,4 +443,229 @@ public function testShouldFailOn400Response(): void $this->assertEquals(1, $this->mockHandler->count()); } + + public function testRetryAfterSecondsHeaderControlsDelay(): void + { + $responses = [ + new Response(503, ['Retry-After' => '10']), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 2, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $this->assertSame(0, $capturedOptions[0]['delay']); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThanOrEqual(10000, $delay); + $this->assertLessThanOrEqual(12000, $delay); + } + + public function testRetryAfterHttpDateHeaderIsHandled(): void + { + $retryAfterDate = gmdate('D, d M Y H:i:s \G\M\T', time() + 5); + + $responses = [ + new Response(503, ['Retry-After' => $retryAfterDate]), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 2, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThan(0, $delay); + $this->assertLessThanOrEqual(60000, $delay); + } + + public function testRateLimitResetHeaderControlsDelay(): void + { + $resetTime = (int) floor(microtime(true)) + 5; + $responses = [ + new Response(429, ['X-RateLimit-Reset' => (string) $resetTime]), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 2, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThan(0, $delay); + $this->assertLessThanOrEqual(60000, $delay); + } + + public function testRateLimitResetHeaderRespectsMaxDelayAndPositiveJitter(): void + { + $resetTime = (int) floor(microtime(true)) + 1000; + $responses = [ + new Response(429, ['X-RateLimit-Reset' => (string) $resetTime]), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 1, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThanOrEqual(60000, $delay); + $this->assertLessThanOrEqual(72000, $delay); + } + + public function testExponentialBackoffWithSymmetricJitterWhenNoHeaders(): void + { + $responses = [ + new Response(503), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 1, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThanOrEqual(900, $delay); + $this->assertLessThanOrEqual(1100, $delay); + } + + public function testRetryAfterHeaderTakesPrecedenceOverRateLimitReset(): void + { + $resetTime = (int) floor(microtime(true)) + 30; + $responses = [ + new Response(503, [ + 'Retry-After' => '5', + 'X-RateLimit-Reset' => (string) $resetTime, + ]), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 2, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThanOrEqual(5000, $delay); + $this->assertLessThanOrEqual(6000, $delay); + } + + public function testMaxDelayCapIsApplied(): void + { + $responses = [ + new Response(503, ['Retry-After' => '120']), + new Response(200), + ]; + $capturedOptions = []; + + $handler = function (RequestInterface $request, array $options) use (&$responses, &$capturedOptions) { + $capturedOptions[] = $options; + $response = array_shift($responses); + return P\Create::promiseFor($response); + }; + + $middleware = RetryMiddleware::create([ + 'maxRetries' => 2, + 'baseDelay' => 1000, + ]); + + $retryHandler = $middleware($handler); + $request = new Request('GET', $this->baseUrl . '/test'); + + $promise = $retryHandler($request, ['delay' => 0]); + $promise->wait(); + + $this->assertCount(2, $capturedOptions); + $delay = $capturedOptions[1]['delay']; + $this->assertGreaterThanOrEqual(60000, $delay); + $this->assertLessThanOrEqual(72000, $delay); + } } diff --git a/tests/Core/Json/ExhaustiveTest.php b/tests/Core/Json/ExhaustiveTest.php index 4384a3a1..38a29912 100644 --- a/tests/Core/Json/ExhaustiveTest.php +++ b/tests/Core/Json/ExhaustiveTest.php @@ -142,7 +142,7 @@ public function testExhaustive(): void 'simple_property' => 'Test String', // Omit 'nullable_property' to test null serialization 'date_property' => '2023-01-01', - 'datetime_property' => '2023-01-01T12:34:56+00:00', + 'datetime_property' => '2023-01-01T12:34:56Z', 'string_array' => ['one', 'two', 'three'], 'map_property' => ['key1' => 1, 'key2' => 2], 'object_array' => [ diff --git a/tests/Core/Json/UnionArrayTest.php b/tests/Core/Json/UnionArrayTest.php index fd2691d5..e551c764 100644 --- a/tests/Core/Json/UnionArrayTest.php +++ b/tests/Core/Json/UnionArrayTest.php @@ -37,7 +37,7 @@ public function testUnionArray(): void $expectedJson = json_encode( [ 'mixed_dates' => [ - 1 => '2023-01-01T12:00:00+00:00', + 1 => '2023-01-01T12:00:00Z', 2 => null, 3 => 'Some String' ] From fe458734ec8b8b7dd59399d803955aba984983da Mon Sep 17 00:00:00 2001 From: Mike Konopelski Date: Thu, 22 Jan 2026 13:46:48 -0500 Subject: [PATCH 2/2] Remove MobileAuthorizationTest - API no longer exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Mobile Authorization API has been removed, so this test is no longer valid. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- tests/Integration/MobileAuthorizationTest.php | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 tests/Integration/MobileAuthorizationTest.php diff --git a/tests/Integration/MobileAuthorizationTest.php b/tests/Integration/MobileAuthorizationTest.php deleted file mode 100644 index 3dcef349..00000000 --- a/tests/Integration/MobileAuthorizationTest.php +++ /dev/null @@ -1,39 +0,0 @@ -mobile->authorizationCode(new CreateMobileAuthorizationCodeRequest([ - 'locationId' => self::$locationId, - ])); - - $this->assertNotNull($response->getAuthorizationCode()); - $this->assertNotNull($response->getExpiresAt()); - } -}