Skip to content

Commit

Permalink
Update generated code for beta (#1808)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
6 people authored Feb 7, 2025
1 parent b792b59 commit d46451c
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 23 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Changelog

## 16.5.0 - 2025-01-27
* [#1804](https://github.com/stripe/stripe-php/pull/1804) Update generated code
* Add support for `close` method on resource `Treasury.FinancialAccount`
* Add support for `advice_code` on `StripeError`
* Add support for `discounts` on `Checkout.Session`
* Add support for new value `pay_by_bank` on enum `PaymentLink.payment_method_types[]`
* Add support for `pay_by_bank` on `PaymentMethodConfiguration` and `PaymentMethod`
* Add support for new value `pay_by_bank` on enum `PaymentMethod.type`
* Add support for `is_default` and `nickname` on `Treasury.FinancialAccount`
* [#1805](https://github.com/stripe/stripe-php/pull/1805) Restore testCoreEventsGet generated test
* [#1807](https://github.com/stripe/stripe-php/pull/1807) minor justfile fixes
* [#1806](https://github.com/stripe/stripe-php/pull/1806) Added CONTRIBUTING.md file
* [#1802](https://github.com/stripe/stripe-php/pull/1802) ensure dependencies are installed for format and test recipes
* [#1801](https://github.com/stripe/stripe-php/pull/1801) Add justfile, remove coveralls, and fix AUTOLOAD in CI
* [#1797](https://github.com/stripe/stripe-php/pull/1797) Added pull request template

## 16.5.0-beta.3 - 2025-01-23
* [#1803](https://github.com/stripe/stripe-php/pull/1803) Update generated code for beta
* V2 Events now are subclass of `\Stripe\V2\Event`.
* V2 Events now are subclass of `\Stripe\V2\Event`.

## 16.5.0-beta.2 - 2025-01-09
* [#1796](https://github.com/stripe/stripe-php/pull/1796) Update generated code for beta
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1460
v1472
2 changes: 1 addition & 1 deletion lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @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.
* @property null|bool $payouts_enabled Whether the funds in this account can be paid out.
* @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
* @property null|(object{charges: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass), payouts: (object{pause_requested: bool}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $risk_controls
* @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
* @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.
* @property (object{date?: null|int, ip?: null|string, service_agreement?: string, user_agent?: null|string}&\Stripe\StripeObject&\stdClass) $tos_acceptance
* @property null|string $type The Stripe account type. Can be <code>standard</code>, <code>express</code>, <code>custom</code>, or <code>none</code>.
Expand Down
2 changes: 1 addition & 1 deletion lib/AccountSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AccountSession extends ApiResource
* Creates a AccountSession object that includes a single-use token that the
* platform can use on their front-end to grant client-side API access.
*
* @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
* @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
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
Expand Down
18 changes: 12 additions & 6 deletions lib/ApiRequestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ private function _prepareRequest($method, $url, $params, $headers, $apiMode)
// X-Stripe-Client-User-Agent header via the optional getUserAgentInfo()
// method
$clientUAInfo = null;
if (\method_exists($this->httpClient(), 'getUserAgentInfo')) {
$clientUAInfo = $this->httpClient()->getUserAgentInfo();
if (\method_exists(self::httpClient(), 'getUserAgentInfo')) {
$clientUAInfo = self::httpClient()->getUserAgentInfo();
}

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

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

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

list($rbody, $rcode, $rheaders) = $this->httpClient()->request(
list($rbody, $rcode, $rheaders) = self::httpClient()->request(
$method,
$absUrl,
$rawHeaders,
Expand Down Expand Up @@ -562,7 +568,7 @@ private function _requestRawStreaming($method, $url, $params, $headers, $apiMode

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

list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream(
list($rbody, $rcode, $rheaders) = self::streamingHttpClient()->requestStream(
$method,
$absUrl,
$rawHeaders,
Expand Down Expand Up @@ -673,7 +679,7 @@ public static function resetTelemetry()
/**
* @return HttpClient\ClientInterface
*/
private function httpClient()
public static function httpClient()
{
if (!self::$_httpClient) {
self::$_httpClient = HttpClient\CurlClient::instance();
Expand All @@ -685,7 +691,7 @@ private function httpClient()
/**
* @return HttpClient\StreamingClientInterface
*/
private function streamingHttpClient()
public static function streamingHttpClient()
{
if (!self::$_streamingHttpClient) {
self::$_streamingHttpClient = HttpClient\CurlClient::instance();
Expand Down
4 changes: 2 additions & 2 deletions lib/Billing/CreditGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property (object{monetary: null|(object{currency: string, value: int}&\Stripe\StripeObject&\stdClass), type: string}&\Stripe\StripeObject&\stdClass) $amount
* @property (object{scope: (object{price_type: string}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $applicability_config
* @property (object{scope: (object{price_type?: string, prices?: ((object{id: null|string}&\Stripe\StripeObject&\stdClass))[]}&\Stripe\StripeObject&\stdClass)}&\Stripe\StripeObject&\stdClass) $applicability_config
* @property string $category The category of this credit grant. This is for tracking purposes and isn't displayed to the customer.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property string|\Stripe\Customer $customer ID of the customer receiving the billing credits.
Expand All @@ -37,7 +37,7 @@ class CreditGrant extends \Stripe\ApiResource
/**
* Creates a credit grant.
*
* @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
* @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
* @param null|array|string $options
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
Expand Down
2 changes: 2 additions & 0 deletions lib/Billing/MeterEventSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
* usage was accrued by a customer for that period.
*
* Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @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>.
Expand Down
Loading

0 comments on commit d46451c

Please sign in to comment.