diff --git a/composer.json b/composer.json
index e4cbb8b8..47c3206e 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "square/square",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
- "version": "36.0.0.20240417",
+ "version": "37.0.0.20240515",
"type": "library",
"keywords": [
"Square",
@@ -23,8 +23,8 @@
"php": "^7.2 || ^8.0",
"ext-json": "*",
"apimatic/unirest-php": "^4.0.0",
- "apimatic/core-interfaces": "~0.1.0",
- "apimatic/core": "~0.3.0"
+ "apimatic/core-interfaces": "~0.1.5",
+ "apimatic/core": "~0.3.9"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.5",
diff --git a/doc/client.md b/doc/client.md
index 43d7ae56..39746375 100644
--- a/doc/client.md
+++ b/doc/client.md
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
-| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2024-04-17'` |
+| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2024-05-15'` |
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` |
| `environment` | `string` | The API environment.
**Default: `production`** |
| `timeout` | `int` | Timeout for API calls in seconds.
*Default*: `60` |
@@ -30,7 +30,7 @@ $client = SquareClientBuilder::init()
'AccessToken'
)
)
- ->squareVersion('2024-04-17')
+ ->squareVersion('2024-05-15')
->environment('production')
->customUrl('https://connect.squareup.com')
->build();
@@ -60,7 +60,7 @@ $client = SquareClientBuilder::init()
'AccessToken'
)
)
- ->squareVersion('2024-04-17')
+ ->squareVersion('2024-05-15')
->build();
$apiResponse = $client->getLocationsApi()->listLocations();
diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md
index f67ba758..544449c8 100644
--- a/doc/models/catalog-item.md
+++ b/doc/models/catalog-item.md
@@ -15,6 +15,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
| `description` | `?string` | Optional | The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description
of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field values are kept in sync. If you try to
set the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,
except for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null
does not nullify `description_html`.
**Constraints**: *Maximum Length*: `4096` | getDescription(): ?string | setDescription(?string description): void |
| `abbreviation` | `?string` | Optional | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.
This attribute is searchable, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `24` | getAbbreviation(): ?string | setAbbreviation(?string abbreviation): void |
| `labelColor` | `?string` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | getLabelColor(): ?string | setLabelColor(?string labelColor): void |
+| `isTaxable` | `?bool` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. | getIsTaxable(): ?bool | setIsTaxable(?bool isTaxable): void |
| `availableOnline` | `?bool` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | getAvailableOnline(): ?bool | setAvailableOnline(?bool availableOnline): void |
| `availableForPickup` | `?bool` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | getAvailableForPickup(): ?bool | setAvailableForPickup(?bool availableForPickup): void |
| `availableElectronically` | `?bool` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | getAvailableElectronically(): ?bool | setAvailableElectronically(?bool availableElectronically): void |
@@ -44,7 +45,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ
"description": "description6",
"abbreviation": "abbreviation8",
"label_color": "label_color8",
- "available_online": false
+ "is_taxable": false
}
```
diff --git a/doc/models/destination-details-card-refund-details.md b/doc/models/destination-details-card-refund-details.md
index 46114387..d22a6798 100644
--- a/doc/models/destination-details-card-refund-details.md
+++ b/doc/models/destination-details-card-refund-details.md
@@ -11,6 +11,7 @@
| --- | --- | --- | --- | --- | --- |
| `card` | [`?Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | getCard(): ?Card | setCard(?Card card): void |
| `entryMethod` | `?string` | Optional | The method used to enter the card's details for the refund. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | getEntryMethod(): ?string | setEntryMethod(?string entryMethod): void |
+| `authResultCode` | `?string` | Optional | The authorization code provided by the issuer when a refund is approved.
**Constraints**: *Maximum Length*: `10` | getAuthResultCode(): ?string | setAuthResultCode(?string authResultCode): void |
## Example (as JSON)
@@ -23,7 +24,8 @@
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method4"
+ "entry_method": "entry_method4",
+ "auth_result_code": "auth_result_code6"
}
```
diff --git a/doc/models/destination-details.md b/doc/models/destination-details.md
index eb866641..3e00adf6 100644
--- a/doc/models/destination-details.md
+++ b/doc/models/destination-details.md
@@ -25,7 +25,8 @@ Details about a refund's destination.
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method8"
+ "entry_method": "entry_method8",
+ "auth_result_code": "auth_result_code0"
}
}
```
diff --git a/doc/models/get-payment-refund-response.md b/doc/models/get-payment-refund-response.md
index 0e565b47..013707c9 100644
--- a/doc/models/get-payment-refund-response.md
+++ b/doc/models/get-payment-refund-response.md
@@ -55,7 +55,8 @@ present or it might be present in a FAILED state.
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method8"
+ "entry_method": "entry_method8",
+ "auth_result_code": "auth_result_code0"
}
}
},
diff --git a/doc/models/list-payment-refunds-response.md b/doc/models/list-payment-refunds-response.md
index 3e400db1..cf248e70 100644
--- a/doc/models/list-payment-refunds-response.md
+++ b/doc/models/list-payment-refunds-response.md
@@ -57,7 +57,8 @@ Either `errors` or `refunds` is present in a given response (never both).
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method8"
+ "entry_method": "entry_method8",
+ "auth_result_code": "auth_result_code0"
}
}
}
diff --git a/doc/models/payment-refund.md b/doc/models/payment-refund.md
index 36ff4867..ffc5aa9e 100644
--- a/doc/models/payment-refund.md
+++ b/doc/models/payment-refund.md
@@ -46,7 +46,8 @@ the original payment and the amount of money refunded.
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method8"
+ "entry_method": "entry_method8",
+ "auth_result_code": "auth_result_code0"
}
},
"amount_money": {
diff --git a/doc/models/payment.md b/doc/models/payment.md
index 7c262572..0c091ae0 100644
--- a/doc/models/payment.md
+++ b/doc/models/payment.md
@@ -51,6 +51,7 @@ Represents a payment processed by the Square API.
| `receiptUrl` | `?string` | Optional | The URL for the payment's receipt.
The field is only populated for COMPLETED payments.
**Constraints**: *Maximum Length*: `255` | getReceiptUrl(): ?string | setReceiptUrl(?string receiptUrl): void |
| `deviceDetails` | [`?DeviceDetails`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | getDeviceDetails(): ?DeviceDetails | setDeviceDetails(?DeviceDetails deviceDetails): void |
| `applicationDetails` | [`?ApplicationDetails`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | getApplicationDetails(): ?ApplicationDetails | setApplicationDetails(?ApplicationDetails applicationDetails): void |
+| `isOfflinePayment` | `?bool` | Optional | Whether or not this payment was taken offline. | getIsOfflinePayment(): ?bool | setIsOfflinePayment(?bool isOfflinePayment): void |
| `versionToken` | `?string` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | getVersionToken(): ?string | setVersionToken(?string versionToken): void |
## Example (as JSON)
diff --git a/doc/models/refund-payment-response.md b/doc/models/refund-payment-response.md
index 20a0beba..cb7b5bc5 100644
--- a/doc/models/refund-payment-response.md
+++ b/doc/models/refund-payment-response.md
@@ -50,7 +50,8 @@ present, or it might be present with a status of `FAILED`.
"exp_month": 228,
"exp_year": 68
},
- "entry_method": "entry_method8"
+ "entry_method": "entry_method8",
+ "auth_result_code": "auth_result_code0"
}
}
},
diff --git a/src/Authentication/BearerAuthManager.php b/src/Authentication/BearerAuthManager.php
index c4a877bd..aac2b4f4 100644
--- a/src/Authentication/BearerAuthManager.php
+++ b/src/Authentication/BearerAuthManager.php
@@ -6,6 +6,7 @@
use Core\Authentication\CoreAuth;
use Core\Request\Parameters\HeaderParam;
+use Core\Utils\CoreHelper;
use Square\BearerAuthCredentials;
/**
@@ -22,7 +23,9 @@ class BearerAuthManager extends CoreAuth implements BearerAuthCredentials
*/
public function __construct(string $accessToken)
{
- parent::__construct(HeaderParam::init('Authorization', 'Bearer ' . $accessToken)->required());
+ parent::__construct(
+ HeaderParam::init('Authorization', CoreHelper::getBearerAuthString($accessToken))->requiredNonEmpty()
+ );
$this->accessToken = $accessToken;
}
diff --git a/src/ConfigurationDefaults.php b/src/ConfigurationDefaults.php
index 109f124f..317fc2b6 100644
--- a/src/ConfigurationDefaults.php
+++ b/src/ConfigurationDefaults.php
@@ -27,7 +27,7 @@ class ConfigurationDefaults
public const HTTP_METHODS_TO_RETRY = ['GET', 'PUT'];
- public const SQUARE_VERSION = '2024-04-17';
+ public const SQUARE_VERSION = '2024-05-15';
public const ADDITIONAL_HEADERS = [];
diff --git a/src/Models/Builders/CatalogItemBuilder.php b/src/Models/Builders/CatalogItemBuilder.php
index c6aff2b3..4d14a724 100644
--- a/src/Models/Builders/CatalogItemBuilder.php
+++ b/src/Models/Builders/CatalogItemBuilder.php
@@ -107,6 +107,24 @@ public function unsetLabelColor(): self
return $this;
}
+ /**
+ * Sets is taxable field.
+ */
+ public function isTaxable(?bool $value): self
+ {
+ $this->instance->setIsTaxable($value);
+ return $this;
+ }
+
+ /**
+ * Unsets is taxable field.
+ */
+ public function unsetIsTaxable(): self
+ {
+ $this->instance->unsetIsTaxable();
+ return $this;
+ }
+
/**
* Sets available online field.
*/
diff --git a/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php b/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php
index ea6a6783..e7c7a915 100644
--- a/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php
+++ b/src/Models/Builders/DestinationDetailsCardRefundDetailsBuilder.php
@@ -60,6 +60,24 @@ public function unsetEntryMethod(): self
return $this;
}
+ /**
+ * Sets auth result code field.
+ */
+ public function authResultCode(?string $value): self
+ {
+ $this->instance->setAuthResultCode($value);
+ return $this;
+ }
+
+ /**
+ * Unsets auth result code field.
+ */
+ public function unsetAuthResultCode(): self
+ {
+ $this->instance->unsetAuthResultCode();
+ return $this;
+ }
+
/**
* Initializes a new destination details card refund details object.
*/
diff --git a/src/Models/Builders/PaymentBuilder.php b/src/Models/Builders/PaymentBuilder.php
index ccc547b7..c701bdfd 100644
--- a/src/Models/Builders/PaymentBuilder.php
+++ b/src/Models/Builders/PaymentBuilder.php
@@ -413,6 +413,15 @@ public function applicationDetails(?ApplicationDetails $value): self
return $this;
}
+ /**
+ * Sets is offline payment field.
+ */
+ public function isOfflinePayment(?bool $value): self
+ {
+ $this->instance->setIsOfflinePayment($value);
+ return $this;
+ }
+
/**
* Sets version token field.
*/
diff --git a/src/Models/CatalogItem.php b/src/Models/CatalogItem.php
index 7ef0a450..7af3b6bf 100644
--- a/src/Models/CatalogItem.php
+++ b/src/Models/CatalogItem.php
@@ -32,6 +32,11 @@ class CatalogItem implements \JsonSerializable
*/
private $labelColor = [];
+ /**
+ * @var array
+ */
+ private $isTaxable = [];
+
/**
* @var array
*/
@@ -305,6 +310,38 @@ public function unsetLabelColor(): void
$this->labelColor = [];
}
+ /**
+ * Returns Is Taxable.
+ * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.
+ */
+ public function getIsTaxable(): ?bool
+ {
+ if (count($this->isTaxable) == 0) {
+ return null;
+ }
+ return $this->isTaxable['value'];
+ }
+
+ /**
+ * Sets Is Taxable.
+ * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.
+ *
+ * @maps is_taxable
+ */
+ public function setIsTaxable(?bool $isTaxable): void
+ {
+ $this->isTaxable['value'] = $isTaxable;
+ }
+
+ /**
+ * Unsets Is Taxable.
+ * Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`.
+ */
+ public function unsetIsTaxable(): void
+ {
+ $this->isTaxable = [];
+ }
+
/**
* Returns Available Online.
* If `true`, the item can be added to shipping orders from the merchant's online store.
@@ -1096,6 +1133,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
if (!empty($this->labelColor)) {
$json['label_color'] = $this->labelColor['value'];
}
+ if (!empty($this->isTaxable)) {
+ $json['is_taxable'] = $this->isTaxable['value'];
+ }
if (!empty($this->availableOnline)) {
$json['available_online'] = $this->availableOnline['value'];
}
diff --git a/src/Models/DestinationDetailsCardRefundDetails.php b/src/Models/DestinationDetailsCardRefundDetails.php
index 4eeb442d..1d2b191a 100644
--- a/src/Models/DestinationDetailsCardRefundDetails.php
+++ b/src/Models/DestinationDetailsCardRefundDetails.php
@@ -18,6 +18,11 @@ class DestinationDetailsCardRefundDetails implements \JsonSerializable
*/
private $entryMethod = [];
+ /**
+ * @var array
+ */
+ private $authResultCode = [];
+
/**
* Returns Card.
* Represents the payment details of a card to be used for payments. These
@@ -75,6 +80,38 @@ public function unsetEntryMethod(): void
$this->entryMethod = [];
}
+ /**
+ * Returns Auth Result Code.
+ * The authorization code provided by the issuer when a refund is approved.
+ */
+ public function getAuthResultCode(): ?string
+ {
+ if (count($this->authResultCode) == 0) {
+ return null;
+ }
+ return $this->authResultCode['value'];
+ }
+
+ /**
+ * Sets Auth Result Code.
+ * The authorization code provided by the issuer when a refund is approved.
+ *
+ * @maps auth_result_code
+ */
+ public function setAuthResultCode(?string $authResultCode): void
+ {
+ $this->authResultCode['value'] = $authResultCode;
+ }
+
+ /**
+ * Unsets Auth Result Code.
+ * The authorization code provided by the issuer when a refund is approved.
+ */
+ public function unsetAuthResultCode(): void
+ {
+ $this->authResultCode = [];
+ }
+
/**
* Encode this object to JSON
*
@@ -88,10 +125,13 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
{
$json = [];
if (isset($this->card)) {
- $json['card'] = $this->card;
+ $json['card'] = $this->card;
}
if (!empty($this->entryMethod)) {
- $json['entry_method'] = $this->entryMethod['value'];
+ $json['entry_method'] = $this->entryMethod['value'];
+ }
+ if (!empty($this->authResultCode)) {
+ $json['auth_result_code'] = $this->authResultCode['value'];
}
$json = array_filter($json, function ($val) {
return $val !== null;
diff --git a/src/Models/Payment.php b/src/Models/Payment.php
index 89a7f167..77ab39ed 100644
--- a/src/Models/Payment.php
+++ b/src/Models/Payment.php
@@ -211,6 +211,11 @@ class Payment implements \JsonSerializable
*/
private $applicationDetails;
+ /**
+ * @var bool|null
+ */
+ private $isOfflinePayment;
+
/**
* @var array
*/
@@ -1244,6 +1249,26 @@ public function setApplicationDetails(?ApplicationDetails $applicationDetails):
$this->applicationDetails = $applicationDetails;
}
+ /**
+ * Returns Is Offline Payment.
+ * Whether or not this payment was taken offline.
+ */
+ public function getIsOfflinePayment(): ?bool
+ {
+ return $this->isOfflinePayment;
+ }
+
+ /**
+ * Sets Is Offline Payment.
+ * Whether or not this payment was taken offline.
+ *
+ * @maps is_offline_payment
+ */
+ public function setIsOfflinePayment(?bool $isOfflinePayment): void
+ {
+ $this->isOfflinePayment = $isOfflinePayment;
+ }
+
/**
* Returns Version Token.
* Used for optimistic concurrency. This opaque token identifies a specific version of the
@@ -1411,6 +1436,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
if (isset($this->applicationDetails)) {
$json['application_details'] = $this->applicationDetails;
}
+ if (isset($this->isOfflinePayment)) {
+ $json['is_offline_payment'] = $this->isOfflinePayment;
+ }
if (!empty($this->versionToken)) {
$json['version_token'] = $this->versionToken['value'];
}
diff --git a/src/SquareClient.php b/src/SquareClient.php
index 5c0ac289..63371435 100644
--- a/src/SquareClient.php
+++ b/src/SquareClient.php
@@ -164,7 +164,7 @@ public function __construct(array $config = [])
->jsonHelper(ApiHelper::getJsonHelper())
->apiCallback($this->config['httpCallback'] ?? null)
->userAgent(
- 'Square-PHP-SDK/36.0.0.20240417 ({api-version}) {engine}/{engine-version} ({os-' .
+ 'Square-PHP-SDK/37.0.0.20240515 ({api-version}) {engine}/{engine-version} ({os-' .
'info}) {detail}'
)
->userAgentConfig(
@@ -319,7 +319,7 @@ public function withConfiguration(array $config): self
*/
public function getSdkVersion(): string
{
- return '36.0.0.20240417';
+ return '37.0.0.20240515';
}
/**