Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
}
}
},
"originGitCommit": "b05364cda2b85e35d8daa9ff2c24bbabbbd9652a",
"sdkVersion": "46.1.0.20260819"
"originGitCommit": "37b3f34f979590cc8d882c9ab2fe92748bfb0556",
"sdkVersion": "47.0.0.20260916"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "square/square",
"version": "46.1.0.20260819",
"version": "47.0.0.20260916",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"keywords": [
"square",
Expand Down
50 changes: 6 additions & 44 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -23651,29 +23651,10 @@ $client->locations->transactions->get(
</dl>
</details>

<details><summary><code>$client-&gt;locations-&gt;transactions-&gt;capture($request) -> CaptureTransactionResponse</code></summary>
<details><summary><code>$client-&gt;locations-&gt;transactions-&gt;capture($request)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)
endpoint with a `delay_capture` value of `true`.


See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)
for more information.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down Expand Up @@ -23703,15 +23684,15 @@ $client->locations->transactions->capture(
<dl>
<dd>

**$locationId:** `string` —
**$locationId:** `string`

</dd>
</dl>

<dl>
<dd>

**$transactionId:** `string` —
**$transactionId:** `string`

</dd>
</dl>
Expand All @@ -23723,29 +23704,10 @@ $client->locations->transactions->capture(
</dl>
</details>

<details><summary><code>$client-&gt;locations-&gt;transactions-&gt;void($request) -> VoidTransactionResponse</code></summary>
<details><summary><code>$client-&gt;locations-&gt;transactions-&gt;void($request)</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)
endpoint with a `delay_capture` value of `true`.


See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)
for more information.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down Expand Up @@ -23775,15 +23737,15 @@ $client->locations->transactions->void(
<dl>
<dd>

**$locationId:** `string` —
**$locationId:** `string`

</dd>
</dl>

<dl>
<dd>

**$transactionId:** `string` —
**$transactionId:** `string`

</dd>
</dl>
Expand Down
32 changes: 4 additions & 28 deletions src/Locations/Transactions/TransactionsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
use Square\Locations\Transactions\Requests\GetTransactionsRequest;
use Square\Types\GetTransactionResponse;
use Square\Locations\Transactions\Requests\CaptureTransactionsRequest;
use Square\Types\CaptureTransactionResponse;
use Square\Locations\Transactions\Requests\VoidTransactionsRequest;
use Square\Types\VoidTransactionResponse;

class TransactionsClient
{
Expand Down Expand Up @@ -166,13 +164,6 @@ public function get(GetTransactionsRequest $request, ?array $options = null): Ge
}

/**
* Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)
* endpoint with a `delay_capture` value of `true`.
*
*
* See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)
* for more information.
*
* @param CaptureTransactionsRequest $request
* @param ?array{
* baseUrl?: string,
Expand All @@ -182,11 +173,10 @@ public function get(GetTransactionsRequest $request, ?array $options = null): Ge
* queryParameters?: array<string, mixed>,
* bodyProperties?: array<string, mixed>,
* } $options
* @return CaptureTransactionResponse
* @throws SquareException
* @throws SquareApiException
*/
public function capture(CaptureTransactionsRequest $request, ?array $options = null): CaptureTransactionResponse
public function capture(CaptureTransactionsRequest $request, ?array $options = null): void
{
$options = array_merge($this->options, $options ?? []);
try {
Expand All @@ -200,11 +190,8 @@ public function capture(CaptureTransactionsRequest $request, ?array $options = n
);
$statusCode = $response->getStatusCode();
if ($statusCode >= 200 && $statusCode < 400) {
$json = $response->getBody()->getContents();
return CaptureTransactionResponse::fromJson($json);
return;
}
} catch (JsonException $e) {
throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
} catch (ClientExceptionInterface $e) {
throw new SquareException(message: $e->getMessage(), previous: $e);
}
Expand All @@ -216,13 +203,6 @@ public function capture(CaptureTransactionsRequest $request, ?array $options = n
}

/**
* Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge)
* endpoint with a `delay_capture` value of `true`.
*
*
* See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture)
* for more information.
*
* @param VoidTransactionsRequest $request
* @param ?array{
* baseUrl?: string,
Expand All @@ -232,11 +212,10 @@ public function capture(CaptureTransactionsRequest $request, ?array $options = n
* queryParameters?: array<string, mixed>,
* bodyProperties?: array<string, mixed>,
* } $options
* @return VoidTransactionResponse
* @throws SquareException
* @throws SquareApiException
*/
public function void(VoidTransactionsRequest $request, ?array $options = null): VoidTransactionResponse
public function void(VoidTransactionsRequest $request, ?array $options = null): void
{
$options = array_merge($this->options, $options ?? []);
try {
Expand All @@ -250,11 +229,8 @@ public function void(VoidTransactionsRequest $request, ?array $options = null):
);
$statusCode = $response->getStatusCode();
if ($statusCode >= 200 && $statusCode < 400) {
$json = $response->getBody()->getContents();
return VoidTransactionResponse::fromJson($json);
return;
}
} catch (JsonException $e) {
throw new SquareException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
} catch (ClientExceptionInterface $e) {
throw new SquareException(message: $e->getMessage(), previous: $e);
}
Expand Down
6 changes: 3 additions & 3 deletions src/SquareClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ 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' => '2026-08-19',
'Square-Version' => '2026-09-16',
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'Square',
'X-Fern-SDK-Version' => '46.1.0.20260819',
'User-Agent' => 'square/square/46.1.0.20260819',
'X-Fern-SDK-Version' => '47.0.0.20260916',
'User-Agent' => 'square/square/47.0.0.20260916',
];
if ($version != null) {
$defaultHeaders['Square-Version'] = $version;
Expand Down
57 changes: 0 additions & 57 deletions src/Types/CaptureTransactionResponse.php

This file was deleted.

57 changes: 0 additions & 57 deletions src/Types/VoidTransactionResponse.php

This file was deleted.

Loading