From a61180736ba1ec384649878081ee8fbe3dca253a Mon Sep 17 00:00:00 2001 From: Yejia Chen Date: Thu, 3 Feb 2022 15:19:43 -0800 Subject: [PATCH] formatting --- init.php | 1 + lib/Account.php | 8 +- lib/AccountLink.php | 2 +- lib/ApplePayDomain.php | 2 +- lib/ApplicationFee.php | 2 +- lib/ApplicationFeeRefund.php | 3 +- lib/Balance.php | 3 +- lib/BalanceTransaction.php | 2 +- lib/BankAccount.php | 2 +- lib/BillingPortal/Configuration.php | 2 +- lib/BillingPortal/Session.php | 2 +- lib/BitcoinReceiver.php | 2 +- lib/BitcoinTransaction.php | 3 +- lib/Capability.php | 2 +- lib/Card.php | 2 +- lib/Charge.php | 2 +- lib/Checkout/Session.php | 2 +- lib/CountrySpec.php | 2 +- lib/Coupon.php | 2 +- lib/CreditNote.php | 2 +- lib/CreditNoteLineItem.php | 3 +- lib/Customer.php | 4 +- lib/CustomerBalanceTransaction.php | 3 +- lib/Dispute.php | 2 +- lib/EphemeralKey.php | 6 +- lib/Event.php | 2 +- lib/ExchangeRate.php | 2 +- lib/File.php | 2 +- lib/FileLink.php | 2 +- lib/Identity/VerificationReport.php | 2 +- lib/Identity/VerificationSession.php | 2 +- lib/Invoice.php | 3 +- lib/InvoiceItem.php | 2 +- lib/InvoiceLineItem.php | 3 +- lib/Issuing/Authorization.php | 2 +- lib/Issuing/Card.php | 2 +- lib/Issuing/Cardholder.php | 2 +- lib/Issuing/Dispute.php | 2 +- lib/Issuing/Transaction.php | 2 +- lib/LineItem.php | 2 +- lib/LoginLink.php | 3 +- lib/Mandate.php | 2 +- lib/Order.php | 2 +- lib/OrderReturn.php | 2 +- lib/PaymentIntent.php | 4 +- lib/PaymentLink.php | 3 +- lib/PaymentMethod.php | 2 +- lib/Payout.php | 2 +- lib/Person.php | 2 +- lib/Plan.php | 2 +- lib/Price.php | 2 +- lib/Product.php | 2 +- lib/PromotionCode.php | 2 +- lib/Quote.php | 4 +- lib/Radar/EarlyFraudWarning.php | 2 +- lib/Radar/ValueList.php | 2 +- lib/Radar/ValueListItem.php | 2 +- lib/Recipient.php | 2 +- lib/Refund.php | 4 +- lib/Reporting/ReportRun.php | 2 +- lib/Reporting/ReportType.php | 2 +- lib/Review.php | 2 +- lib/SKU.php | 2 +- lib/Service/AccountLinkService.php | 2 +- lib/Service/AccountService.php | 2 +- lib/Service/ApplePayDomainService.php | 2 +- lib/Service/ApplicationFeeService.php | 2 +- lib/Service/BalanceService.php | 2 +- lib/Service/BalanceTransactionService.php | 2 +- .../BillingPortalServiceFactory.php | 5 +- .../BillingPortal/ConfigurationService.php | 4 +- lib/Service/BillingPortal/SessionService.php | 2 +- lib/Service/ChargeService.php | 2 +- .../Checkout/CheckoutServiceFactory.php | 3 +- lib/Service/Checkout/SessionService.php | 4 +- lib/Service/CoreServiceFactory.php | 113 +- lib/Service/CountrySpecService.php | 2 +- lib/Service/CouponService.php | 2 +- lib/Service/CreditNoteService.php | 4 +- lib/Service/CustomerService.php | 4 +- lib/Service/DisputeService.php | 2 +- lib/Service/EphemeralKeyService.php | 2 +- lib/Service/EventService.php | 2 +- lib/Service/ExchangeRateService.php | 2 +- lib/Service/FileLinkService.php | 2 +- lib/Service/FileService.php | 2 +- .../Identity/IdentityServiceFactory.php | 5 +- .../Identity/VerificationReportService.php | 4 +- .../Identity/VerificationSessionService.php | 4 +- lib/Service/InvoiceItemService.php | 2 +- lib/Service/InvoiceService.php | 2 +- lib/Service/Issuing/AuthorizationService.php | 2 +- lib/Service/Issuing/CardService.php | 2 +- lib/Service/Issuing/CardholderService.php | 2 +- lib/Service/Issuing/DisputeService.php | 2 +- lib/Service/Issuing/IssuingServiceFactory.php | 11 +- lib/Service/Issuing/TransactionService.php | 2 +- lib/Service/MandateService.php | 2 +- lib/Service/OrderReturnService.php | 2 +- lib/Service/OrderService.php | 2 +- lib/Service/PaymentIntentService.php | 2 +- lib/Service/PaymentLinkService.php | 2 +- lib/Service/PaymentMethodService.php | 4 +- lib/Service/PayoutService.php | 2 +- lib/Service/PlanService.php | 2 +- lib/Service/PriceService.php | 2 +- lib/Service/ProductService.php | 2 +- lib/Service/PromotionCodeService.php | 2 +- lib/Service/QuoteService.php | 12 +- .../Radar/EarlyFraudWarningService.php | 2 +- lib/Service/Radar/RadarServiceFactory.php | 7 +- lib/Service/Radar/ValueListItemService.php | 2 +- lib/Service/Radar/ValueListService.php | 2 +- lib/Service/RefundService.php | 2 +- lib/Service/Reporting/ReportRunService.php | 4 +- lib/Service/Reporting/ReportTypeService.php | 4 +- .../Reporting/ReportingServiceFactory.php | 5 +- lib/Service/ReviewService.php | 2 +- lib/Service/SetupAttemptService.php | 2 +- lib/Service/SetupIntentService.php | 2 +- lib/Service/ShippingRateService.php | 2 +- .../Sigma/ScheduledQueryRunService.php | 2 +- lib/Service/Sigma/SigmaServiceFactory.php | 3 +- lib/Service/SkuService.php | 2 +- lib/Service/SourceService.php | 2 +- lib/Service/SubscriptionItemService.php | 2 +- lib/Service/SubscriptionScheduleService.php | 2 +- lib/Service/SubscriptionService.php | 2 +- lib/Service/TaxCodeService.php | 2 +- lib/Service/TaxRateService.php | 4 +- .../Terminal/ConnectionTokenService.php | 2 +- lib/Service/Terminal/LocationService.php | 2 +- lib/Service/Terminal/ReaderService.php | 2 +- .../Terminal/TerminalServiceFactory.php | 7 +- lib/Service/TokenService.php | 2 +- lib/Service/TopupService.php | 4 +- lib/Service/TransferService.php | 2 +- lib/Service/WebhookEndpointService.php | 2 +- lib/SetupAttempt.php | 2 +- lib/SetupIntent.php | 2 +- lib/ShippingRate.php | 2 +- lib/Sigma/ScheduledQueryRun.php | 2 +- lib/Source.php | 2 +- lib/StripeClient.php | 1 + lib/Subscription.php | 3 +- lib/SubscriptionItem.php | 2 +- lib/SubscriptionSchedule.php | 2 +- lib/TaxCode.php | 2 +- lib/TaxId.php | 2 +- lib/TaxRate.php | 2 +- lib/Terminal/ConnectionToken.php | 2 +- lib/Terminal/Location.php | 2 +- lib/Terminal/Reader.php | 2 +- lib/ThreeDSecure.php | 2 +- lib/Token.php | 2 +- lib/Topup.php | 2 +- lib/Transfer.php | 2 +- lib/TransferReversal.php | 3 +- lib/UsageRecord.php | 3 +- lib/UsageRecordSummary.php | 3 +- lib/Util/ObjectTypes.php | 196 +- lib/WebhookEndpoint.php | 2 +- tests/Stripe/GeneratedExamplesTest.php | 5123 +++++++++-------- 163 files changed, 3058 insertions(+), 2785 deletions(-) diff --git a/init.php b/init.php index 798bb586f..d4606acfb 100644 --- a/init.php +++ b/init.php @@ -1,4 +1,5 @@ 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; } } @@ -212,7 +213,6 @@ public function reject($params = null, $opts = null) return $this; } - /* * Capabilities methods * We can not add the capabilities() method today as the Account object already has a diff --git a/lib/AccountLink.php b/lib/AccountLink.php index 259588100..24a9e68aa 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -1,4 +1,5 @@ _save($opts); } - } diff --git a/lib/Balance.php b/lib/Balance.php index 428cec866..0fdc2850c 100644 --- a/lib/Balance.php +++ b/lib/Balance.php @@ -1,4 +1,5 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); + return $this; } /** * @param null|array $params * @param null|array|string $opts + * @param mixed $id * * @throws \Stripe\Exception\ApiErrorException if the request fails * @@ -96,7 +99,6 @@ public static function allPaymentMethods($id, $params = null, $opts = null) return $obj; } - const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; /** diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index 6d6181984..8c306760d 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -1,4 +1,5 @@ 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\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\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|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\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 $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. @@ -123,5 +124,4 @@ public function confirm($params = null, $opts = null) return $this; } - } diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 862cf922b..c0399fe2c 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -1,4 +1,5 @@ request('post', '/v1/account_links', $params, $opts); } - } diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php index 1fea1e384..28d094ec2 100644 --- a/lib/Service/AccountService.php +++ b/lib/Service/AccountService.php @@ -1,4 +1,5 @@ request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); } - } diff --git a/lib/Service/ApplePayDomainService.php b/lib/Service/ApplePayDomainService.php index 84675d668..6577b6b62 100644 --- a/lib/Service/ApplePayDomainService.php +++ b/lib/Service/ApplePayDomainService.php @@ -1,4 +1,5 @@ request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); } - } diff --git a/lib/Service/ApplicationFeeService.php b/lib/Service/ApplicationFeeService.php index 55f4f0a5e..c05c3cd59 100644 --- a/lib/Service/ApplicationFeeService.php +++ b/lib/Service/ApplicationFeeService.php @@ -1,4 +1,5 @@ request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); } - } diff --git a/lib/Service/BalanceService.php b/lib/Service/BalanceService.php index 79da649b4..0f55385f1 100644 --- a/lib/Service/BalanceService.php +++ b/lib/Service/BalanceService.php @@ -1,4 +1,5 @@ request('get', '/v1/balance', $params, $opts); } - } diff --git a/lib/Service/BalanceTransactionService.php b/lib/Service/BalanceTransactionService.php index 46d880200..fb1da5018 100644 --- a/lib/Service/BalanceTransactionService.php +++ b/lib/Service/BalanceTransactionService.php @@ -1,4 +1,5 @@ request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); } - } diff --git a/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/lib/Service/BillingPortal/BillingPortalServiceFactory.php index 91e569288..23a4d30b2 100644 --- a/lib/Service/BillingPortal/BillingPortalServiceFactory.php +++ b/lib/Service/BillingPortal/BillingPortalServiceFactory.php @@ -1,4 +1,5 @@ */ 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 e9f9a1fd9..5a0d70db7 100644 --- a/lib/Service/BillingPortal/ConfigurationService.php +++ b/lib/Service/BillingPortal/ConfigurationService.php @@ -1,4 +1,5 @@ request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); } - } diff --git a/lib/Service/BillingPortal/SessionService.php b/lib/Service/BillingPortal/SessionService.php index 588e78c66..6b3e60263 100644 --- a/lib/Service/BillingPortal/SessionService.php +++ b/lib/Service/BillingPortal/SessionService.php @@ -1,4 +1,5 @@ request('post', '/v1/billing_portal/sessions', $params, $opts); } - } diff --git a/lib/Service/ChargeService.php b/lib/Service/ChargeService.php index 87ac426e8..f8960edfb 100644 --- a/lib/Service/ChargeService.php +++ b/lib/Service/ChargeService.php @@ -1,4 +1,5 @@ request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); } - } diff --git a/lib/Service/Checkout/CheckoutServiceFactory.php b/lib/Service/Checkout/CheckoutServiceFactory.php index 64993f805..bb26a837f 100644 --- a/lib/Service/Checkout/CheckoutServiceFactory.php +++ b/lib/Service/Checkout/CheckoutServiceFactory.php @@ -1,4 +1,5 @@ */ 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 daa3c5b6e..b42ab8a17 100644 --- a/lib/Service/Checkout/SessionService.php +++ b/lib/Service/Checkout/SessionService.php @@ -1,4 +1,5 @@ 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. @@ -88,5 +89,4 @@ public function retrieve($id, $params = null, $opts = null) { return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); } - } diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index 036ca3ae7..edaadd3fa 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'accountLinks' => AccountLinkService::class, - 'accounts' => AccountService::class, - 'applePayDomains' => ApplePayDomainService::class, - 'applicationFees' => ApplicationFeeService::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, - 'identity' => Identity\IdentityServiceFactory::class, - 'invoiceItems' => InvoiceItemService::class, - 'invoices' => InvoiceService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'mandates' => MandateService::class, - 'oauth' => OAuthService::class, - 'orderReturns' => OrderReturnService::class, - 'orders' => OrderService::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, - 'skus' => SkuService::class, - 'sources' => SourceService::class, - 'subscriptionItems' => SubscriptionItemService::class, - 'subscriptions' => SubscriptionService::class, - 'subscriptionSchedules' => SubscriptionScheduleService::class, - 'taxCodes' => TaxCodeService::class, - 'taxRates' => TaxRateService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'tokens' => TokenService::class, - 'topups' => TopupService::class, - 'transfers' => TransferService::class, - 'webhookEndpoints' => WebhookEndpointService::class, + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::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, + 'identity' => Identity\IdentityServiceFactory::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::class, + 'orderReturns' => OrderReturnService::class, + 'orders' => OrderService::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, + 'skus' => SkuService::class, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'taxCodes' => TaxCodeService::class, + 'taxRates' => TaxRateService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'tokens' => TokenService::class, + 'topups' => TopupService::class, + 'transfers' => TransferService::class, + 'webhookEndpoints' => WebhookEndpointService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php index 3b5d43fd5..573444fd3 100644 --- a/lib/Service/CountrySpecService.php +++ b/lib/Service/CountrySpecService.php @@ -1,4 +1,5 @@ request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); } - } diff --git a/lib/Service/CouponService.php b/lib/Service/CouponService.php index 76bf0a90d..82a880f53 100644 --- a/lib/Service/CouponService.php +++ b/lib/Service/CouponService.php @@ -1,4 +1,5 @@ request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); } - } diff --git a/lib/Service/CreditNoteService.php b/lib/Service/CreditNoteService.php index 1a3dd0998..23681402e 100644 --- a/lib/Service/CreditNoteService.php +++ b/lib/Service/CreditNoteService.php @@ -1,4 +1,5 @@ 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:. * *