Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1535

Merged
merged 12 commits into from
Jul 25, 2023
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v425
v431
2 changes: 2 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
require __DIR__ . '/lib/Service/SubscriptionScheduleService.php';
require __DIR__ . '/lib/Service/SubscriptionService.php';
require __DIR__ . '/lib/Service/Tax/CalculationService.php';
require __DIR__ . '/lib/Service/Tax/FormService.php';
require __DIR__ . '/lib/Service/Tax/RegistrationService.php';
require __DIR__ . '/lib/Service/Tax/SettingsService.php';
require __DIR__ . '/lib/Service/Tax/TaxServiceFactory.php';
Expand Down Expand Up @@ -297,6 +298,7 @@
require __DIR__ . '/lib/SubscriptionSchedule.php';
require __DIR__ . '/lib/Tax/Calculation.php';
require __DIR__ . '/lib/Tax/CalculationLineItem.php';
require __DIR__ . '/lib/Tax/Form.php';
require __DIR__ . '/lib/Tax/Registration.php';
require __DIR__ . '/lib/Tax/Settings.php';
require __DIR__ . '/lib/Tax/Transaction.php';
Expand Down
2 changes: 1 addition & 1 deletion lib/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @property null|string $email An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform.
* @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account
* @property null|\Stripe\StripeObject $future_requirements
* @property null|\Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the <a href="https://stripe.com/docs/connect/standard-accounts">Standard onboarding</a> or <a href="https://stripe.com/docs/connect/express-accounts">Express onboarding documentation</a> for information about platform pre-filling and account onboarding steps.</p><p>Related guide: <a href="https://stripe.com/docs/connect/identity-verification-api#person-information">Handling identity verification with the API</a></p>
* @property null|\Stripe\Person $individual <p>This is an object representing a person associated with a Stripe account.</p><p>A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the <a href="https://stripe.com/docs/connect/standard-accounts">Standard onboarding</a> or <a href="https://stripe.com/docs/connect/express-accounts">Express onboarding documentation</a> for information about platform prefilling and account onboarding steps.</p><p>Related guide: <a href="https://stripe.com/docs/connect/identity-verification-api#person-information">Handling identity verification with the API</a></p>
* @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 Stripe can send payouts to this account.
* @property null|\Stripe\StripeObject $requirements
Expand Down
2 changes: 1 addition & 1 deletion lib/ApplicationFee.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @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.
* @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the <code>destination</code> parameter.
* @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
* @property \Stripe\Collection<\Stripe\StripeObject> $refunds A list of refunds that have been applied to the fee.
* @property \Stripe\Collection<\Stripe\ApplicationFeeRefund> $refunds A list of refunds that have been applied to the fee.
*/
class ApplicationFee extends ApiResource
{
Expand Down
1 change: 1 addition & 0 deletions lib/Apps/Secret.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|bool $deleted If true, indicates that this secret has been deleted
* @property null|int $expires_at The Unix timestamp for the expiry time of the secret, after which the secret deletes.
* @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.
* @property string $name A name for the secret that's unique within the scope.
Expand Down
2 changes: 1 addition & 1 deletion lib/BalanceTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class BalanceTransaction extends ApiResource
const TYPE_PAYOUT_FAILURE = 'payout_failure';
const TYPE_REFUND = 'refund';
const TYPE_REFUND_FAILURE = 'refund_failure';
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
const TYPE_RESERVED_FUNDS = 'reserved_funds';
const TYPE_RESERVE_TRANSACTION = 'reserve_transaction';
const TYPE_STRIPE_FEE = 'stripe_fee';
const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee';
const TYPE_TAX_FEE = 'tax_fee';
Expand Down
33 changes: 13 additions & 20 deletions lib/BaseStripeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ class BaseStripeClient implements StripeClientInterface, StripeStreamingClientIn
/** @var string default base URL for Stripe's Files API */
const DEFAULT_FILES_BASE = 'https://files.stripe.com';

/** @var array<string, null|string> */
const DEFAULT_CONFIG = [
'api_key' => null,
'client_id' => null,
'stripe_account' => null,
'stripe_version' => null,
'api_base' => self::DEFAULT_API_BASE,
'connect_base' => self::DEFAULT_CONNECT_BASE,
'files_base' => self::DEFAULT_FILES_BASE,
];

/** @var array<string, mixed> */
private $config;

Expand Down Expand Up @@ -58,7 +69,7 @@ public function __construct($config = [])
throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array');
}

