diff --git a/init.php b/init.php index b4a41dbe67..1f9f9e59a0 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; } } @@ -213,6 +212,7 @@ 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 24a9e68aa5..2595881009 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -1,5 +1,4 @@ _save($opts); } + } diff --git a/lib/Balance.php b/lib/Balance.php index 0fdc2850c4..428cec866b 100644 --- a/lib/Balance.php +++ b/lib/Balance.php @@ -1,5 +1,4 @@ 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 * @@ -100,6 +97,7 @@ 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 8c306760db..6d61819847 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.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\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|\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 $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. @@ -141,4 +140,5 @@ public function verifyMicrodeposits($params = null, $opts = null) return $this; } + } diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 8062c5374f..b80ffbe192 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -1,5 +1,4 @@ instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + } diff --git a/lib/Reporting/ReportRun.php b/lib/Reporting/ReportRun.php index 7c3d2a993a..5aabe9e053 100644 --- a/lib/Reporting/ReportRun.php +++ b/lib/Reporting/ReportRun.php @@ -1,5 +1,4 @@ Tax, Shipping, - * and Inventory. - * * @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 bool $active Whether the SKU is available for purchase. @@ -41,4 +37,5 @@ class SKU extends ApiResource use ApiOperations\Delete; use ApiOperations\Retrieve; use ApiOperations\Update; + } diff --git a/lib/Service/AccountLinkService.php b/lib/Service/AccountLinkService.php index 2e90492397..d5f28637bd 100644 --- a/lib/Service/AccountLinkService.php +++ b/lib/Service/AccountLinkService.php @@ -1,5 +1,4 @@ request('post', '/v1/account_links', $params, $opts); } + } diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php index 4ef217d574..c8c7ecb297 100644 --- a/lib/Service/AccountService.php +++ b/lib/Service/AccountService.php @@ -1,5 +1,4 @@ request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); } + } diff --git a/lib/Service/ApplePayDomainService.php b/lib/Service/ApplePayDomainService.php index 3a076f472b..260034889f 100644 --- a/lib/Service/ApplePayDomainService.php +++ b/lib/Service/ApplePayDomainService.php @@ -1,5 +1,4 @@ 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 138c3794e5..ea065d8533 100644 --- a/lib/Service/ApplicationFeeService.php +++ b/lib/Service/ApplicationFeeService.php @@ -1,5 +1,4 @@ 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 0f55385f13..79da649b46 100644 --- a/lib/Service/BalanceService.php +++ b/lib/Service/BalanceService.php @@ -1,5 +1,4 @@ request('get', '/v1/balance', $params, $opts); } + } diff --git a/lib/Service/BalanceTransactionService.php b/lib/Service/BalanceTransactionService.php index 9e6d37c042..6f9806578f 100644 --- a/lib/Service/BalanceTransactionService.php +++ b/lib/Service/BalanceTransactionService.php @@ -1,5 +1,4 @@ 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 23a4d30b2b..91e5692887 100644 --- a/lib/Service/BillingPortal/BillingPortalServiceFactory.php +++ b/lib/Service/BillingPortal/BillingPortalServiceFactory.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..1566e26cb8 100644 --- a/lib/Service/BillingPortal/ConfigurationService.php +++ b/lib/Service/BillingPortal/ConfigurationService.php @@ -1,5 +1,4 @@ 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 6b3e602639..588e78c667 100644 --- a/lib/Service/BillingPortal/SessionService.php +++ b/lib/Service/BillingPortal/SessionService.php @@ -1,5 +1,4 @@ request('post', '/v1/billing_portal/sessions', $params, $opts); } + } diff --git a/lib/Service/ChargeService.php b/lib/Service/ChargeService.php index 568254589d..39cf3eaac1 100644 --- a/lib/Service/ChargeService.php +++ b/lib/Service/ChargeService.php @@ -1,5 +1,4 @@ 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 bb26a837f6..64993f8057 100644 --- a/lib/Service/Checkout/CheckoutServiceFactory.php +++ b/lib/Service/Checkout/CheckoutServiceFactory.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 a2938d0a9b..3487530baa 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. @@ -89,4 +88,5 @@ 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 5157c2b68b..fd2a2bf329 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, - '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, - 'testHelpers' => TestHelpers\TestHelpersServiceFactory::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, + 'testHelpers' => TestHelpers\TestHelpersServiceFactory::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 8f3869fee8..5fceb7e7c9 100644 --- a/lib/Service/CountrySpecService.php +++ b/lib/Service/CountrySpecService.php @@ -1,5 +1,4 @@ request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); } + } diff --git a/lib/Service/CouponService.php b/lib/Service/CouponService.php index 89eb2c7d11..9643687c81 100644 --- a/lib/Service/CouponService.php +++ b/lib/Service/CouponService.php @@ -1,5 +1,4 @@ request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); } + } diff --git a/lib/Service/CreditNoteService.php b/lib/Service/CreditNoteService.php index 5c631328a1..0217457188 100644 --- a/lib/Service/CreditNoteService.php +++ b/lib/Service/CreditNoteService.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: * *