Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "3.38.0",
"cliVersion": "3.98.5",
"generatorName": "fernapi/fern-php-sdk",
"generatorVersion": "1.25.2",
"generatorVersion": "2.1.5",
"generatorConfig": {
"clientName": "SquareClient",
"namespace": "Square",
Expand All @@ -23,5 +23,5 @@
}
}
},
"sdkVersion": "44.0.0.20260122"
"sdkVersion": "45.0.0.20260122"
}
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "square/square",
"version": "44.0.0.20260122",
"version": "45.0.0.20260122",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"keywords": [
"square",
Expand All @@ -11,15 +11,22 @@
"require": {
"php": "^8.1",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.4",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "^1.0",
"psr/http-factory": "^1.0",
"psr/http-factory-implementation": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"php-http/discovery": "^1.0",
"php-http/multipart-stream-builder": "^1.0",
"apimatic/unirest-php": "^4.0.0",
"apimatic/core-interfaces": "~0.1.5",
"apimatic/core": "~0.3.12"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"friendsofphp/php-cs-fixer": "3.5.0",
"phpstan/phpstan": "^1.12"
"phpstan/phpstan": "^1.12",
"guzzlehttp/guzzle": "^7.4"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 11 additions & 5 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4898,6 +4898,7 @@ multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats
$client->disputes->createEvidenceFile(
new CreateEvidenceFileDisputesRequest([
'disputeId' => 'dispute_id',
'imageFile' => File::createFromString("example_image_file", "example_image_file"),
]),
);
```
Expand Down Expand Up @@ -7489,6 +7490,7 @@ __NOTE:__ When testing in the Sandbox environment, the total file size is limite
$client->invoices->createInvoiceAttachment(
new CreateInvoiceAttachmentRequest([
'invoiceId' => 'invoice_id',
'imageFile' => File::createFromString("example_image_file", "example_image_file"),
]),
);
```
Expand Down Expand Up @@ -17436,7 +17438,9 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.

```php
$client->catalog->images->create(
new CreateImagesRequest([]),
new CreateImagesRequest([
'imageFile' => File::createFromString("example_image_file", "example_image_file"),
]),
);
```
</dd>
Expand Down Expand Up @@ -17482,6 +17486,7 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.
$client->catalog->images->update(
new UpdateImagesRequest([
'imageId' => 'image_id',
'imageFile' => File::createFromString("example_image_file", "example_image_file"),
]),
);
```
Expand Down Expand Up @@ -18320,7 +18325,7 @@ $client->customers->customAttributeDefinitions->create(
'customAttributeDefinition' => new CustomAttributeDefinition([
'key' => 'favoritemovie',
'schema' => [
'\$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
'$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
],
'name' => 'Favorite Movie',
'description' => 'The favorite movie of the customer.',
Expand Down Expand Up @@ -21932,7 +21937,7 @@ $client->locations->customAttributeDefinitions->create(
'customAttributeDefinition' => new CustomAttributeDefinition([
'key' => 'bestseller',
'schema' => [
'\$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
'$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
],
'name' => 'Bestseller',
'description' => 'Bestselling item at location',
Expand Down Expand Up @@ -24642,7 +24647,7 @@ $client->merchants->customAttributeDefinitions->create(
'customAttributeDefinition' => new CustomAttributeDefinition([
'key' => 'alternative_seller_name',
'schema' => [
'\$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
'$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
],
'name' => 'Alternative Merchant Name',
'description' => 'This is the other name this merchant goes by.',
Expand Down Expand Up @@ -25604,7 +25609,7 @@ $client->orders->customAttributeDefinitions->create(
'customAttributeDefinition' => new CustomAttributeDefinition([
'key' => 'cover-count',
'schema' => [
'\$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number",
'$ref' => "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number",
],
'name' => 'Cover count',
'description' => 'The number of people seated at a table',
Expand Down Expand Up @@ -28034,3 +28039,4 @@ contained in the list of event types in the [Subscription](entity:WebhookSubscri
</dd>
</dl>
</details>

13 changes: 1 addition & 12 deletions src/ApplePay/ApplePayClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Square\ApplePay;

use GuzzleHttp\ClientInterface;
use Psr\Http\Client\ClientInterface;
use Square\Core\Client\RawClient;
use Square\ApplePay\Requests\RegisterDomainRequest;
use Square\Types\RegisterDomainResponse;
Expand All @@ -12,7 +12,6 @@
use Square\Environments;
use Square\Core\Client\HttpMethod;
use JsonException;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Client\ClientExceptionInterface;

class ApplePayClient
Expand Down Expand Up @@ -100,16 +99,6 @@ public function registerDomain(RegisterDomainRequest $request, ?array $options =
}
} 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);
}
Expand Down
1 change: 1 addition & 0 deletions src/ApplePay/Requests/RegisterDomainRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function getDomainName(): string
public function setDomainName(string $value): self
{
$this->domainName = $value;
$this->_setField('domainName');
return $this;
}
}
53 changes: 1 addition & 52 deletions src/BankAccounts/BankAccountsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Square\BankAccounts;

use GuzzleHttp\ClientInterface;
use Psr\Http\Client\ClientInterface;
use Square\Core\Client\RawClient;
use Square\BankAccounts\Requests\ListBankAccountsRequest;
use Square\Core\Pagination\Pager;
Expand All @@ -17,7 +17,6 @@
use Square\Environments;
use Square\Core\Client\HttpMethod;
use JsonException;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Client\ClientExceptionInterface;
use Square\BankAccounts\Requests\GetByV1IdBankAccountsRequest;
use Square\Types\GetBankAccountByV1IdResponse;
Expand Down Expand Up @@ -127,16 +126,6 @@ public function createBankAccount(CreateBankAccountRequest $request, ?array $opt
}
} 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);
}
Expand Down Expand Up @@ -182,16 +171,6 @@ public function getByV1Id(GetByV1IdBankAccountsRequest $request, ?array $options
}
} 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);
}
Expand Down Expand Up @@ -237,16 +216,6 @@ public function get(GetBankAccountsRequest $request, ?array $options = null): Ge
}
} 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);
}
Expand Down Expand Up @@ -292,16 +261,6 @@ public function disableBankAccount(DisableBankAccountRequest $request, ?array $o
}
} 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);
}
Expand Down Expand Up @@ -361,16 +320,6 @@ private function _list(ListBankAccountsRequest $request = new ListBankAccountsRe
}
} 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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/BankAccounts/Requests/CreateBankAccountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function getIdempotencyKey(): string
public function setIdempotencyKey(string $value): self
{
$this->idempotencyKey = $value;
$this->_setField('idempotencyKey');
return $this;
}

Expand All @@ -77,6 +78,7 @@ public function getSourceId(): string
public function setSourceId(string $value): self
{
$this->sourceId = $value;
$this->_setField('sourceId');
return $this;
}

Expand All @@ -94,6 +96,7 @@ public function getCustomerId(): ?string
public function setCustomerId(?string $value = null): self
{
$this->customerId = $value;
$this->_setField('customerId');
return $this;
}
}
1 change: 1 addition & 0 deletions src/BankAccounts/Requests/DisableBankAccountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function getBankAccountId(): string
public function setBankAccountId(string $value): self
{
$this->bankAccountId = $value;
$this->_setField('bankAccountId');
return $this;
}
}
1 change: 1 addition & 0 deletions src/BankAccounts/Requests/GetBankAccountsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function getBankAccountId(): string
public function setBankAccountId(string $value): self
{
$this->bankAccountId = $value;
$this->_setField('bankAccountId');
return $this;
}
}
1 change: 1 addition & 0 deletions src/BankAccounts/Requests/GetByV1IdBankAccountsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function getV1BankAccountId(): string
public function setV1BankAccountId(string $value): self
{
$this->v1BankAccountId = $value;
$this->_setField('v1BankAccountId');
return $this;
}
}
4 changes: 4 additions & 0 deletions src/BankAccounts/Requests/ListBankAccountsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function getCursor(): ?string
public function setCursor(?string $value = null): self
{
$this->cursor = $value;
$this->_setField('cursor');
return $this;
}

Expand All @@ -90,6 +91,7 @@ public function getLimit(): ?int
public function setLimit(?int $value = null): self
{
$this->limit = $value;
$this->_setField('limit');
return $this;
}

Expand All @@ -107,6 +109,7 @@ public function getLocationId(): ?string
public function setLocationId(?string $value = null): self
{
$this->locationId = $value;
$this->_setField('locationId');
return $this;
}

Expand All @@ -124,6 +127,7 @@ public function getCustomerId(): ?string
public function setCustomerId(?string $value = null): self
{
$this->customerId = $value;
$this->_setField('customerId');
return $this;
}
}
Loading
Loading