$config = \array_merge($this->getDefaultConfig(), $config);
$config = \array_merge(self::DEFAULT_CONFIG, $config);
$this->validateConfig($config);

$this->config = $config;
Expand Down Expand Up @@ -274,24 +285,6 @@ private function apiKeyForRequest($opts)
return $apiKey;
}

/**
* TODO: replace this with a private constant when we drop support for PHP < 5.
*
* @return array<string, mixed>
*/
private function getDefaultConfig()
{
return [
'api_key' => null,
'client_id' => null,
'stripe_account' => null,
'stripe_version' => null,
'api_base' => self::DEFAULT_API_BASE,
'connect_base' => self::DEFAULT_CONNECT_BASE,
'files_base' => self::DEFAULT_FILES_BASE,
];
}

/**
* @param array<string, mixed> $config
*
Expand Down Expand Up @@ -347,7 +340,7 @@ private function validateConfig($config)
}

// check absence of extra keys
$extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig()));
$extraConfigKeys = \array_diff(\array_keys($config), \array_keys(self::DEFAULT_CONFIG));
if (!empty($extraConfigKeys)) {
// Wrap in single quote to more easily catch trailing spaces errors
$invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'";
Expand Down
3 changes: 3 additions & 0 deletions lib/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@
* @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
* @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see <a href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check if a card is valid without a charge</a>.
* @property null|bool $default_for_currency Whether this card is the default external account for its currency.
* @property null|string $description A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
* @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
* @property int $exp_month Two-digit number representing the card's expiration month.
* @property int $exp_year Four-digit number representing the card's expiration year.
* @property null|string $fingerprint <p>Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.</p><p><em>Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.</em></p>
* @property string $funding Card funding type. Can be <code>credit</code>, <code>debit</code>, <code>prepaid</code>, or <code>unknown</code>.
* @property null|string $iin Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
* @property null|string $issuer The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
* @property string $last4 The last four digits of the card.
* @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|string $name Cardholder name.
Expand Down
2 changes: 1 addition & 1 deletion lib/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function capture($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\SearchResult<Charge> the charge search results
* @return \Stripe\SearchResult<\Stripe\Charge> the charge search results
*/
public static function search($params = null, $opts = null)
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Checkout/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in <code>payment</code> mode.
* @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session.
* @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method.
* @property null|\Stripe\StripeObject $payment_method_configuration_details Information about the payment method configuration used for this Checkout session.
* @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession.
* @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
* @property string $payment_status The payment status of the Checkout Session, one of <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. You can use this value to decide when to fulfill your customer's order.
Expand Down Expand Up @@ -128,7 +129,7 @@ public function expire($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\LineItem> list of LineItems
* @return \Stripe\Collection<\Stripe\LineItem> list of line items
*/
public static function allLineItems($id, $params = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function preview($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of CreditNoteLineItems
* @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of credit note line items
*/
public static function previewLines($params = null, $opts = null)
{
Expand Down
6 changes: 3 additions & 3 deletions lib/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function deleteDiscount($params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\PaymentMethod> list of PaymentMethods
* @return \Stripe\Collection<\Stripe\PaymentMethod> list of payment methods
*/
public static function allPaymentMethods($id, $params = null, $opts = null)
{
Expand All @@ -107,7 +107,7 @@ public static function allPaymentMethods($id, $params = null, $opts = null)
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Customer the retrieved customer
* @return \Stripe\PaymentMethod the retrieved payment method
*/
public function retrievePaymentMethod($payment_method, $params = null, $opts = null)
{
Expand All @@ -125,7 +125,7 @@ public function retrievePaymentMethod($payment_method, $params = null, $opts = n
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\SearchResult<Customer> the customer search results
* @return \Stripe\SearchResult<\Stripe\Customer> the customer search results
*/
public static function search($params = null, $opts = null)
{
Expand Down
21 changes: 11 additions & 10 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class Event extends ApiResource
const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
const ACCOUNT_UPDATED = 'account.updated';
const APPLICATION_FEE_CREATED = 'application_fee.created';
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
const BALANCE_AVAILABLE = 'balance.available';
const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created';
const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated';
Expand All @@ -89,8 +89,8 @@ class Event extends ApiResource
const CHARGE_EXPIRED = 'charge.expired';
const CHARGE_FAILED = 'charge.failed';
const CHARGE_PENDING = 'charge.pending';
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
const CHARGE_REFUNDED = 'charge.refunded';
const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
const CHARGE_SUCCEEDED = 'charge.succeeded';
const CHARGE_UPDATED = 'charge.updated';
const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed';
Expand All @@ -103,6 +103,7 @@ class Event extends ApiResource
const CREDIT_NOTE_CREATED = 'credit_note.created';
const CREDIT_NOTE_UPDATED = 'credit_note.updated';
const CREDIT_NOTE_VOIDED = 'credit_note.voided';
const CUSTOMER_CASH_BALANCE_TRANSACTION_CREATED = 'customer_cash_balance_transaction.created';
const CUSTOMER_CREATED = 'customer.created';
const CUSTOMER_DELETED = 'customer.deleted';
const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
Expand All @@ -126,7 +127,6 @@ class Event extends ApiResource
const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const CUSTOMER_UPDATED = 'customer.updated';
const CUSTOMER_CASH_BALANCE_TRANSACTION_CREATED = 'customer_cash_balance_transaction.created';
const FILE_CREATED = 'file.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
Expand All @@ -143,6 +143,9 @@ class Event extends ApiResource
const IDENTITY_VERIFICATION_SESSION_REDACTED = 'identity.verification_session.redacted';
const IDENTITY_VERIFICATION_SESSION_REQUIRES_INPUT = 'identity.verification_session.requires_input';
const IDENTITY_VERIFICATION_SESSION_VERIFIED = 'identity.verification_session.verified';
const INVOICEITEM_CREATED = 'invoiceitem.created';
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
const INVOICE_CREATED = 'invoice.created';
const INVOICE_DELETED = 'invoice.deleted';
const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed';
Expand All @@ -156,19 +159,16 @@ class Event extends ApiResource
const INVOICE_UPCOMING = 'invoice.upcoming';
const INVOICE_UPDATED = 'invoice.updated';
const INVOICE_VOIDED = 'invoice.voided';
const INVOICEITEM_CREATED = 'invoiceitem.created';
const INVOICEITEM_DELETED = 'invoiceitem.deleted';
const INVOICEITEM_UPDATED = 'invoiceitem.updated';
const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
const ISSUING_CARD_CREATED = 'issuing_card.created';
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
const ISSUING_CARD_DESIGN_ACTIVATED = 'issuing_card_design.activated';
const ISSUING_CARD_DESIGN_DEACTIVATED = 'issuing_card_design.deactivated';
const ISSUING_CARD_DESIGN_UPDATED = 'issuing_card_design.updated';
const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
const ISSUING_CARD_UPDATED = 'issuing_card.updated';
const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
Expand Down Expand Up @@ -255,9 +255,10 @@ class Event extends ApiResource
const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
const TAX_SETTINGS_UPDATED = 'tax.settings.updated';
const TAX_FORM_UPDATED = 'tax.form.updated';
const TAX_RATE_CREATED = 'tax_rate.created';
const TAX_RATE_UPDATED = 'tax_rate.updated';
const TAX_SETTINGS_UPDATED = 'tax.settings.updated';
const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed';
const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded';
const TERMINAL_READER_ACTION_UPDATED = 'terminal.reader.action_updated';
Expand Down
Loading