From 3b23692572a430504fa7816c3123da1b4b59b7ab Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 18 Jan 2023 16:12:55 -0800 Subject: [PATCH] Codegen for openapi v219 --- OPENAPI_VERSION | 2 +- init.php | 1 - lib/Account.php | 8 +- lib/AccountLink.php | 1 - lib/ApplePayDomain.php | 1 - lib/ApplicationFee.php | 2 +- lib/ApplicationFeeRefund.php | 2 +- lib/Apps/Secret.php | 1 - lib/Balance.php | 1 - lib/BalanceTransaction.php | 1 - lib/BankAccount.php | 1 - lib/BillingPortal/Configuration.php | 1 - lib/BillingPortal/Session.php | 1 - lib/Capability.php | 1 - lib/Card.php | 1 - lib/CashBalance.php | 2 +- lib/Charge.php | 2 - lib/Checkout/Session.php | 1 - lib/CountrySpec.php | 1 - lib/Coupon.php | 1 - lib/CreditNote.php | 2 +- lib/CreditNoteLineItem.php | 2 +- lib/Customer.php | 6 +- lib/CustomerBalanceTransaction.php | 2 +- lib/CustomerCashBalanceTransaction.php | 1 - lib/Dispute.php | 1 - lib/EphemeralKey.php | 5 +- lib/Event.php | 3 +- lib/ExchangeRate.php | 1 - lib/File.php | 1 - lib/FileLink.php | 1 - lib/FinancialConnections/Account.php | 1 - lib/FinancialConnections/AccountOwner.php | 2 +- lib/FinancialConnections/AccountOwnership.php | 2 +- lib/FinancialConnections/Session.php | 1 - lib/FundingInstructions.php | 4 +- lib/Identity/VerificationReport.php | 1 - lib/Identity/VerificationSession.php | 1 - lib/Invoice.php | 3 +- lib/InvoiceItem.php | 1 - lib/InvoiceLineItem.php | 2 +- lib/Issuing/Authorization.php | 1 - lib/Issuing/Card.php | 1 - lib/Issuing/Cardholder.php | 1 - lib/Issuing/Dispute.php | 1 - lib/Issuing/Transaction.php | 1 - lib/LineItem.php | 2 +- lib/LoginLink.php | 2 +- lib/Mandate.php | 1 - lib/PaymentIntent.php | 4 +- lib/PaymentLink.php | 1 - lib/PaymentMethod.php | 1 - lib/Payout.php | 1 - lib/Person.php | 1 - lib/Plan.php | 1 - lib/Price.php | 2 - lib/Product.php | 4 +- lib/PromotionCode.php | 1 - lib/Quote.php | 1 - lib/Radar/EarlyFraudWarning.php | 1 - lib/Radar/ValueList.php | 1 - lib/Radar/ValueListItem.php | 1 - lib/Refund.php | 1 - lib/Reporting/ReportRun.php | 1 - lib/Reporting/ReportType.php | 1 - lib/Review.php | 1 - lib/Service/AccountLinkService.php | 1 - lib/Service/AccountService.php | 1 - lib/Service/ApplePayDomainService.php | 1 - lib/Service/ApplicationFeeService.php | 1 - lib/Service/Apps/AppsServiceFactory.php | 3 +- lib/Service/Apps/SecretService.php | 1 - lib/Service/BalanceService.php | 1 - lib/Service/BalanceTransactionService.php | 1 - .../BillingPortalServiceFactory.php | 5 +- .../BillingPortal/ConfigurationService.php | 3 +- lib/Service/BillingPortal/SessionService.php | 1 - lib/Service/ChargeService.php | 1 - .../Checkout/CheckoutServiceFactory.php | 3 +- lib/Service/Checkout/SessionService.php | 3 +- lib/Service/CoreServiceFactory.php | 115 +- lib/Service/CountrySpecService.php | 1 - lib/Service/CouponService.php | 1 - lib/Service/CreditNoteService.php | 3 +- lib/Service/CustomerService.php | 3 +- lib/Service/DisputeService.php | 1 - lib/Service/EphemeralKeyService.php | 1 - lib/Service/EventService.php | 1 - lib/Service/ExchangeRateService.php | 1 - lib/Service/FileLinkService.php | 1 - lib/Service/FileService.php | 1 - .../FinancialConnections/AccountService.php | 3 +- .../FinancialConnectionsServiceFactory.php | 5 +- .../FinancialConnections/SessionService.php | 3 +- .../Identity/IdentityServiceFactory.php | 5 +- .../Identity/VerificationReportService.php | 3 +- .../Identity/VerificationSessionService.php | 3 +- lib/Service/InvoiceItemService.php | 1 - lib/Service/InvoiceService.php | 1 - lib/Service/Issuing/AuthorizationService.php | 1 - lib/Service/Issuing/CardService.php | 1 - lib/Service/Issuing/CardholderService.php | 1 - lib/Service/Issuing/DisputeService.php | 1 - lib/Service/Issuing/IssuingServiceFactory.php | 11 +- lib/Service/Issuing/TransactionService.php | 1 - lib/Service/MandateService.php | 1 - lib/Service/PaymentIntentService.php | 1 - lib/Service/PaymentLinkService.php | 1 - lib/Service/PaymentMethodService.php | 3 +- lib/Service/PayoutService.php | 1 - lib/Service/PlanService.php | 1 - lib/Service/PriceService.php | 1 - lib/Service/ProductService.php | 1 - lib/Service/PromotionCodeService.php | 1 - lib/Service/QuoteService.php | 11 +- .../Radar/EarlyFraudWarningService.php | 1 - lib/Service/Radar/RadarServiceFactory.php | 7 +- lib/Service/Radar/ValueListItemService.php | 1 - lib/Service/Radar/ValueListService.php | 1 - lib/Service/RefundService.php | 1 - lib/Service/Reporting/ReportRunService.php | 3 +- lib/Service/Reporting/ReportTypeService.php | 3 +- .../Reporting/ReportingServiceFactory.php | 5 +- lib/Service/ReviewService.php | 1 - lib/Service/SetupAttemptService.php | 1 - lib/Service/SetupIntentService.php | 1 - lib/Service/ShippingRateService.php | 1 - .../Sigma/ScheduledQueryRunService.php | 1 - lib/Service/Sigma/SigmaServiceFactory.php | 3 +- lib/Service/SourceService.php | 1 - lib/Service/SubscriptionItemService.php | 1 - lib/Service/SubscriptionScheduleService.php | 1 - lib/Service/SubscriptionService.php | 1 - lib/Service/TaxCodeService.php | 1 - lib/Service/TaxRateService.php | 3 +- lib/Service/Terminal/ConfigurationService.php | 1 - .../Terminal/ConnectionTokenService.php | 1 - lib/Service/Terminal/LocationService.php | 1 - lib/Service/Terminal/ReaderService.php | 1 - .../Terminal/TerminalServiceFactory.php | 9 +- lib/Service/TestHelpers/CustomerService.php | 3 +- .../TestHelpers/Issuing/CardService.php | 1 - .../Issuing/IssuingServiceFactory.php | 3 +- lib/Service/TestHelpers/RefundService.php | 1 - .../TestHelpers/Terminal/ReaderService.php | 1 - .../Terminal/TerminalServiceFactory.php | 3 +- lib/Service/TestHelpers/TestClockService.php | 1 - .../TestHelpers/TestHelpersServiceFactory.php | 13 +- .../Treasury/InboundTransferService.php | 1 - .../Treasury/OutboundPaymentService.php | 1 - .../Treasury/OutboundTransferService.php | 1 - .../Treasury/ReceivedCreditService.php | 1 - .../Treasury/ReceivedDebitService.php | 1 - .../Treasury/TreasuryServiceFactory.php | 11 +- lib/Service/TokenService.php | 1 - lib/Service/TopupService.php | 3 +- lib/Service/TransferService.php | 1 - .../Treasury/CreditReversalService.php | 3 +- lib/Service/Treasury/DebitReversalService.php | 1 - .../Treasury/FinancialAccountService.php | 1 - .../Treasury/InboundTransferService.php | 1 - .../Treasury/OutboundPaymentService.php | 1 - .../Treasury/OutboundTransferService.php | 1 - .../Treasury/ReceivedCreditService.php | 1 - lib/Service/Treasury/ReceivedDebitService.php | 3 +- .../Treasury/TransactionEntryService.php | 1 - lib/Service/Treasury/TransactionService.php | 1 - .../Treasury/TreasuryServiceFactory.php | 21 +- lib/Service/WebhookEndpointService.php | 1 - lib/SetupAttempt.php | 1 - lib/SetupIntent.php | 1 - lib/ShippingRate.php | 1 - lib/Sigma/ScheduledQueryRun.php | 1 - lib/Source.php | 1 - lib/StripeClient.php | 1 - lib/Subscription.php | 3 - lib/SubscriptionItem.php | 2 +- lib/SubscriptionSchedule.php | 1 - lib/TaxCode.php | 1 - lib/TaxId.php | 1 - lib/TaxRate.php | 1 - lib/Terminal/Configuration.php | 1 - lib/Terminal/ConnectionToken.php | 1 - lib/Terminal/Location.php | 1 - lib/Terminal/Reader.php | 1 - lib/TestHelpers/TestClock.php | 1 - lib/Token.php | 1 - lib/Topup.php | 1 - lib/Transfer.php | 2 +- lib/TransferReversal.php | 2 +- lib/Treasury/CreditReversal.php | 1 - lib/Treasury/DebitReversal.php | 1 - lib/Treasury/FinancialAccount.php | 1 - lib/Treasury/FinancialAccountFeatures.php | 2 +- lib/Treasury/InboundTransfer.php | 1 - lib/Treasury/OutboundPayment.php | 1 - lib/Treasury/OutboundTransfer.php | 1 - lib/Treasury/ReceivedCredit.php | 1 - lib/Treasury/ReceivedDebit.php | 1 - lib/Treasury/Transaction.php | 1 - lib/Treasury/TransactionEntry.php | 1 - lib/UsageRecord.php | 2 +- lib/UsageRecordSummary.php | 2 +- lib/Util/ApiVersion.php | 4 +- lib/Util/ObjectTypes.php | 220 +- lib/WebhookEndpoint.php | 1 - tests/Stripe/GeneratedExamplesTest.php | 7505 ++++++++--------- 207 files changed, 3831 insertions(+), 4401 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a75e729f5a..f3da18c955 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v216 \ No newline at end of file +v219 \ No newline at end of file diff --git a/init.php b/init.php index 5555d8f9ae..ede2acc399 100644 --- a/init.php +++ b/init.php @@ -1,5 +1,4 @@ serializeParameters() : $v; if ([] !== $update) { - if (!$originalValue - || !\array_key_exists($i, $originalValue) - || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + if (!$originalValue || + !\array_key_exists($i, $originalValue) || + ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { $updateArr[$i] = $update; } } @@ -186,6 +185,7 @@ public function reject($params = null, $opts = null) return $this; } + const PATH_CAPABILITIES = '/capabilities'; /** diff --git a/lib/AccountLink.php b/lib/AccountLink.php index 24a9e68aa5..b2d76f67ea 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -1,5 +1,4 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); - return $this; } @@ -133,17 +131,16 @@ public function retrievePaymentMethod($payment_method, $params = null, $opts = n public static function search($params = null, $opts = null) { $url = '/v1/customers/search'; - return self::_searchResource($url, $params, $opts); } + const PATH_CASH_BALANCE = '/cash_balance'; /** * @param string $id the ID of the customer to which the cash balance belongs * @param null|array $params * @param null|array|string $opts - * @param mixed $cashBalanceId * * @throws \Stripe\Exception\ApiErrorException if the request fails * @@ -158,7 +155,6 @@ public static function retrieveCashBalance($id, $cashBalanceId, $params = null, * @param string $id the ID of the customer to which the cash balance belongs * @param null|array $params * @param null|array|string $opts - * @param mixed $cashBalanceId * * @throws \Stripe\Exception\ApiErrorException if the request fails * diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index 02cc1f4d71..9636af92c4 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -1,5 +1,4 @@ financial_addresses field. Related guide: Customer - * Balance - Funding Instructions to learn more. + * Balance - Funding Instructions to learn more * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property \Stripe\StripeObject $bank_transfer @@ -24,5 +23,6 @@ class FundingInstructions extends ApiResource { const OBJECT_NAME = 'funding_instructions'; + const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; } diff --git a/lib/Identity/VerificationReport.php b/lib/Identity/VerificationReport.php index f41007c6eb..1391378545 100644 --- a/lib/Identity/VerificationReport.php +++ b/lib/Identity/VerificationReport.php @@ -1,5 +1,4 @@ Indicates that you intend to make future payments with this PaymentIntent's payment method.

Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.

When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.

* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. - * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|string|\Stripe\BankAccount|\Stripe\Card|\Stripe\Account|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. @@ -189,7 +188,6 @@ public function verifyMicrodeposits($params = null, $opts = null) public static function search($params = null, $opts = null) { $url = '/v1/payment_intents/search'; - return self::_searchResource($url, $params, $opts); } } diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 5c3462e69f..7d25b6e3f8 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -1,5 +1,4 @@ tax code ID. * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. - * @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions. + * @property null|string $unit_label A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. * @property null|string $url A URL of a publicly-accessible webpage for this product. */ @@ -67,7 +66,6 @@ class Product extends ApiResource public static function search($params = null, $opts = null) { $url = '/v1/products/search'; - return self::_searchResource($url, $params, $opts); } } diff --git a/lib/PromotionCode.php b/lib/PromotionCode.php index 7eb0c40742..7b14649701 100644 --- a/lib/PromotionCode.php +++ b/lib/PromotionCode.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'secrets' => SecretService::class, + 'secrets' => SecretService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Apps/SecretService.php b/lib/Service/Apps/SecretService.php index 8c9c74b487..60fde5dd20 100644 --- a/lib/Service/Apps/SecretService.php +++ b/lib/Service/Apps/SecretService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'sessions' => SessionService::class, + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/BillingPortal/ConfigurationService.php b/lib/Service/BillingPortal/ConfigurationService.php index 11d1a5a3a9..d0324b178f 100644 --- a/lib/Service/BillingPortal/ConfigurationService.php +++ b/lib/Service/BillingPortal/ConfigurationService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'sessions' => SessionService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Checkout/SessionService.php b/lib/Service/Checkout/SessionService.php index 2291ccd503..fdcb89b143 100644 --- a/lib/Service/Checkout/SessionService.php +++ b/lib/Service/Checkout/SessionService.php @@ -1,5 +1,4 @@ open. + * A Session can be expired when it is in one of these statuses: open * * After it expires, a customer can’t complete a Session and customers loading the * Session see a message saying the Session is expired. diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index 351f6913e8..1a0e407665 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'accountLinks' => AccountLinkService::class, - 'accounts' => AccountService::class, - 'applePayDomains' => ApplePayDomainService::class, - 'applicationFees' => ApplicationFeeService::class, - 'apps' => Apps\AppsServiceFactory::class, - 'balance' => BalanceService::class, - 'balanceTransactions' => BalanceTransactionService::class, - 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, - 'charges' => ChargeService::class, - 'checkout' => Checkout\CheckoutServiceFactory::class, - 'countrySpecs' => CountrySpecService::class, - 'coupons' => CouponService::class, - 'creditNotes' => CreditNoteService::class, - 'customers' => CustomerService::class, - 'disputes' => DisputeService::class, - 'ephemeralKeys' => EphemeralKeyService::class, - 'events' => EventService::class, - 'exchangeRates' => ExchangeRateService::class, - 'fileLinks' => FileLinkService::class, - 'files' => FileService::class, - 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, - 'identity' => Identity\IdentityServiceFactory::class, - 'invoiceItems' => InvoiceItemService::class, - 'invoices' => InvoiceService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'mandates' => MandateService::class, - 'oauth' => OAuthService::class, - 'paymentIntents' => PaymentIntentService::class, - 'paymentLinks' => PaymentLinkService::class, - 'paymentMethods' => PaymentMethodService::class, - 'payouts' => PayoutService::class, - 'plans' => PlanService::class, - 'prices' => PriceService::class, - 'products' => ProductService::class, - 'promotionCodes' => PromotionCodeService::class, - 'quotes' => QuoteService::class, - 'radar' => Radar\RadarServiceFactory::class, - 'refunds' => RefundService::class, - 'reporting' => Reporting\ReportingServiceFactory::class, - 'reviews' => ReviewService::class, - 'setupAttempts' => SetupAttemptService::class, - 'setupIntents' => SetupIntentService::class, - 'shippingRates' => ShippingRateService::class, - 'sigma' => Sigma\SigmaServiceFactory::class, - 'sources' => SourceService::class, - 'subscriptionItems' => SubscriptionItemService::class, - 'subscriptions' => SubscriptionService::class, - 'subscriptionSchedules' => SubscriptionScheduleService::class, - 'taxCodes' => TaxCodeService::class, - 'taxRates' => TaxRateService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'testHelpers' => TestHelpers\TestHelpersServiceFactory::class, - 'tokens' => TokenService::class, - 'topups' => TopupService::class, - 'transfers' => TransferService::class, - 'treasury' => Treasury\TreasuryServiceFactory::class, - 'webhookEndpoints' => WebhookEndpointService::class, + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::class, + 'apps' => Apps\AppsServiceFactory::class, + 'balance' => BalanceService::class, + 'balanceTransactions' => BalanceTransactionService::class, + 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, + 'charges' => ChargeService::class, + 'checkout' => Checkout\CheckoutServiceFactory::class, + 'countrySpecs' => CountrySpecService::class, + 'coupons' => CouponService::class, + 'creditNotes' => CreditNoteService::class, + 'customers' => CustomerService::class, + 'disputes' => DisputeService::class, + 'ephemeralKeys' => EphemeralKeyService::class, + 'events' => EventService::class, + 'exchangeRates' => ExchangeRateService::class, + 'fileLinks' => FileLinkService::class, + 'files' => FileService::class, + 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, + 'identity' => Identity\IdentityServiceFactory::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::class, + 'paymentIntents' => PaymentIntentService::class, + 'paymentLinks' => PaymentLinkService::class, + 'paymentMethods' => PaymentMethodService::class, + 'payouts' => PayoutService::class, + 'plans' => PlanService::class, + 'prices' => PriceService::class, + 'products' => ProductService::class, + 'promotionCodes' => PromotionCodeService::class, + 'quotes' => QuoteService::class, + 'radar' => Radar\RadarServiceFactory::class, + 'refunds' => RefundService::class, + 'reporting' => Reporting\ReportingServiceFactory::class, + 'reviews' => ReviewService::class, + 'setupAttempts' => SetupAttemptService::class, + 'setupIntents' => SetupIntentService::class, + 'shippingRates' => ShippingRateService::class, + 'sigma' => Sigma\SigmaServiceFactory::class, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'taxCodes' => TaxCodeService::class, + 'taxRates' => TaxRateService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'testHelpers' => TestHelpers\TestHelpersServiceFactory::class, + 'tokens' => TokenService::class, + 'topups' => TopupService::class, + 'transfers' => TransferService::class, + 'treasury' => Treasury\TreasuryServiceFactory::class, + 'webhookEndpoints' => WebhookEndpointService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php index 8f3869fee8..14499b6c79 100644 --- a/lib/Service/CountrySpecService.php +++ b/lib/Service/CountrySpecService.php @@ -1,5 +1,4 @@ status=open invoice, a credit note reduces its * amount_due. For a status=paid invoice, a credit note * does not affect its amount_due. Instead, it can result in any - * combination of the following:. + * combination of the following: * *