Skip to content

Commit 935bdfe

Browse files
Merge pull request #1888 from stripe/latest-codegen-beta
Update generated code for beta
2 parents ca24838 + 3871c63 commit 935bdfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+808
-742
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-07-30.preview
1+
2025-08-27.preview

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ This release changes the pinned API version to `2025-07-30.preview`.
1919
* Remove support for thin event `V2CoreAccountLinkCompletedEvent`
2020
* Remove support for thin event `V2OffSessionPaymentRequiresCaptureEvent` with related object `V2.Payments.OffSessionPayment`
2121

22+
## 17.5.0 - 2025-07-30
23+
This release changes the pinned API version to `2025-07-30.basil`.
24+
25+
* [#1887](https://github.com/stripe/stripe-php/pull/1887) Update generated code
26+
* Add support for `origin_context` on `Checkout.Session`
27+
* [#1881](https://github.com/stripe/stripe-php/pull/1881) Ensure compatibility with POST on older versions of libcurl
28+
* Fixes an issue with older versions of php/libcurl where certain SDK calls that have empty POST bodies will result in a 400 Bad Request returned from the server.
29+
2230
## 17.5.0-beta.2 - 2025-07-09
2331
* [#1886](https://github.com/stripe/stripe-php/pull/1886) Pull in V2 FinancialAccount changes for June release
2432
* Add support for `close` and `create` methods on resource `V2.MoneyManagement.FinancialAccount`
@@ -46,6 +54,8 @@ This release changes the pinned API version to `2025-06-30.preview`.
4654
* Change type of `V2.MoneyManagement.ReceivedCredit.balance_transfer.payout_v1` from `string` to `nullable(string)`
4755

4856
## 17.4.0 - 2025-07-01
57+
This release changes the pinned API version to `2025-06-30.basil`.
58+
4959
* [#1880](https://github.com/stripe/stripe-php/pull/1880) Update generated code
5060
* Add support for `migrate` method on resource `Subscription`
5161
* Add support for `collect_payment_method` and `confirm_payment_intent` methods on resource `Terminal.Reader`

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1868
1+
v1932

lib/AccountSession.php

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

lib/ApiRequestor.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
270270
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
271271

272272
// The beginning of the section generated from our OpenAPI spec
273-
case 'temporary_session_expired':
274-
return Exception\TemporarySessionExpiredException::factory(
273+
case 'already_canceled':
274+
return Exception\AlreadyCanceledException::factory(
275275
$msg,
276276
$rcode,
277277
$rbody,
@@ -280,8 +280,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
280280
$code
281281
);
282282

283-
case 'non_zero_balance':
284-
return Exception\NonZeroBalanceException::factory(
283+
case 'already_exists':
284+
return Exception\AlreadyExistsException::factory(
285285
$msg,
286286
$rcode,
287287
$rbody,
@@ -290,8 +290,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
290290
$code
291291
);
292292

293-
case 'already_exists':
294-
return Exception\AlreadyExistsException::factory(
293+
case 'blocked_by_stripe':
294+
return Exception\BlockedByStripeException::factory(
295295
$msg,
296296
$rcode,
297297
$rbody,
@@ -300,8 +300,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
300300
$code
301301
);
302302

303-
case 'feature_not_enabled':
304-
return Exception\FeatureNotEnabledException::factory(
303+
case 'controlled_by_dashboard':
304+
return Exception\ControlledByDashboardException::factory(
305305
$msg,
306306
$rcode,
307307
$rbody,
@@ -310,8 +310,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
310310
$code
311311
);
312312

313-
case 'financial_account_not_open':
314-
return Exception\FinancialAccountNotOpenException::factory(
313+
case 'feature_not_enabled':
314+
return Exception\FeatureNotEnabledException::factory(
315315
$msg,
316316
$rcode,
317317
$rbody,
@@ -320,8 +320,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
320320
$code
321321
);
322322

323-
case 'blocked_by_stripe':
324-
return Exception\BlockedByStripeException::factory(
323+
case 'financial_account_not_open':
324+
return Exception\FinancialAccountNotOpenException::factory(
325325
$msg,
326326
$rcode,
327327
$rbody,
@@ -330,8 +330,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
330330
$code
331331
);
332332

333-
case 'already_canceled':
334-
return Exception\AlreadyCanceledException::factory(
333+
case 'insufficient_funds':
334+
return Exception\InsufficientFundsException::factory(
335335
$msg,
336336
$rcode,
337337
$rbody,
@@ -340,18 +340,21 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
340340
$code
341341
);
342342

343-
case 'not_cancelable':
344-
return Exception\NotCancelableException::factory(
343+
case 'invalid_payment_method':
344+
$invalidParam = isset($errorData['invalid_param']) ? $errorData['invalid_param'] : null;
345+
346+
return Exception\InvalidPaymentMethodException::factory(
345347
$msg,
346348
$rcode,
347349
$rbody,
348350
$resp,
349351
$rheaders,
350-
$code
352+
$code,
353+
$invalidParam
351354
);
352355

353-
case 'insufficient_funds':
354-
return Exception\InsufficientFundsException::factory(
356+
case 'invalid_payout_method':
357+
return Exception\InvalidPayoutMethodException::factory(
355358
$msg,
356359
$rcode,
357360
$rbody,
@@ -360,8 +363,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
360363
$code
361364
);
362365

363-
case 'quota_exceeded':
364-
return Exception\QuotaExceededException::factory(
366+
case 'non_zero_balance':
367+
return Exception\NonZeroBalanceException::factory(
365368
$msg,
366369
$rcode,
367370
$rbody,
@@ -370,8 +373,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
370373
$code
371374
);
372375

373-
case 'recipient_not_notifiable':
374-
return Exception\RecipientNotNotifiableException::factory(
376+
case 'not_cancelable':
377+
return Exception\NotCancelableException::factory(
375378
$msg,
376379
$rcode,
377380
$rbody,
@@ -380,8 +383,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
380383
$code
381384
);
382385

383-
case 'invalid_payout_method':
384-
return Exception\InvalidPayoutMethodException::factory(
386+
case 'quota_exceeded':
387+
return Exception\QuotaExceededException::factory(
385388
$msg,
386389
$rcode,
387390
$rbody,
@@ -390,8 +393,8 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
390393
$code
391394
);
392395

393-
case 'controlled_by_dashboard':
394-
return Exception\ControlledByDashboardException::factory(
396+
case 'recipient_not_notifiable':
397+
return Exception\RecipientNotNotifiableException::factory(
395398
$msg,
396399
$rcode,
397400
$rbody,
@@ -400,17 +403,14 @@ private static function _specificV2APIError($rbody, $rcode, $rheaders, $resp, $e
400403
$code
401404
);
402405

403-
case 'invalid_payment_method':
404-
$invalidParam = isset($errorData['invalid_param']) ? $errorData['invalid_param'] : null;
405-
406-
return Exception\InvalidPaymentMethodException::factory(
406+
case 'temporary_session_expired':
407+
return Exception\TemporarySessionExpiredException::factory(
407408
$msg,
408409
$rcode,
409410
$rbody,
410411
$resp,
411412
$rheaders,
412-
$code,
413-
$invalidParam
413+
$code
414414
);
415415

416416
// The end of the section generated from our OpenAPI spec

lib/Balance.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@
88
* This is an object representing your Stripe balance. You can retrieve it to see
99
* the balance currently on your Stripe account.
1010
*
11-
* You can also retrieve the balance history, which contains a list of
12-
* <a href="https://stripe.com/docs/reporting/balance-transaction-types">transactions</a> that contributed to the balance
13-
* (charges, payouts, and so forth).
11+
* The top-level <code>available</code> and <code>pending</code> comprise your &quot;payments balance.&quot;
1412
*
15-
* The available and pending amounts for each currency are broken down further by
16-
* payment source types.
17-
*
18-
* Related guide: <a href="https://stripe.com/docs/connect/account-balances">Understanding Connect account balances</a>
13+
* Related guide: <a href="https://stripe.com/docs/payments/balances">Balances and settlement time</a>, <a href="https://stripe.com/docs/connect/account-balances">Understanding Connect account balances</a>
1914
*
2015
* @property string $object String representing the object's type. Objects of the same type share the same value.
2116
* @property (object{amount: int, currency: string, source_types?: (object{bank_account?: int, card?: int, fpx?: int}&StripeObject)}&StripeObject)[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. You can find the available balance for each currency and payment type in the <code>source_types</code> property.

lib/BalanceSettings.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
* to manage your connected accounts’ balance settings instead.
1313
*
1414
* @property string $object String representing the object's type. Objects of the same type share the same value.
15-
* @property null|bool $debit_negative_balances A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See <a href="/connect/account-balances">Understanding Connect account balances</a> for details. The default value is <code>false</code> when <a href="/api/accounts/object#account_object-controller-requirement_collection">controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts, otherwise <code>true</code>.
16-
* @property null|(object{schedule: null|(object{interval: null|string, monthly_payout_days?: int[], weekly_payout_days?: string[]}&StripeObject), statement_descriptor: null|string, status: string}&StripeObject) $payouts Settings specific to the account's payouts.
17-
* @property (object{delay_days: int}&StripeObject) $settlement_timing
15+
* @property (object{debit_negative_balances: null|bool, payouts: null|(object{schedule: null|(object{interval: null|string, monthly_payout_days?: int[], weekly_payout_days?: string[]}&StripeObject), statement_descriptor: null|string, status: string}&StripeObject), settlement_timing: (object{delay_days: int}&StripeObject)}&StripeObject) $payments
1816
*/
1917
class BalanceSettings extends SingletonApiResource
2018
{
@@ -46,7 +44,7 @@ public static function retrieve($opts = null)
4644
* href="/connect/authentication">Making API calls for connected accounts</a>.
4745
*
4846
* @param string $id the ID of the resource to update
49-
* @param null|array{debit_negative_balances?: bool, expand?: string[], payouts?: array{schedule?: array{interval?: string, monthly_payout_days?: int[], weekly_payout_days?: string[]}, statement_descriptor?: string}, settlement_timing?: array{delay_days_override?: int}} $params
47+
* @param null|array{expand?: string[], payments: array{debit_negative_balances?: bool, payouts?: array{schedule?: array{interval?: string, monthly_payout_days?: int[], weekly_payout_days?: string[]}, statement_descriptor?: string}, settlement_timing?: array{delay_days_override?: int}}} $params
5048
* @param null|array|string $opts
5149
*
5250
* @return BalanceSettings the updated resource

lib/BaseStripeClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ public function getClientId()
121121
return $this->config['client_id'];
122122
}
123123

124+
/**
125+
* Gets the Stripe account ID used by the client to send requests.
126+
*
127+
* @return null|string the Stripe account ID used by the client to send requests
128+
*/
129+
public function getStripeAccount()
130+
{
131+
return $this->config['stripe_account'];
132+
}
133+
124134
/**
125135
* Gets the base URL for Stripe's API.
126136
*

lib/Billing/AlertTriggered.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
1111
* @property string $customer ID of customer for which the alert triggered
1212
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
13-
* @property int $value The value triggering the alert
13+
* @property string $value The value triggering the alert
1414
*/
1515
class AlertTriggered extends \Stripe\ApiResource
1616
{

lib/Billing/Meter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @property (object{formula: string}&\Stripe\StripeObject) $default_aggregation
1717
* @property string $display_name The meter's name.
1818
* @property string $event_name The name of the meter event to record usage for. Corresponds with the <code>event_name</code> field on meter events.
19-
* @property null|string $event_time_window The time window to pre-aggregate meter events for, if any.
19+
* @property null|string $event_time_window The time window which meter events have been pre-aggregated for, if any.
2020
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
2121
* @property string $status The meter's status.
2222
* @property (object{deactivated_at: null|int}&\Stripe\StripeObject) $status_transitions

0 commit comments

Comments
 (0)