Skip to content

Commit d46451c

Browse files
stripe-openapi[bot]jar-stripexavdid-stripehelenye-stripedejagersh
authored
Update generated code for beta (#1808)
* Update generated code (#1793) * Update generated code for v1399 * Update generated code for v1409 * Update generated code for v1412 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> * Bump version to 16.4.0 * Added pull request template (#1797) * Add justfile, remove coveralls, and fix AUTOLOAD in CI (#1801) * add justfile and tweak CI + readme * debug test * Debugging * further debugging * restore original composer json * add more logging * maybe fix ci * Fix typo * fix test naming and pass autoload directly to recipe as arugment * Remove unused logline and fix typo * restore composer * remove extra log line * update justfile * add comments * update ci * revert to gh action * ensure dependencies are installed for format and test recipes (#1802) * Added CONTRIBUTING.md file (#1806) * minor justfile fixes (#1807) * made v2 event class concrete, and changed convertToStripeObject to use it if we cannot find the identified event subclass (#1805) * Update generated code for v1461 * Update generated code (#1804) * Update generated code for v1441 * Update generated code for v1452 * Update generated code for v1455 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <[email protected]> * Bump version to 16.5.0 * Make `httpClient()` a public, static method (#1810) * Make `httpClient()` a public, static method * Make `streamingHttpClient()` a public, static method * Update generated code for v1467 * Raise a more descriptive error if null bytes are found in the path (#1811) * raise a more descriptive error if null bytes are found in the path * formatting * change error thrown for null byte issues (#1813) * Update generated code for v1472 --------- Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Jesse Rosalia <[email protected]> Co-authored-by: David Brownman <[email protected]> Co-authored-by: helenye-stripe <[email protected]> Co-authored-by: Helen Ye <[email protected]> Co-authored-by: Johan de Jager <[email protected]>
1 parent b792b59 commit d46451c

15 files changed

+66
-23
lines changed

CHANGELOG.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
# Changelog
22

3+
## 16.5.0 - 2025-01-27
4+
* [#1804](https://github.com/stripe/stripe-php/pull/1804) Update generated code
5+
* Add support for `close` method on resource `Treasury.FinancialAccount`
6+
* Add support for `advice_code` on `StripeError`
7+
* Add support for `discounts` on `Checkout.Session`
8+
* Add support for new value `pay_by_bank` on enum `PaymentLink.payment_method_types[]`
9+
* Add support for `pay_by_bank` on `PaymentMethodConfiguration` and `PaymentMethod`
10+
* Add support for new value `pay_by_bank` on enum `PaymentMethod.type`
11+
* Add support for `is_default` and `nickname` on `Treasury.FinancialAccount`
12+
* [#1805](https://github.com/stripe/stripe-php/pull/1805) Restore testCoreEventsGet generated test
13+
* [#1807](https://github.com/stripe/stripe-php/pull/1807) minor justfile fixes
14+
* [#1806](https://github.com/stripe/stripe-php/pull/1806) Added CONTRIBUTING.md file
15+
* [#1802](https://github.com/stripe/stripe-php/pull/1802) ensure dependencies are installed for format and test recipes
16+
* [#1801](https://github.com/stripe/stripe-php/pull/1801) Add justfile, remove coveralls, and fix AUTOLOAD in CI
17+
* [#1797](https://github.com/stripe/stripe-php/pull/1797) Added pull request template
18+
319
## 16.5.0-beta.3 - 2025-01-23
420
* [#1803](https://github.com/stripe/stripe-php/pull/1803) Update generated code for beta
5-
* V2 Events now are subclass of `\Stripe\V2\Event`.
21+
* V2 Events now are subclass of `\Stripe\V2\Event`.
622

723
## 16.5.0-beta.2 - 2025-01-09
824
* [#1796](https://github.com/stripe/stripe-php/pull/1796) Update generated code for beta

OPENAPI_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1460
1+
v1472

lib/Account.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
3939
* @property null|bool $payouts_enabled Whether the funds in this account can be paid out.
4040
* @property (object{alternatives: null|(object{alternative_fields_due: string[], original_fields_due: string[]}&\Stripe\StripeObject&\stdClass)[], current_deadline: null|int, currently_due: null|string[], disabled_reason: null|string, errors: null|(object{code: string, reason: string, requirement: string}&\Stripe\StripeObject&\stdClass)[], eventually_due: null|string[], past_due: null|string[], pending_verification: null|string[]}&\Stripe\StripeObject&\stdClass) $requirements
41-
* @property null|(object{charges: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass), payouts: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $risk_controls
41+
* @property null|(object{charges: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass), payouts: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass), rejected_reason?: string}&\Stripe\StripeObject&\stdClass) $risk_controls
4242
* @property null|(object{bacs_debit_payments?: (object{display_name: null|string, service_user_number: null|string}&\Stripe\StripeObject&\stdClass), bank_bca_onboarding?: (object{account_holder_name?: string, business_account_number?: string}&\Stripe\StripeObject&\stdClass), branding: (object{icon: null|string|\Stripe\File, logo: null|string|\Stripe\File, primary_color: null|string, secondary_color: null|string}&\Stripe\StripeObject&\stdClass), capital?: (object{payout_destination?: \Stripe\StripeObject, payout_destination_selector?: \Stripe\StripeObject}&\Stripe\StripeObject&\stdClass), card_issuing?: (object{tos_acceptance?: (object{date: null|int, ip: null|string, user_agent?: string}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass), card_payments: (object{decline_on?: (object{avs_failure: bool, cvc_failure: bool}&\Stripe\StripeObject&\stdClass), statement_descriptor_prefix: null|string, statement_descriptor_prefix_kana: null|string, statement_descriptor_prefix_kanji: null|string}&\Stripe\StripeObject&\stdClass), dashboard: (object{display_name: null|string, timezone: null|string}&\Stripe\StripeObject&\stdClass), invoices?: (object{default_account_tax_ids: null|(string|\Stripe\TaxId)[]}&\Stripe\StripeObject&\stdClass), payments: (object{statement_descriptor: null|string, statement_descriptor_kana: null|string, statement_descriptor_kanji: null|string, statement_descriptor_prefix_kana: null|string, statement_descriptor_prefix_kanji: null|string}&\Stripe\StripeObject&\stdClass), payouts?: (object{debit_negative_balances: bool, schedule: (object{delay_days: int, interval: string, monthly_anchor?: int, weekly_anchor?: string}&\Stripe\StripeObject&\stdClass), statement_descriptor: null|string}&\Stripe\StripeObject&\stdClass), sepa_debit_payments?: (object{creditor_id?: string}&\Stripe\StripeObject&\stdClass), tax_forms?: (object{consented_to_paperless_delivery: bool}&\Stripe\StripeObject&\stdClass), treasury?: (object{tos_acceptance?: (object{date: null|int, ip: null|string, user_agent?: string}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $settings Options for customizing how the account functions within Stripe.
4343
* @property (object{date?: null|int, ip?: null|string, service_agreement?: string, user_agent?: null|string}&\Stripe\StripeObject&\stdClass) $tos_acceptance
4444
* @property null|string $type The Stripe account type. Can be <code>standard</code>, <code>express</code>, <code>custom</code>, or <code>none</code>.

lib/AccountSession.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AccountSession extends ApiResource
2828
* Creates a AccountSession object that includes a single-use token that the
2929
* platform can use on their front-end to grant client-side API access.
3030
*
31-
* @param null|array{account: string, components: array{account_management?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, account_onboarding?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, app_install?: array{enabled: bool, features?: array{allowed_apps?: null|string[]}}, app_viewport?: array{enabled: bool, features?: array{allowed_apps?: null|string[]}}, balances?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, capital_financing?: array{enabled: bool, features?: array{}}, capital_financing_application?: array{enabled: bool, features?: array{}}, capital_financing_promotion?: array{enabled: bool, features?: array{}}, capital_overview?: array{enabled: bool, features?: array{}}, documents?: array{enabled: bool, features?: array{}}, financial_account?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool, send_money?: bool, transfer_balance?: bool}}, financial_account_transactions?: array{enabled: bool, features?: array{card_spend_dispute_management?: bool}}, issuing_card?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, spend_control_management?: bool}}, issuing_cards_list?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, disable_stripe_user_authentication?: bool, spend_control_management?: bool}}, notification_banner?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, payment_details?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payment_method_settings?: array{enabled: bool, features?: array{}}, payments?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payouts?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, payouts_list?: array{enabled: bool, features?: array{}}, recipients?: array{enabled: bool, features?: array{send_money?: bool}}, reporting_chart?: array{enabled: bool, features?: array{}}, tax_registrations?: array{enabled: bool, features?: array{}}, tax_settings?: array{enabled: bool, features?: array{}}, tax_threshold_monitoring?: array{enabled: bool, features?: array{}}}, expand?: string[]} $params
31+
* @param null|array{account: string, components: array{account_management?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, account_onboarding?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, app_install?: array{enabled: bool, features?: array{allowed_apps?: null|string[]}}, app_viewport?: array{enabled: bool, features?: array{allowed_apps?: null|string[]}}, balances?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, capital_financing?: array{enabled: bool, features?: array{}}, capital_financing_application?: array{enabled: bool, features?: array{}}, capital_financing_promotion?: array{enabled: bool, features?: array{}}, capital_overview?: array{enabled: bool, features?: array{}}, documents?: array{enabled: bool, features?: array{}}, financial_account?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool, send_money?: bool, transfer_balance?: bool}}, financial_account_transactions?: array{enabled: bool, features?: array{card_spend_dispute_management?: bool}}, issuing_card?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, spend_control_management?: bool}}, issuing_cards_list?: array{enabled: bool, features?: array{card_management?: bool, card_spend_dispute_management?: bool, cardholder_management?: bool, disable_stripe_user_authentication?: bool, spend_control_management?: bool}}, notification_banner?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, external_account_collection?: bool}}, payment_details?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payment_method_settings?: array{enabled: bool, features?: array{}}, payments?: array{enabled: bool, features?: array{capture_payments?: bool, destination_on_behalf_of_charge_management?: bool, dispute_management?: bool, refund_management?: bool}}, payouts?: array{enabled: bool, features?: array{disable_stripe_user_authentication?: bool, edit_payout_schedule?: bool, external_account_collection?: bool, instant_payouts?: bool, standard_payouts?: bool}}, payouts_list?: array{enabled: bool, features?: array{}}, product_tax_code_selector?: array{enabled: bool, features?: array{}}, recipients?: array{enabled: bool, features?: array{send_money?: bool}}, reporting_chart?: array{enabled: bool, features?: array{}}, tax_registrations?: array{enabled: bool, features?: array{}}, tax_settings?: array{enabled: bool, features?: array{}}, tax_threshold_monitoring?: array{enabled: bool, features?: array{}}}, expand?: string[]} $params
3232
* @param null|array|string $options
3333
*
3434
* @throws \Stripe\Exception\ApiErrorException if the request fails

lib/ApiRequestor.php

+12-6
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ private function _prepareRequest($method, $url, $params, $headers, $apiMode)
436436
// X-Stripe-Client-User-Agent header via the optional getUserAgentInfo()
437437
// method
438438
$clientUAInfo = null;
439-
if (\method_exists($this->httpClient(), 'getUserAgentInfo')) {
440-
$clientUAInfo = $this->httpClient()->getUserAgentInfo();
439+
if (\method_exists(self::httpClient(), 'getUserAgentInfo')) {
440+
$clientUAInfo = self::httpClient()->getUserAgentInfo();
441441
}
442442

443443
if ($params && \is_array($params)) {
@@ -516,9 +516,15 @@ private function _requestRaw($method, $url, $params, $headers, $apiMode, $usage)
516516
{
517517
list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers, $apiMode);
518518

519+
// for some reason, PHP users will sometimes include null bytes in their paths, which leads to cryptic server 400s.
520+
// we'll be louder about this to help catch issues earlier.
521+
if (false !== \strpos($absUrl, "\0") || false !== \strpos($absUrl, '%00')) {
522+
throw new Exception\InvalidRequestException("URLs may not contain null bytes ('\\0'); double check any IDs you're including with the request.");
523+
}
524+
519525
$requestStartMs = Util\Util::currentTimeMillis();
520526

521-
list($rbody, $rcode, $rheaders) = $this->httpClient()->request(
527+
list($rbody, $rcode, $rheaders) = self::httpClient()->request(
522528
$method,
523529
$absUrl,
524530
$rawHeaders,
@@ -562,7 +568,7 @@ private function _requestRawStreaming($method, $url, $params, $headers, $apiMode
562568

563569
$requestStartMs = Util\Util::currentTimeMillis();
564570

565-
list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream(
571+
list($rbody, $rcode, $rheaders) = self::streamingHttpClient()->requestStream(
566572
$method,
567573
$absUrl,
568574
$rawHeaders,
@@ -673,7 +679,7 @@ public static function resetTelemetry()
673679
/**
674680
* @return HttpClient\ClientInterface
675681
*/
676-
private function httpClient()
682+
public static function httpClient()
677683
{
678684
if (!self::$_httpClient) {
679685
self::$_httpClient = HttpClient\CurlClient::instance();
@@ -685,7 +691,7 @@ private function httpClient()
685691
/**
686692
* @return HttpClient\StreamingClientInterface
687693
*/
688-
private function streamingHttpClient()
694+
public static function streamingHttpClient()
689695
{
690696
if (!self::$_streamingHttpClient) {
691697
self::$_streamingHttpClient = HttpClient\CurlClient::instance();

lib/Billing/CreditGrant.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @property string $id Unique identifier for the object.
1313
* @property string $object String representing the object's type. Objects of the same type share the same value.
1414
* @property (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject&\stdClass), type: string}&\Stripe\StripeObject&\stdClass) $amount
15-
* @property (object{scope: (object{price_type: string}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $applicability_config
15+
* @property (object{scope: (object{price_type?: string, prices?: ((object{id: null|string}&\Stripe\StripeObject&\stdClass))[]}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $applicability_config
1616
* @property string $category The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
1717
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
1818
* @property string|\Stripe\Customer $customer ID of the customer receiving the billing credits.
@@ -37,7 +37,7 @@ class CreditGrant extends \Stripe\ApiResource
3737
/**
3838
* Creates a credit grant.
3939
*
40-
* @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type: string}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: \Stripe\StripeObject, name?: string} $params
40+
* @param null|array{amount: array{monetary?: array{currency: string, value: int}, type: string}, applicability_config: array{scope: array{price_type: string, prices?: array{id: string}[]}}, category: string, customer: string, effective_at?: int, expand?: string[], expires_at?: int, metadata?: \Stripe\StripeObject, name?: string} $params
4141
* @param null|array|string $options
4242
*
4343
* @throws \Stripe\Exception\ApiErrorException if the request fails

lib/Billing/MeterEventSummary.php

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
99
* usage was accrued by a customer for that period.
1010
*
11+
* Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
12+
*
1113
* @property string $id Unique identifier for the object.
1214
* @property string $object String representing the object's type. Objects of the same type share the same value.
1315
* @property float $aggregated_value Aggregated value of all the events within <code>start_time</code> (inclusive) and <code>end_time</code> (inclusive). The aggregation strategy is defined on meter via <code>default_aggregation</code>.

0 commit comments

Comments
 (0)