Skip to content

Commit c226ee3

Browse files
[fern-generated] Update SDK (#183)
Generated by Fern CLI Version: unknown Generators: - fernapi/fern-php-sdk: 2.1.5 Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent d62b84d commit c226ee3

19 files changed

Lines changed: 599 additions & 68 deletions

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
}
2424
}
2525
},
26-
"sdkVersion": "45.0.0.20260122"
26+
"sdkVersion": "44.1.0.20260520"
2727
}

.fern/replay.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.fernignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ phpstan.neon
66
src/Exceptions/SquareApiException.php
77
src/Legacy
88
src/Utils/WebhooksHelper.php
9-
tests/Integration
9+
tests/Integration
10+
.fern/replay.lock
11+
.fern/replay.yml
12+
.gitattributes

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.fern/replay.lock linguist-generated=true

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "square/square",
3-
"version": "45.0.0.20260122",
3+
"version": "44.1.0.20260520",
44
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
55
"keywords": [
66
"square",

reference.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10967,6 +10967,19 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym
1096710967
<dl>
1096810968
<dd>
1096910969

10970+
**$appFeeAllocations:** `?array`
10971+
10972+
Details pertaining to recipients of the application fee. The sum of the amounts in the
10973+
app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
10974+
allocation must be present for every party that expects to receive a portion of the application
10975+
fee, including the application developer.
10976+
10977+
</dd>
10978+
</dl>
10979+
10980+
<dl>
10981+
<dd>
10982+
1097010983
**$delayDuration:** `?string`
1097110984

1097210985
The duration of time after the payment's creation when Square automatically
@@ -12172,6 +12185,19 @@ For more information, see [Permissions](https://developer.squareup.com/docs/paym
1217212185
<dl>
1217312186
<dd>
1217412187

12188+
**$appFeeAllocations:** `?array`
12189+
12190+
Details pertaining to contributors to the refund of the application fee.
12191+
The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
12192+
present. If populated, an allocation must be present for every party that expects to contribute
12193+
a portion of the refunded application fee, including the application developer.
12194+
12195+
</dd>
12196+
</dl>
12197+
12198+
<dl>
12199+
<dd>
12200+
1217512201
**$paymentId:** `?string`
1217612202

1217712203
The unique ID of the payment being refunded.

src/Payments/Requests/CreatePaymentRequest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Square\Core\Json\JsonSerializableType;
66
use Square\Core\Json\JsonProperty;
77
use Square\Types\Money;
8+
use Square\Core\Types\ArrayType;
89
use Square\Types\Address;
910
use Square\Types\CashPaymentDetails;
1011
use Square\Types\ExternalPaymentDetails;
@@ -98,6 +99,17 @@ class CreatePaymentRequest extends JsonSerializableType
9899
#[JsonProperty('app_fee_money')]
99100
private ?Money $appFeeMoney;
100101

102+
/**
103+
* Details pertaining to recipients of the application fee. The sum of the amounts in the
104+
* app_fee_allocations must equal the app_fee_money amount, if present. If populated, an
105+
* allocation must be present for every party that expects to receive a portion of the application
106+
* fee, including the application developer.
107+
*
108+
* @var ?array<mixed> $appFeeAllocations
109+
*/
110+
#[JsonProperty('app_fee_allocations'), ArrayType(['mixed'])]
111+
private ?array $appFeeAllocations;
112+
101113
/**
102114
* The duration of time after the payment's creation when Square automatically
103115
* either completes or cancels the payment depending on the `delay_action` field value.
@@ -303,6 +315,7 @@ class CreatePaymentRequest extends JsonSerializableType
303315
* amountMoney?: ?Money,
304316
* tipMoney?: ?Money,
305317
* appFeeMoney?: ?Money,
318+
* appFeeAllocations?: ?array<mixed>,
306319
* delayDuration?: ?string,
307320
* delayAction?: ?string,
308321
* autocomplete?: ?bool,
@@ -333,6 +346,7 @@ public function __construct(
333346
$this->amountMoney = $values['amountMoney'] ?? null;
334347
$this->tipMoney = $values['tipMoney'] ?? null;
335348
$this->appFeeMoney = $values['appFeeMoney'] ?? null;
349+
$this->appFeeAllocations = $values['appFeeAllocations'] ?? null;
336350
$this->delayDuration = $values['delayDuration'] ?? null;
337351
$this->delayAction = $values['delayAction'] ?? null;
338352
$this->autocomplete = $values['autocomplete'] ?? null;
@@ -445,6 +459,24 @@ public function setAppFeeMoney(?Money $value = null): self
445459
return $this;
446460
}
447461

462+
/**
463+
* @return ?array<mixed>
464+
*/
465+
public function getAppFeeAllocations(): ?array
466+
{
467+
return $this->appFeeAllocations;
468+
}
469+
470+
/**
471+
* @param ?array<mixed> $value
472+
*/
473+
public function setAppFeeAllocations(?array $value = null): self
474+
{
475+
$this->appFeeAllocations = $value;
476+
$this->_setField('appFeeAllocations');
477+
return $this;
478+
}
479+
448480
/**
449481
* @return ?string
450482
*/

src/Refunds/Requests/RefundPaymentRequest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Square\Core\Json\JsonSerializableType;
66
use Square\Core\Json\JsonProperty;
77
use Square\Types\Money;
8+
use Square\Core\Types\ArrayType;
89
use Square\Types\DestinationDetailsCashRefundDetails;
910
use Square\Types\DestinationDetailsExternalRefundDetails;
1011

@@ -61,6 +62,17 @@ class RefundPaymentRequest extends JsonSerializableType
6162
#[JsonProperty('app_fee_money')]
6263
private ?Money $appFeeMoney;
6364

65+
/**
66+
* Details pertaining to contributors to the refund of the application fee.
67+
* The sum of the amounts in the app_fee_allocations must equal the app_fee_money amount, if
68+
* present. If populated, an allocation must be present for every party that expects to contribute
69+
* a portion of the refunded application fee, including the application developer.
70+
*
71+
* @var ?array<mixed> $appFeeAllocations
72+
*/
73+
#[JsonProperty('app_fee_allocations'), ArrayType(['mixed'])]
74+
private ?array $appFeeAllocations;
75+
6476
/**
6577
* The unique ID of the payment being refunded.
6678
* Required when unlinked=false, otherwise must not be set.
@@ -157,6 +169,7 @@ class RefundPaymentRequest extends JsonSerializableType
157169
* idempotencyKey: string,
158170
* amountMoney: Money,
159171
* appFeeMoney?: ?Money,
172+
* appFeeAllocations?: ?array<mixed>,
160173
* paymentId?: ?string,
161174
* destinationId?: ?string,
162175
* unlinked?: ?bool,
@@ -175,6 +188,7 @@ public function __construct(
175188
$this->idempotencyKey = $values['idempotencyKey'];
176189
$this->amountMoney = $values['amountMoney'];
177190
$this->appFeeMoney = $values['appFeeMoney'] ?? null;
191+
$this->appFeeAllocations = $values['appFeeAllocations'] ?? null;
178192
$this->paymentId = $values['paymentId'] ?? null;
179193
$this->destinationId = $values['destinationId'] ?? null;
180194
$this->unlinked = $values['unlinked'] ?? null;
@@ -241,6 +255,24 @@ public function setAppFeeMoney(?Money $value = null): self
241255
return $this;
242256
}
243257

258+
/**
259+
* @return ?array<mixed>
260+
*/
261+
public function getAppFeeAllocations(): ?array
262+
{
263+
return $this->appFeeAllocations;
264+
}
265+
266+
/**
267+
* @param ?array<mixed> $value
268+
*/
269+
public function setAppFeeAllocations(?array $value = null): self
270+
{
271+
$this->appFeeAllocations = $value;
272+
$this->_setField('appFeeAllocations');
273+
return $this;
274+
}
275+
244276
/**
245277
* @return ?string
246278
*/

src/SquareClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ public function __construct(
253253
$token ??= $this->getFromEnvOrThrow('SQUARE_TOKEN', 'Please pass in token or set the environment variable SQUARE_TOKEN.');
254254
$defaultHeaders = [
255255
'Authorization' => "Bearer $token",
256-
'Square-Version' => '2026-01-22',
256+
'Square-Version' => '2026-05-20',
257257
'X-Fern-Language' => 'PHP',
258258
'X-Fern-SDK-Name' => 'Square',
259-
'X-Fern-SDK-Version' => '45.0.0.20260122',
260-
'User-Agent' => 'square/square/45.0.0.20260122',
259+
'X-Fern-SDK-Version' => '44.1.0.20260520',
260+
'User-Agent' => 'square/square/44.1.0.20260520',
261261
];
262262
if ($version != null) {
263263
$defaultHeaders['Square-Version'] = $version;

src/Types/CardPaymentDetails.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,26 @@ class CardPaymentDetails extends JsonSerializableType
140140
#[JsonProperty('errors'), ArrayType([Error::class])]
141141
private ?array $errors;
142142

143+
/**
144+
* @var ?CardSurchargeDetails $appliedCardSurchargeDetails Additional information about a card_surcharge on the payment.
145+
*/
146+
#[JsonProperty('applied_card_surcharge_details')]
147+
private ?CardSurchargeDetails $appliedCardSurchargeDetails;
148+
149+
/**
150+
* The type of digital wallet used for this card payment, if applicable.
151+
* Currently only populated for in-person Apple Pay payments. Detection has no false
152+
* positives but may have false negatives (some Apple Pay payments may not be detected).
153+
*
154+
* For payments with `source_type` of `WALLET`, see `DigitalWalletDetails` instead.
155+
*
156+
* Values: `APPLE_PAY`
157+
*
158+
* @var ?string $walletType
159+
*/
160+
#[JsonProperty('wallet_type')]
161+
private ?string $walletType;
162+
143163
/**
144164
* @param array{
145165
* status?: ?string,
@@ -158,6 +178,8 @@ class CardPaymentDetails extends JsonSerializableType
158178
* cardPaymentTimeline?: ?CardPaymentTimeline,
159179
* refundRequiresCardPresence?: ?bool,
160180
* errors?: ?array<Error>,
181+
* appliedCardSurchargeDetails?: ?CardSurchargeDetails,
182+
* walletType?: ?string,
161183
* } $values
162184
*/
163185
public function __construct(
@@ -179,6 +201,8 @@ public function __construct(
179201
$this->cardPaymentTimeline = $values['cardPaymentTimeline'] ?? null;
180202
$this->refundRequiresCardPresence = $values['refundRequiresCardPresence'] ?? null;
181203
$this->errors = $values['errors'] ?? null;
204+
$this->appliedCardSurchargeDetails = $values['appliedCardSurchargeDetails'] ?? null;
205+
$this->walletType = $values['walletType'] ?? null;
182206
}
183207

184208
/**
@@ -469,6 +493,42 @@ public function setErrors(?array $value = null): self
469493
return $this;
470494
}
471495

496+
/**
497+
* @return ?CardSurchargeDetails
498+
*/
499+
public function getAppliedCardSurchargeDetails(): ?CardSurchargeDetails
500+
{
501+
return $this->appliedCardSurchargeDetails;
502+
}
503+
504+
/**
505+
* @param ?CardSurchargeDetails $value
506+
*/
507+
public function setAppliedCardSurchargeDetails(?CardSurchargeDetails $value = null): self
508+
{
509+
$this->appliedCardSurchargeDetails = $value;
510+
$this->_setField('appliedCardSurchargeDetails');
511+
return $this;
512+
}
513+
514+
/**
515+
* @return ?string
516+
*/
517+
public function getWalletType(): ?string
518+
{
519+
return $this->walletType;
520+
}
521+
522+
/**
523+
* @param ?string $value
524+
*/
525+
public function setWalletType(?string $value = null): self
526+
{
527+
$this->walletType = $value;
528+
$this->_setField('walletType');
529+
return $this;
530+
}
531+
472532
/**
473533
* @return string
474534
*/

0 commit comments

Comments
 (0)