From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- vendor/stripe/stripe-php/lib/Account.php | 862 ++++++------ vendor/stripe/stripe-php/lib/AccountLink.php | 52 +- vendor/stripe/stripe-php/lib/AlipayAccount.php | 150 +- vendor/stripe/stripe-php/lib/ApiOperations/All.php | 74 +- .../stripe/stripe-php/lib/ApiOperations/Create.php | 62 +- .../stripe/stripe-php/lib/ApiOperations/Delete.php | 60 +- .../lib/ApiOperations/NestedResource.php | 270 ++-- .../stripe-php/lib/ApiOperations/Request.php | 202 ++- .../stripe-php/lib/ApiOperations/Retrieve.php | 60 +- .../stripe/stripe-php/lib/ApiOperations/Search.php | 37 + .../stripe/stripe-php/lib/ApiOperations/Update.php | 104 +- vendor/stripe/stripe-php/lib/ApiRequestor.php | 1213 ++++++++-------- vendor/stripe/stripe-php/lib/ApiResource.php | 242 ++-- vendor/stripe/stripe-php/lib/ApiResponse.php | 90 +- vendor/stripe/stripe-php/lib/ApplePayDomain.php | 62 +- vendor/stripe/stripe-php/lib/ApplicationFee.php | 180 +-- .../stripe/stripe-php/lib/ApplicationFeeRefund.php | 132 +- vendor/stripe/stripe-php/lib/Balance.php | 90 +- .../stripe/stripe-php/lib/BalanceTransaction.php | 142 +- vendor/stripe/stripe-php/lib/BankAccount.php | 265 ++-- vendor/stripe/stripe-php/lib/BaseStripeClient.php | 581 ++++---- .../stripe-php/lib/BaseStripeClientInterface.php | 44 + .../stripe-php/lib/BillingPortal/Configuration.php | 63 +- .../stripe-php/lib/BillingPortal/Session.php | 83 +- vendor/stripe/stripe-php/lib/BitcoinReceiver.php | 142 +- .../stripe/stripe-php/lib/BitcoinTransaction.php | 38 +- vendor/stripe/stripe-php/lib/Capability.php | 175 +-- vendor/stripe/stripe-php/lib/Card.php | 285 ++-- vendor/stripe/stripe-php/lib/CashBalance.php | 66 + vendor/stripe/stripe-php/lib/Charge.php | 309 ++-- vendor/stripe/stripe-php/lib/Checkout/Session.php | 226 +-- vendor/stripe/stripe-php/lib/Collection.php | 593 ++++---- vendor/stripe/stripe-php/lib/CountrySpec.php | 60 +- vendor/stripe/stripe-php/lib/Coupon.php | 82 +- vendor/stripe/stripe-php/lib/CreditNote.php | 222 +-- .../stripe/stripe-php/lib/CreditNoteLineItem.php | 52 +- vendor/stripe/stripe-php/lib/Customer.php | 620 ++++---- .../stripe-php/lib/CustomerBalanceTransaction.php | 206 +-- vendor/stripe/stripe-php/lib/Discount.php | 46 +- vendor/stripe/stripe-php/lib/Dispute.php | 164 +-- vendor/stripe/stripe-php/lib/EphemeralKey.php | 86 +- vendor/stripe/stripe-php/lib/ErrorObject.php | 326 +++-- vendor/stripe/stripe-php/lib/Event.php | 486 ++++--- .../lib/Exception/ApiConnectionException.php | 24 +- .../stripe-php/lib/Exception/ApiErrorException.php | 438 +++--- .../lib/Exception/AuthenticationException.php | 22 +- .../lib/Exception/BadMethodCallException.php | 14 +- .../stripe-php/lib/Exception/CardException.php | 168 +-- .../lib/Exception/ExceptionInterface.php | 44 +- .../lib/Exception/IdempotencyException.php | 22 +- .../lib/Exception/InvalidArgumentException.php | 14 +- .../lib/Exception/InvalidRequestException.php | 120 +- .../lib/Exception/OAuth/ExceptionInterface.php | 20 +- .../lib/Exception/OAuth/InvalidClientException.php | 24 +- .../lib/Exception/OAuth/InvalidGrantException.php | 26 +- .../Exception/OAuth/InvalidRequestException.php | 22 +- .../lib/Exception/OAuth/InvalidScopeException.php | 20 +- .../lib/Exception/OAuth/OAuthErrorException.php | 38 +- .../Exception/OAuth/UnknownOAuthErrorException.php | 24 +- .../OAuth/UnsupportedGrantTypeException.php | 22 +- .../OAuth/UnsupportedResponseTypeException.php | 22 +- .../lib/Exception/PermissionException.php | 22 +- .../lib/Exception/RateLimitException.php | 24 +- .../Exception/SignatureVerificationException.php | 148 +- .../lib/Exception/UnexpectedValueException.php | 14 +- .../lib/Exception/UnknownApiErrorException.php | 24 +- vendor/stripe/stripe-php/lib/ExchangeRate.php | 60 +- vendor/stripe/stripe-php/lib/File.php | 174 +-- vendor/stripe/stripe-php/lib/FileLink.php | 60 +- .../lib/FinancialConnections/Account.php | 84 ++ .../lib/FinancialConnections/AccountOwner.php | 20 + .../lib/FinancialConnections/AccountOwnership.php | 18 + .../lib/FinancialConnections/Session.php | 27 + .../stripe/stripe-php/lib/FundingInstructions.php | 28 + .../stripe-php/lib/HttpClient/ClientInterface.php | 44 +- .../stripe-php/lib/HttpClient/CurlClient.php | 1474 ++++++++++---------- .../lib/HttpClient/StreamingClientInterface.php | 23 + .../stripe-php/lib/Identity/VerificationReport.php | 90 +- .../lib/Identity/VerificationSession.php | 176 +-- vendor/stripe/stripe-php/lib/Invoice.php | 545 ++++---- vendor/stripe/stripe-php/lib/InvoiceItem.php | 99 +- vendor/stripe/stripe-php/lib/InvoiceLineItem.php | 67 +- .../stripe-php/lib/Issuing/Authorization.php | 162 +-- vendor/stripe/stripe-php/lib/Issuing/Card.php | 119 +- .../stripe/stripe-php/lib/Issuing/CardDetails.php | 38 +- .../stripe/stripe-php/lib/Issuing/Cardholder.php | 78 +- vendor/stripe/stripe-php/lib/Issuing/Dispute.php | 106 +- .../stripe/stripe-php/lib/Issuing/Transaction.php | 87 +- vendor/stripe/stripe-php/lib/LineItem.php | 52 +- vendor/stripe/stripe-php/lib/LoginLink.php | 30 +- vendor/stripe/stripe-php/lib/Mandate.php | 54 +- vendor/stripe/stripe-php/lib/OAuth.php | 202 +-- vendor/stripe/stripe-php/lib/OAuthErrorObject.php | 62 +- vendor/stripe/stripe-php/lib/Order.php | 162 +-- vendor/stripe/stripe-php/lib/OrderItem.php | 38 +- vendor/stripe/stripe-php/lib/OrderReturn.php | 64 +- vendor/stripe/stripe-php/lib/PaymentIntent.php | 320 +++-- vendor/stripe/stripe-php/lib/PaymentLink.php | 70 + vendor/stripe/stripe-php/lib/PaymentMethod.php | 185 +-- vendor/stripe/stripe-php/lib/Payout.php | 216 +-- vendor/stripe/stripe-php/lib/Person.php | 243 ++-- vendor/stripe/stripe-php/lib/Plan.php | 114 +- vendor/stripe/stripe-php/lib/Price.php | 150 +- vendor/stripe/stripe-php/lib/Product.php | 127 +- vendor/stripe/stripe-php/lib/PromotionCode.php | 66 +- vendor/stripe/stripe-php/lib/Quote.php | 171 +++ .../stripe-php/lib/Radar/EarlyFraudWarning.php | 76 +- vendor/stripe/stripe-php/lib/Radar/ValueList.php | 70 +- .../stripe/stripe-php/lib/Radar/ValueListItem.php | 62 +- vendor/stripe/stripe-php/lib/Recipient.php | 88 +- vendor/stripe/stripe-php/lib/RecipientTransfer.php | 72 +- vendor/stripe/stripe-php/lib/Refund.php | 136 +- .../stripe/stripe-php/lib/Reporting/ReportRun.php | 74 +- .../stripe/stripe-php/lib/Reporting/ReportType.php | 69 +- vendor/stripe/stripe-php/lib/RequestTelemetry.php | 52 +- vendor/stripe/stripe-php/lib/Review.php | 132 +- vendor/stripe/stripe-php/lib/SKU.php | 85 +- vendor/stripe/stripe-php/lib/SearchResult.php | 234 ++++ .../stripe-php/lib/Service/AbstractService.php | 184 +-- .../lib/Service/AbstractServiceFactory.php | 118 +- .../stripe-php/lib/Service/AccountLinkService.php | 50 +- .../stripe-php/lib/Service/AccountService.php | 763 +++++----- .../lib/Service/ApplePayDomainService.php | 140 +- .../lib/Service/ApplicationFeeService.php | 250 ++-- .../stripe-php/lib/Service/BalanceService.php | 52 +- .../lib/Service/BalanceTransactionService.php | 94 +- .../BillingPortal/BillingPortalServiceFactory.php | 54 +- .../Service/BillingPortal/ConfigurationService.php | 146 +- .../lib/Service/BillingPortal/SessionService.php | 46 +- .../stripe-php/lib/Service/ChargeService.php | 223 +-- .../Service/Checkout/CheckoutServiceFactory.php | 50 +- .../lib/Service/Checkout/SessionService.php | 165 ++- .../stripe-php/lib/Service/CoreServiceFactory.php | 268 ++-- .../stripe-php/lib/Service/CountrySpecService.php | 78 +- .../stripe-php/lib/Service/CouponService.php | 208 +-- .../stripe-php/lib/Service/CreditNoteService.php | 312 ++--- .../stripe-php/lib/Service/CustomerService.php | 793 ++++++----- .../stripe-php/lib/Service/DisputeService.php | 166 +-- .../stripe-php/lib/Service/EphemeralKeyService.php | 86 +- .../stripe/stripe-php/lib/Service/EventService.php | 88 +- .../stripe-php/lib/Service/ExchangeRateService.php | 82 +- .../stripe-php/lib/Service/FileLinkService.php | 140 +- .../stripe/stripe-php/lib/Service/FileService.php | 132 +- .../FinancialConnections/AccountService.php | 58 + .../FinancialConnectionsServiceFactory.php | 27 + .../FinancialConnections/SessionService.php | 41 + .../Service/Identity/IdentityServiceFactory.php | 54 +- .../Service/Identity/VerificationReportService.php | 78 +- .../Identity/VerificationSessionService.php | 292 ++-- .../stripe-php/lib/Service/InvoiceItemService.php | 186 +-- .../stripe-php/lib/Service/InvoiceService.php | 564 ++++---- .../lib/Service/Issuing/AuthorizationService.php | 194 +-- .../stripe-php/lib/Service/Issuing/CardService.php | 146 +- .../lib/Service/Issuing/CardholderService.php | 148 +- .../lib/Service/Issuing/DisputeService.php | 198 +-- .../lib/Service/Issuing/IssuingServiceFactory.php | 66 +- .../lib/Service/Issuing/TransactionService.php | 118 +- .../stripe-php/lib/Service/MandateService.php | 48 +- .../stripe/stripe-php/lib/Service/OAuthService.php | 300 ++-- .../stripe-php/lib/Service/OrderReturnService.php | 84 +- .../stripe/stripe-php/lib/Service/OrderService.php | 218 +-- .../lib/Service/PaymentIntentService.php | 464 +++--- .../stripe-php/lib/Service/PaymentLinkService.php | 89 ++ .../lib/Service/PaymentMethodService.php | 251 ++-- .../stripe-php/lib/Service/PayoutService.php | 254 ++-- .../stripe/stripe-php/lib/Service/PlanService.php | 182 +-- .../stripe/stripe-php/lib/Service/PriceService.php | 164 ++- .../stripe-php/lib/Service/ProductService.php | 204 +-- .../lib/Service/PromotionCodeService.php | 147 +- .../stripe/stripe-php/lib/Service/QuoteService.php | 177 +++ .../lib/Service/Radar/EarlyFraudWarningService.php | 86 +- .../lib/Service/Radar/RadarServiceFactory.php | 58 +- .../lib/Service/Radar/ValueListItemService.php | 148 +- .../lib/Service/Radar/ValueListService.php | 186 +-- .../stripe-php/lib/Service/RefundService.php | 171 ++- .../lib/Service/Reporting/ReportRunService.php | 110 +- .../lib/Service/Reporting/ReportTypeService.php | 80 +- .../Service/Reporting/ReportingServiceFactory.php | 54 +- .../stripe-php/lib/Service/ReviewService.php | 116 +- .../stripe-php/lib/Service/SetupAttemptService.php | 46 +- .../stripe-php/lib/Service/SetupIntentService.php | 270 ++-- .../stripe-php/lib/Service/ShippingRateService.php | 70 + .../lib/Service/Sigma/ScheduledQueryRunService.php | 78 +- .../lib/Service/Sigma/SigmaServiceFactory.php | 50 +- .../stripe/stripe-php/lib/Service/SkuService.php | 190 +-- .../stripe-php/lib/Service/SourceService.php | 220 +-- .../lib/Service/SubscriptionItemService.php | 302 ++-- .../lib/Service/SubscriptionScheduleService.php | 226 +-- .../stripe-php/lib/Service/SubscriptionService.php | 279 ++-- .../stripe-php/lib/Service/TaxCodeService.php | 82 +- .../stripe-php/lib/Service/TaxRateService.php | 142 +- .../lib/Service/Terminal/ConfigurationService.php | 86 ++ .../Service/Terminal/ConnectionTokenService.php | 50 +- .../lib/Service/Terminal/LocationService.php | 176 +-- .../lib/Service/Terminal/ReaderService.php | 238 ++-- .../Service/Terminal/TerminalServiceFactory.php | 60 +- .../lib/Service/TestHelpers/RefundService.php | 24 + .../Service/TestHelpers/Terminal/ReaderService.php | 25 + .../Terminal/TerminalServiceFactory.php | 25 + .../lib/Service/TestHelpers/TestClockService.php | 87 ++ .../TestHelpers/TestHelpersServiceFactory.php | 29 + .../stripe/stripe-php/lib/Service/TokenService.php | 84 +- .../stripe/stripe-php/lib/Service/TopupService.php | 178 +-- .../stripe-php/lib/Service/TransferService.php | 350 ++--- .../lib/Service/WebhookEndpointService.php | 194 +-- vendor/stripe/stripe-php/lib/SetupAttempt.php | 64 +- vendor/stripe/stripe-php/lib/SetupIntent.php | 245 ++-- vendor/stripe/stripe-php/lib/ShippingRate.php | 40 + .../stripe-php/lib/Sigma/ScheduledQueryRun.php | 74 +- .../stripe/stripe-php/lib/SingletonApiResource.php | 78 +- vendor/stripe/stripe-php/lib/Source.php | 336 ++--- vendor/stripe/stripe-php/lib/SourceTransaction.php | 40 +- vendor/stripe/stripe-php/lib/Stripe.php | 556 ++++---- vendor/stripe/stripe-php/lib/StripeClient.php | 163 +-- .../stripe-php/lib/StripeClientInterface.php | 77 +- vendor/stripe/stripe-php/lib/StripeObject.php | 1163 +++++++-------- .../lib/StripeStreamingClientInterface.php | 11 + vendor/stripe/stripe-php/lib/Subscription.php | 256 ++-- vendor/stripe/stripe-php/lib/SubscriptionItem.php | 168 +-- .../stripe/stripe-php/lib/SubscriptionSchedule.php | 150 +- vendor/stripe/stripe-php/lib/TaxCode.php | 44 +- vendor/stripe/stripe-php/lib/TaxId.php | 232 +-- vendor/stripe/stripe-php/lib/TaxRate.php | 98 +- .../stripe-php/lib/Terminal/Configuration.php | 28 + .../stripe-php/lib/Terminal/ConnectionToken.php | 44 +- vendor/stripe/stripe-php/lib/Terminal/Location.php | 59 +- vendor/stripe/stripe-php/lib/Terminal/Reader.php | 139 +- .../stripe-php/lib/TestHelpers/TestClock.php | 53 + vendor/stripe/stripe-php/lib/ThreeDSecure.php | 74 +- vendor/stripe/stripe-php/lib/Token.php | 114 +- vendor/stripe/stripe-php/lib/Topup.php | 126 +- vendor/stripe/stripe-php/lib/Transfer.php | 260 ++-- vendor/stripe/stripe-php/lib/TransferReversal.php | 158 +-- vendor/stripe/stripe-php/lib/UsageRecord.php | 50 +- .../stripe/stripe-php/lib/UsageRecordSummary.php | 38 +- .../stripe-php/lib/Util/CaseInsensitiveArray.php | 165 ++- .../stripe/stripe-php/lib/Util/DefaultLogger.php | 58 +- .../stripe/stripe-php/lib/Util/LoggerInterface.php | 68 +- vendor/stripe/stripe-php/lib/Util/ObjectTypes.php | 218 +-- .../stripe/stripe-php/lib/Util/RandomGenerator.php | 72 +- .../stripe/stripe-php/lib/Util/RequestOptions.php | 336 ++--- vendor/stripe/stripe-php/lib/Util/Set.php | 92 +- vendor/stripe/stripe-php/lib/Util/Util.php | 530 +++---- vendor/stripe/stripe-php/lib/Webhook.php | 84 +- vendor/stripe/stripe-php/lib/WebhookEndpoint.php | 82 +- vendor/stripe/stripe-php/lib/WebhookSignature.php | 280 ++-- 246 files changed, 20659 insertions(+), 17949 deletions(-) create mode 100644 vendor/stripe/stripe-php/lib/ApiOperations/Search.php create mode 100644 vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php create mode 100644 vendor/stripe/stripe-php/lib/CashBalance.php create mode 100644 vendor/stripe/stripe-php/lib/FinancialConnections/Account.php create mode 100644 vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php create mode 100644 vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwnership.php create mode 100644 vendor/stripe/stripe-php/lib/FinancialConnections/Session.php create mode 100644 vendor/stripe/stripe-php/lib/FundingInstructions.php create mode 100644 vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php create mode 100644 vendor/stripe/stripe-php/lib/PaymentLink.php create mode 100644 vendor/stripe/stripe-php/lib/Quote.php create mode 100644 vendor/stripe/stripe-php/lib/SearchResult.php create mode 100644 vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/QuoteService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/ShippingRateService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/ShippingRate.php create mode 100644 vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php create mode 100644 vendor/stripe/stripe-php/lib/Terminal/Configuration.php create mode 100644 vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php (limited to 'vendor/stripe/stripe-php/lib') diff --git a/vendor/stripe/stripe-php/lib/Account.php b/vendor/stripe/stripe-php/lib/Account.php index 68fb7e8..87f233a 100644 --- a/vendor/stripe/stripe-php/lib/Account.php +++ b/vendor/stripe/stripe-php/lib/Account.php @@ -1,432 +1,430 @@ -create and manage Express or - * Custom accounts. - * - * @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 null|\Stripe\StripeObject $business_profile Business information about the account. - * @property null|string $business_type The business type. - * @property \Stripe\StripeObject $capabilities - * @property bool $charges_enabled Whether the account can create live charges. - * @property \Stripe\StripeObject $company - * @property \Stripe\StripeObject $controller - * @property string $country The account's country. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. - * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. - * @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. - * @property \Stripe\Collection $external_accounts External accounts (bank accounts and debit cards) currently attached to this account - * @property \Stripe\Person $individual

This is an object representing a person associated with a Stripe account.

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 Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

Related guide: Handling Identity Verification with the API.

- * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property bool $payouts_enabled Whether Stripe can send payouts to this account. - * @property \Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. - * @property \Stripe\StripeObject $tos_acceptance - * @property string $type The Stripe account type. Can be standard, express, or custom. - */ -class Account extends ApiResource -{ - const OBJECT_NAME = 'account'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Update; - - const BUSINESS_TYPE_COMPANY = 'company'; - const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity'; - const BUSINESS_TYPE_INDIVIDUAL = 'individual'; - const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; - - const CAPABILITY_CARD_PAYMENTS = 'card_payments'; - const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; - const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; - const CAPABILITY_TRANSFERS = 'transfers'; - - const CAPABILITY_STATUS_ACTIVE = 'active'; - const CAPABILITY_STATUS_INACTIVE = 'inactive'; - const CAPABILITY_STATUS_PENDING = 'pending'; - - const TYPE_CUSTOM = 'custom'; - const TYPE_EXPRESS = 'express'; - const TYPE_STANDARD = 'standard'; - - use ApiOperations\Retrieve { - retrieve as protected _retrieve; - } - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'external_account', - 'bank_account', - ]); - } - - return $savedNestedResources; - } - - public function instanceUrl() - { - if (null === $this['id']) { - return '/v1/account'; - } - - return parent::instanceUrl(); - } - - public function serializeParameters($force = false) - { - $update = parent::serializeParameters($force); - if (isset($this->_values['legal_entity'])) { - $entity = $this['legal_entity']; - if (isset($entity->_values['additional_owners'])) { - $owners = $entity['additional_owners']; - $entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : []; - $entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners); - $update['legal_entity'] = $entityUpdate; - } - } - if (isset($this->_values['individual'])) { - $individual = $this['individual']; - if (($individual instanceof Person) && !isset($update['individual'])) { - $update['individual'] = $individual->serializeParameters($force); - } - } - - return $update; - } - - private function serializeAdditionalOwners($legalEntity, $additionalOwners) - { - if (isset($legalEntity->_originalValues['additional_owners'])) { - $originalValue = $legalEntity->_originalValues['additional_owners']; - } else { - $originalValue = []; - } - if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { - throw new Exception\InvalidArgumentException( - 'You cannot delete an item from an array, you must instead set a new array' - ); - } - - $updateArr = []; - foreach ($additionalOwners as $i => $v) { - $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; - - if ([] !== $update) { - if (!$originalValue - || !\array_key_exists($i, $originalValue) - || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { - $updateArr[$i] = $update; - } - } - } - - return $updateArr; - } - - /** - * @param null|array|string $id the ID of the account to retrieve, or an - * options array containing an `id` key - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public static function retrieve($id = null, $opts = null) - { - if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { - $opts = $id; - $id = null; - } - - return self::_retrieve($id, $opts); - } - - /** - * @param null|array $clientId - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function deauthorize($clientId = null, $opts = null) - { - $params = [ - 'client_id' => $clientId, - 'stripe_user_id' => $this->id, - ]; - - return OAuth::deauthorize($params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of persons - */ - public function persons($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/persons'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account the rejected account - */ - public function reject($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/reject'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /* - * Capabilities methods - * We can not add the capabilities() method today as the Account object already has a - * capabilities property which is a hash and not the sub-list of capabilities. - */ - - const PATH_CAPABILITIES = '/capabilities'; - - /** - * @param string $id the ID of the account on which to retrieve the capabilities - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of capabilities - */ - public static function allCapabilities($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the capability belongs - * @param string $capabilityId the ID of the capability to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the capability belongs - * @param string $capabilityId the ID of the capability to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public static function updateCapability($id, $capabilityId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); - } - - const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; - - /** - * @param string $id the ID of the account on which to retrieve the external accounts - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of external accounts (BankAccount or Card) - */ - public static function allExternalAccounts($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); - } - - /** - * @param string $id the ID of the account on which to create the external account - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function createExternalAccount($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the external account belongs - * @param string $externalAccountId the ID of the external account to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); - } - - const PATH_LOGIN_LINKS = '/login_links'; - - /** - * @param string $id the ID of the account on which to create the login link - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\LoginLink - */ - public static function createLoginLink($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); - } - - const PATH_PERSONS = '/persons'; - - /** - * @param string $id the ID of the account on which to retrieve the persons - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of persons - */ - public static function allPersons($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); - } - - /** - * @param string $id the ID of the account on which to create the person - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function createPerson($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function deletePerson($id, $personId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function retrievePerson($id, $personId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } - - /** - * @param string $id the ID of the account to which the person belongs - * @param string $personId the ID of the person to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public static function updatePerson($id, $personId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); - } -} +create and manage Express or + * Custom accounts. + * + * @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 null|\Stripe\StripeObject $business_profile Business information about the account. + * @property null|string $business_type The business type. + * @property \Stripe\StripeObject $capabilities + * @property bool $charges_enabled Whether the account can create live charges. + * @property \Stripe\StripeObject $company + * @property \Stripe\StripeObject $controller + * @property string $country The account's country. + * @property int $created Time at which the account was connected. Measured in seconds since the Unix epoch. + * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. + * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. + * @property \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account + * @property \Stripe\StripeObject $future_requirements + * @property \Stripe\Person $individual

This is an object representing a person associated with a Stripe account.

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 Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

Related guide: Handling Identity Verification with the API.

+ * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property bool $payouts_enabled Whether Stripe can send payouts to this account. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. + * @property \Stripe\StripeObject $tos_acceptance + * @property string $type The Stripe account type. Can be standard, express, or custom. + */ +class Account extends ApiResource +{ + const OBJECT_NAME = 'account'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Update; + + const BUSINESS_TYPE_COMPANY = 'company'; + const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity'; + const BUSINESS_TYPE_INDIVIDUAL = 'individual'; + const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; + + const CAPABILITY_CARD_PAYMENTS = 'card_payments'; + const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; + const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; + const CAPABILITY_TRANSFERS = 'transfers'; + + const CAPABILITY_STATUS_ACTIVE = 'active'; + const CAPABILITY_STATUS_INACTIVE = 'inactive'; + const CAPABILITY_STATUS_PENDING = 'pending'; + + const TYPE_CUSTOM = 'custom'; + const TYPE_EXPRESS = 'express'; + const TYPE_STANDARD = 'standard'; + + use ApiOperations\Retrieve { + retrieve as protected _retrieve; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'external_account', + 'bank_account', + ]); + } + + return $savedNestedResources; + } + + public function instanceUrl() + { + if (null === $this['id']) { + return '/v1/account'; + } + + return parent::instanceUrl(); + } + + public function serializeParameters($force = false) + { + $update = parent::serializeParameters($force); + if (isset($this->_values['legal_entity'])) { + $entity = $this['legal_entity']; + if (isset($entity->_values['additional_owners'])) { + $owners = $entity['additional_owners']; + $entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : []; + $entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners); + $update['legal_entity'] = $entityUpdate; + } + } + if (isset($this->_values['individual'])) { + $individual = $this['individual']; + if (($individual instanceof Person) && !isset($update['individual'])) { + $update['individual'] = $individual->serializeParameters($force); + } + } + + return $update; + } + + private function serializeAdditionalOwners($legalEntity, $additionalOwners) + { + if (isset($legalEntity->_originalValues['additional_owners'])) { + $originalValue = $legalEntity->_originalValues['additional_owners']; + } else { + $originalValue = []; + } + if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { + throw new Exception\InvalidArgumentException( + 'You cannot delete an item from an array, you must instead set a new array' + ); + } + + $updateArr = []; + foreach ($additionalOwners as $i => $v) { + $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; + + if ([] !== $update) { + if (!$originalValue + || !\array_key_exists($i, $originalValue) + || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + $updateArr[$i] = $update; + } + } + } + + return $updateArr; + } + + /** + * @param null|array|string $id the ID of the account to retrieve, or an + * options array containing an `id` key + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public static function retrieve($id = null, $opts = null) + { + if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { + $opts = $id; + $id = null; + } + + return self::_retrieve($id, $opts); + } + + /** + * @param null|array $clientId + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($clientId = null, $opts = null) + { + $params = [ + 'client_id' => $clientId, + 'stripe_user_id' => $this->id, + ]; + + return OAuth::deauthorize($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Person> the list of persons + */ + public function persons($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account the rejected account + */ + public function reject($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reject'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /* + * Capabilities methods + * We can not add the capabilities() method today as the Account object already has a + * capabilities property which is a hash and not the sub-list of capabilities. + */ + + const PATH_CAPABILITIES = '/capabilities'; + + /** + * @param string $id the ID of the account on which to retrieve the capabilities + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Capability> the list of capabilities + */ + public static function allCapabilities($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function updateCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; + + /** + * @param string $id the ID of the account on which to retrieve the external accounts + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> the list of external accounts (BankAccount or Card) + */ + public static function allExternalAccounts($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the external account + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function createExternalAccount($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + const PATH_LOGIN_LINKS = '/login_links'; + + /** + * @param string $id the ID of the account on which to create the login link + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public static function createLoginLink($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); + } + const PATH_PERSONS = '/persons'; + + /** + * @param string $id the ID of the account on which to retrieve the persons + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Person> the list of persons + */ + public static function allPersons($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the person + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function createPerson($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function deletePerson($id, $personId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function retrievePerson($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function updatePerson($id, $personId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/AccountLink.php b/vendor/stripe/stripe-php/lib/AccountLink.php index 24a9e68..87f5739 100644 --- a/vendor/stripe/stripe-php/lib/AccountLink.php +++ b/vendor/stripe/stripe-php/lib/AccountLink.php @@ -1,26 +1,26 @@ -Connect - * Onboarding. - * - * @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 int $expires_at The timestamp at which this account link will expire. - * @property string $url The URL for the account link. - */ -class AccountLink extends ApiResource -{ - const OBJECT_NAME = 'account_link'; - - use ApiOperations\Create; -} +Connect + * Onboarding. + * + * @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 int $expires_at The timestamp at which this account link will expire. + * @property string $url The URL for the account link. + */ +class AccountLink extends ApiResource +{ + const OBJECT_NAME = 'account_link'; + + use ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/AlipayAccount.php b/vendor/stripe/stripe-php/lib/AlipayAccount.php index 1d6a509..13f4ad6 100644 --- a/vendor/stripe/stripe-php/lib/AlipayAccount.php +++ b/vendor/stripe/stripe-php/lib/AlipayAccount.php @@ -1,75 +1,75 @@ -json, $opts); - if (!($obj instanceof \Stripe\Collection)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setLastResponse($response); - $obj->setFilters($params); - - return $obj; - } -} +json, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setLastResponse($response); + $obj->setFilters($params); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Create.php b/vendor/stripe/stripe-php/lib/ApiOperations/Create.php index c435132..d1dead9 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/Create.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Create.php @@ -1,31 +1,31 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php b/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php index c6082ff..291546a 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php @@ -1,30 +1,30 @@ -instanceUrl(); - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +instanceUrl(); + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php index 180cacd..ed9c830 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php @@ -1,135 +1,135 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * - * @return string - */ - protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) - { - $url = static::resourceUrl($id) . $nestedPath; - if (null !== $nestedId) { - $url .= "/{$nestedId}"; - } - - return $url; - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath); - - return self::_nestedResourceOperation('post', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('get', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('post', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|string $nestedId - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); - - return self::_nestedResourceOperation('delete', $url, $params, $options); - } - - /** - * @param string $id - * @param string $nestedPath - * @param null|array $params - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\StripeObject - */ - protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) - { - $url = static::_nestedResourceUrl($id, $nestedPath); - - return self::_nestedResourceOperation('get', $url, $params, $options); - } -} +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * + * @return string + */ + protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) + { + $url = static::resourceUrl($id) . $nestedPath; + if (null !== $nestedId) { + $url .= "/{$nestedId}"; + } + + return $url; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('delete', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Request.php b/vendor/stripe/stripe-php/lib/ApiOperations/Request.php index 24c3741..a5046ab 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/Request.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Request.php @@ -1,102 +1,100 @@ - 100, " - . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return array tuple containing (the JSON response, $options) - */ - protected function _request($method, $url, $params = [], $options = null) - { - $opts = $this->_opts->merge($options); - list($resp, $options) = static::_staticRequest($method, $url, $params, $opts); - $this->setLastResponse($resp); - - return [$resp->json, $options]; - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param callable $readBodyChunk function that will receive chunks of data from a successful request body - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return array tuple containing (the JSON response, $options) - */ - protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) - { - $opts = $this->_opts->merge($options); - static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts); - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return array tuple containing (the JSON response, $options) - */ - protected static function _staticRequest($method, $url, $params, $options) - { - $opts = \Stripe\Util\RequestOptions::parse($options); - $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); - $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); - list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); - $opts->discardNonPersistentHeaders(); - - return [$response, $opts]; - } - - /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param callable $readBodyChunk function that will receive chunks of data from a successful request body - * @param array $params list of parameters for the request - * @param null|array|string $options - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - */ - protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) - { - $opts = \Stripe\Util\RequestOptions::parse($options); - $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); - $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); - $requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers); - } -} + 100, " + . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected function _request($method, $url, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + list($resp, $options) = static::_staticRequest($method, $url, $params, $opts); + $this->setLastResponse($resp); + + return [$resp->json, $options]; + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts); + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected static function _staticRequest($method, $url, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + + return [$response, $opts]; + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + $requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php b/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php index 5170afb..ddd8e51 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php @@ -1,30 +1,30 @@ -refresh(); - - return $instance; - } -} +refresh(); + + return $instance; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Search.php b/vendor/stripe/stripe-php/lib/ApiOperations/Search.php new file mode 100644 index 0000000..e52f8b9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Search.php @@ -0,0 +1,37 @@ +json, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setLastResponse($response); + $obj->setFilters($params); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiOperations/Update.php b/vendor/stripe/stripe-php/lib/ApiOperations/Update.php index 688f080..841b039 100644 --- a/vendor/stripe/stripe-php/lib/ApiOperations/Update.php +++ b/vendor/stripe/stripe-php/lib/ApiOperations/Update.php @@ -1,52 +1,52 @@ -json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return static the saved resource - */ - public function save($opts = null) - { - $params = $this->serializeParameters(); - if (\count($params) > 0) { - $url = $this->instanceUrl(); - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - } - - return $this; - } -} +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return static the saved resource + */ + public function save($opts = null) + { + $params = $this->serializeParameters(); + if (\count($params) > 0) { + $url = $this->instanceUrl(); + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + } + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiRequestor.php b/vendor/stripe/stripe-php/lib/ApiRequestor.php index 98e4dfe..3e3c93c 100644 --- a/vendor/stripe/stripe-php/lib/ApiRequestor.php +++ b/vendor/stripe/stripe-php/lib/ApiRequestor.php @@ -1,594 +1,619 @@ -_apiKey = $apiKey; - if (!$apiBase) { - $apiBase = Stripe::$apiBase; - } - $this->_apiBase = $apiBase; - } - - /** - * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers. - * - * @static - * - * @param RequestTelemetry $requestTelemetry - * - * @return string - */ - private static function _telemetryJson($requestTelemetry) - { - $payload = [ - 'last_request_metrics' => [ - 'request_id' => $requestTelemetry->requestId, - 'request_duration_ms' => $requestTelemetry->requestDuration, - ], - ]; - - $result = \json_encode($payload); - if (false !== $result) { - return $result; - } - Stripe::getLogger()->error('Serializing telemetry payload failed!'); - - return '{}'; - } - - /** - * @static - * - * @param ApiResource|array|bool|mixed $d - * - * @return ApiResource|array|mixed|string - */ - private static function _encodeObjects($d) - { - if ($d instanceof ApiResource) { - return Util\Util::utf8($d->id); - } - if (true === $d) { - return 'true'; - } - if (false === $d) { - return 'false'; - } - if (\is_array($d)) { - $res = []; - foreach ($d as $k => $v) { - $res[$k] = self::_encodeObjects($v); - } - - return $res; - } - - return Util\Util::utf8($d); - } - - /** - * @param string $method - * @param string $url - * @param null|array $params - * @param null|array $headers - * - * @throws Exception\ApiErrorException - * - * @return array tuple containing (ApiReponse, API key) - */ - public function request($method, $url, $params = null, $headers = null) - { - $params = $params ?: []; - $headers = $headers ?: []; - list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRaw($method, $url, $params, $headers); - $json = $this->_interpretResponse($rbody, $rcode, $rheaders); - $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); - - return [$resp, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param callable $readBodyChunk - * @param null|array $params - * @param null|array $headers - * - * @throws Exception\ApiErrorException - * - * @return array tuple containing (ApiReponse, API key) - */ - public function requestStream($method, $url, $readBodyChunk, $params = null, $headers = null) - { - $params = $params ?: []; - $headers = $headers ?: []; - list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunk); - if ($rcode >= 300) { - $this->_interpretResponse($rbody, $rcode, $rheaders); - } - } - - /** - * @param string $rbody a JSON string - * @param int $rcode - * @param array $rheaders - * @param array $resp - * - * @throws Exception\UnexpectedValueException - * @throws Exception\ApiErrorException - */ - public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) - { - if (!\is_array($resp) || !isset($resp['error'])) { - $msg = "Invalid response object from API: {$rbody} " - . "(HTTP response code was {$rcode})"; - - throw new Exception\UnexpectedValueException($msg); - } - - $errorData = $resp['error']; - - $error = null; - if (\is_string($errorData)) { - $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); - } - if (!$error) { - $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); - } - - throw $error; - } - - /** - * @static - * - * @param string $rbody - * @param int $rcode - * @param array $rheaders - * @param array $resp - * @param array $errorData - * - * @return Exception\ApiErrorException - */ - private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) - { - $msg = isset($errorData['message']) ? $errorData['message'] : null; - $param = isset($errorData['param']) ? $errorData['param'] : null; - $code = isset($errorData['code']) ? $errorData['code'] : null; - $type = isset($errorData['type']) ? $errorData['type'] : null; - $declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null; - - switch ($rcode) { - case 400: - // 'rate_limit' code is deprecated, but left here for backwards compatibility - // for API versions earlier than 2015-09-08 - if ('rate_limit' === $code) { - return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - } - if ('idempotency_error' === $type) { - return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - } - - // no break - case 404: - return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - - case 401: - return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - - case 402: - return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param); - - case 403: - return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - - case 429: - return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); - - default: - return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); - } - } - - /** - * @static - * - * @param bool|string $rbody - * @param int $rcode - * @param array $rheaders - * @param array $resp - * @param string $errorCode - * - * @return Exception\OAuth\OAuthErrorException - */ - private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) - { - $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; - - switch ($errorCode) { - case 'invalid_client': - return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_grant': - return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_request': - return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'invalid_scope': - return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'unsupported_grant_type': - return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - case 'unsupported_response_type': - return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - - default: - return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); - } - } - - /** - * @static - * - * @param null|array $appInfo - * - * @return null|string - */ - private static function _formatAppInfo($appInfo) - { - if (null !== $appInfo) { - $string = $appInfo['name']; - if (null !== $appInfo['version']) { - $string .= '/' . $appInfo['version']; - } - if (null !== $appInfo['url']) { - $string .= ' (' . $appInfo['url'] . ')'; - } - - return $string; - } - - return null; - } - - /** - * @static - * - * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') - * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled - * @param mixed $disableFunctionsOutput - * - * @return bool - */ - private static function _isDisabled($disableFunctionsOutput, $functionName) - { - $disabledFunctions = \explode(',', $disableFunctionsOutput); - foreach ($disabledFunctions as $disabledFunction) { - if (\trim($disabledFunction) === $functionName) { - return true; - } - } - - return false; - } - - /** - * @static - * - * @param string $apiKey - * @param null $clientInfo - * - * @return array - */ - private static function _defaultHeaders($apiKey, $clientInfo = null) - { - $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; - - $langVersion = \PHP_VERSION; - $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname'); - $uname = $uname_disabled ? '(disabled)' : \php_uname(); - - $appInfo = Stripe::getAppInfo(); - $ua = [ - 'bindings_version' => Stripe::VERSION, - 'lang' => 'php', - 'lang_version' => $langVersion, - 'publisher' => 'stripe', - 'uname' => $uname, - ]; - if ($clientInfo) { - $ua = \array_merge($clientInfo, $ua); - } - if (null !== $appInfo) { - $uaString .= ' ' . self::_formatAppInfo($appInfo); - $ua['application'] = $appInfo; - } - - return [ - 'X-Stripe-Client-User-Agent' => \json_encode($ua), - 'User-Agent' => $uaString, - 'Authorization' => 'Bearer ' . $apiKey, - ]; - } - - private function _prepareRequest($method, $url, $params, $headers) - { - $myApiKey = $this->_apiKey; - if (!$myApiKey) { - $myApiKey = Stripe::$apiKey; - } - - if (!$myApiKey) { - $msg = 'No API key provided. (HINT: set your API key using ' - . '"Stripe::setApiKey()". You can generate API keys from ' - . 'the Stripe web interface. See https://stripe.com/api for ' - . 'details, or email support@stripe.com if you have any questions.'; - - throw new Exception\AuthenticationException($msg); - } - - // Clients can supply arbitrary additional keys to be included in the - // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() - // method - $clientUAInfo = null; - if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { - $clientUAInfo = $this->httpClient()->getUserAgentInfo(); - } - - if ($params && \is_array($params)) { - $optionKeysInParams = \array_filter( - static::$OPTIONS_KEYS, - function ($key) use ($params) { - return \array_key_exists($key, $params); - } - ); - if (\count($optionKeysInParams) > 0) { - $message = \sprintf('Options found in $params: %s. Options should ' - . 'be passed in their own array after $params. (HINT: pass an ' - . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams)); - \trigger_error($message, \E_USER_WARNING); - } - } - - $absUrl = $this->_apiBase . $url; - $params = self::_encodeObjects($params); - $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); - if (Stripe::$apiVersion) { - $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; - } - - if (Stripe::$accountId) { - $defaultHeaders['Stripe-Account'] = Stripe::$accountId; - } - - if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) { - $defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry); - } - - $hasFile = false; - foreach ($params as $k => $v) { - if (\is_resource($v)) { - $hasFile = true; - $params[$k] = self::_processResourceParam($v); - } elseif ($v instanceof \CURLFile) { - $hasFile = true; - } - } - - if ($hasFile) { - $defaultHeaders['Content-Type'] = 'multipart/form-data'; - } else { - $defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded'; - } - - $combinedHeaders = \array_merge($defaultHeaders, $headers); - $rawHeaders = []; - - foreach ($combinedHeaders as $header => $value) { - $rawHeaders[] = $header . ': ' . $value; - } - - return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param array $params - * @param array $headers - * - * @throws Exception\AuthenticationException - * @throws Exception\ApiConnectionException - * - * @return array - */ - private function _requestRaw($method, $url, $params, $headers) - { - list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); - - $requestStartMs = Util\Util::currentTimeMillis(); - - list($rbody, $rcode, $rheaders) = $this->httpClient()->request( - $method, - $absUrl, - $rawHeaders, - $params, - $hasFile - ); - - if (isset($rheaders['request-id']) - && \is_string($rheaders['request-id']) - && \strlen($rheaders['request-id']) > 0) { - self::$requestTelemetry = new RequestTelemetry( - $rheaders['request-id'], - Util\Util::currentTimeMillis() - $requestStartMs - ); - } - - return [$rbody, $rcode, $rheaders, $myApiKey]; - } - - /** - * @param string $method - * @param string $url - * @param array $params - * @param array $headers - * @param callable $readBodyChunk - * - * @throws Exception\AuthenticationException - * @throws Exception\ApiConnectionException - * - * @return array - */ - private function _requestRawStreaming($method, $url, $params, $headers, $readBodyChunk) - { - list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); - - $requestStartMs = Util\Util::currentTimeMillis(); - - list($rbody, $rcode, $rheaders) = $this->httpClient()->requestStream( - $method, - $absUrl, - $rawHeaders, - $params, - $hasFile, - $readBodyChunk - ); - - if (isset($rheaders['request-id']) - && \is_string($rheaders['request-id']) - && \strlen($rheaders['request-id']) > 0) { - self::$requestTelemetry = new RequestTelemetry( - $rheaders['request-id'], - Util\Util::currentTimeMillis() - $requestStartMs - ); - } - - return [$rbody, $rcode, $rheaders, $myApiKey]; - } - - /** - * @param resource $resource - * - * @throws Exception\InvalidArgumentException - * - * @return \CURLFile|string - */ - private function _processResourceParam($resource) - { - if ('stream' !== \get_resource_type($resource)) { - throw new Exception\InvalidArgumentException( - 'Attempted to upload a resource that is not a stream' - ); - } - - $metaData = \stream_get_meta_data($resource); - if ('plainfile' !== $metaData['wrapper_type']) { - throw new Exception\InvalidArgumentException( - 'Only plainfile resource streams are supported' - ); - } - - // We don't have the filename or mimetype, but the API doesn't care - return new \CURLFile($metaData['uri']); - } - - /** - * @param string $rbody - * @param int $rcode - * @param array $rheaders - * - * @throws Exception\UnexpectedValueException - * @throws Exception\ApiErrorException - * - * @return array - */ - private function _interpretResponse($rbody, $rcode, $rheaders) - { - $resp = \json_decode($rbody, true); - $jsonError = \json_last_error(); - if (null === $resp && \JSON_ERROR_NONE !== $jsonError) { - $msg = "Invalid response body from API: {$rbody} " - . "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})"; - - throw new Exception\UnexpectedValueException($msg, $rcode); - } - - if ($rcode < 200 || $rcode >= 300) { - $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); - } - - return $resp; - } - - /** - * @static - * - * @param HttpClient\ClientInterface $client - */ - public static function setHttpClient($client) - { - self::$_httpClient = $client; - } - - /** - * @static - * - * Resets any stateful telemetry data - */ - public static function resetTelemetry() - { - self::$requestTelemetry = null; - } - - /** - * @return HttpClient\ClientInterface - */ - private function httpClient() - { - if (!self::$_httpClient) { - self::$_httpClient = HttpClient\CurlClient::instance(); - } - - return self::$_httpClient; - } -} +_apiKey = $apiKey; + if (!$apiBase) { + $apiBase = Stripe::$apiBase; + } + $this->_apiBase = $apiBase; + } + + /** + * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers. + * + * @static + * + * @param RequestTelemetry $requestTelemetry + * + * @return string + */ + private static function _telemetryJson($requestTelemetry) + { + $payload = [ + 'last_request_metrics' => [ + 'request_id' => $requestTelemetry->requestId, + 'request_duration_ms' => $requestTelemetry->requestDuration, + ], + ]; + + $result = \json_encode($payload); + if (false !== $result) { + return $result; + } + Stripe::getLogger()->error('Serializing telemetry payload failed!'); + + return '{}'; + } + + /** + * @static + * + * @param ApiResource|array|bool|mixed $d + * + * @return ApiResource|array|mixed|string + */ + private static function _encodeObjects($d) + { + if ($d instanceof ApiResource) { + return Util\Util::utf8($d->id); + } + if (true === $d) { + return 'true'; + } + if (false === $d) { + return 'false'; + } + if (\is_array($d)) { + $res = []; + foreach ($d as $k => $v) { + $res[$k] = self::_encodeObjects($v); + } + + return $res; + } + + return Util\Util::utf8($d); + } + + /** + * @param string $method + * @param string $url + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + * + * @return array tuple containing (ApiReponse, API key) + */ + public function request($method, $url, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRaw($method, $url, $params, $headers); + $json = $this->_interpretResponse($rbody, $rcode, $rheaders); + $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); + + return [$resp, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + */ + public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable); + if ($rcode >= 300) { + $this->_interpretResponse($rbody, $rcode, $rheaders); + } + } + + /** + * @param string $rbody a JSON string + * @param int $rcode + * @param array $rheaders + * @param array $resp + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + */ + public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) + { + if (!\is_array($resp) || !isset($resp['error'])) { + $msg = "Invalid response object from API: {$rbody} " + . "(HTTP response code was {$rcode})"; + + throw new Exception\UnexpectedValueException($msg); + } + + $errorData = $resp['error']; + + $error = null; + if (\is_string($errorData)) { + $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); + } + if (!$error) { + $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); + } + + throw $error; + } + + /** + * @static + * + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param array $errorData + * + * @return Exception\ApiErrorException + */ + private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) + { + $msg = isset($errorData['message']) ? $errorData['message'] : null; + $param = isset($errorData['param']) ? $errorData['param'] : null; + $code = isset($errorData['code']) ? $errorData['code'] : null; + $type = isset($errorData['type']) ? $errorData['type'] : null; + $declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null; + + switch ($rcode) { + case 400: + // 'rate_limit' code is deprecated, but left here for backwards compatibility + // for API versions earlier than 2015-09-08 + if ('rate_limit' === $code) { + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + } + if ('idempotency_error' === $type) { + return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + + // no break + case 404: + return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + case 401: + return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 402: + return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param); + + case 403: + return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 429: + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + default: + return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + } + + /** + * @static + * + * @param bool|string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param string $errorCode + * + * @return Exception\OAuth\OAuthErrorException + */ + private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) + { + $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; + + switch ($errorCode) { + case 'invalid_client': + return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_grant': + return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_request': + return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_scope': + return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_grant_type': + return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_response_type': + return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + default: + return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + } + } + + /** + * @static + * + * @param null|array $appInfo + * + * @return null|string + */ + private static function _formatAppInfo($appInfo) + { + if (null !== $appInfo) { + $string = $appInfo['name']; + if (null !== $appInfo['version']) { + $string .= '/' . $appInfo['version']; + } + if (null !== $appInfo['url']) { + $string .= ' (' . $appInfo['url'] . ')'; + } + + return $string; + } + + return null; + } + + /** + * @static + * + * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') + * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled + * @param mixed $disableFunctionsOutput + * + * @return bool + */ + private static function _isDisabled($disableFunctionsOutput, $functionName) + { + $disabledFunctions = \explode(',', $disableFunctionsOutput); + foreach ($disabledFunctions as $disabledFunction) { + if (\trim($disabledFunction) === $functionName) { + return true; + } + } + + return false; + } + + /** + * @static + * + * @param string $apiKey + * @param null $clientInfo + * + * @return array + */ + private static function _defaultHeaders($apiKey, $clientInfo = null) + { + $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; + + $langVersion = \PHP_VERSION; + $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname'); + $uname = $uname_disabled ? '(disabled)' : \php_uname(); + + $appInfo = Stripe::getAppInfo(); + $ua = [ + 'bindings_version' => Stripe::VERSION, + 'lang' => 'php', + 'lang_version' => $langVersion, + 'publisher' => 'stripe', + 'uname' => $uname, + ]; + if ($clientInfo) { + $ua = \array_merge($clientInfo, $ua); + } + if (null !== $appInfo) { + $uaString .= ' ' . self::_formatAppInfo($appInfo); + $ua['application'] = $appInfo; + } + + return [ + 'X-Stripe-Client-User-Agent' => \json_encode($ua), + 'User-Agent' => $uaString, + 'Authorization' => 'Bearer ' . $apiKey, + ]; + } + + private function _prepareRequest($method, $url, $params, $headers) + { + $myApiKey = $this->_apiKey; + if (!$myApiKey) { + $myApiKey = Stripe::$apiKey; + } + + if (!$myApiKey) { + $msg = 'No API key provided. (HINT: set your API key using ' + . '"Stripe::setApiKey()". You can generate API keys from ' + . 'the Stripe web interface. See https://stripe.com/api for ' + . 'details, or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + // Clients can supply arbitrary additional keys to be included in the + // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() + // method + $clientUAInfo = null; + if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { + $clientUAInfo = $this->httpClient()->getUserAgentInfo(); + } + + if ($params && \is_array($params)) { + $optionKeysInParams = \array_filter( + static::$OPTIONS_KEYS, + function ($key) use ($params) { + return \array_key_exists($key, $params); + } + ); + if (\count($optionKeysInParams) > 0) { + $message = \sprintf('Options found in $params: %s. Options should ' + . 'be passed in their own array after $params. (HINT: pass an ' + . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams)); + \trigger_error($message, \E_USER_WARNING); + } + } + + $absUrl = $this->_apiBase . $url; + $params = self::_encodeObjects($params); + $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); + if (Stripe::$apiVersion) { + $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; + } + + if (Stripe::$accountId) { + $defaultHeaders['Stripe-Account'] = Stripe::$accountId; + } + + if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) { + $defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry); + } + + $hasFile = false; + foreach ($params as $k => $v) { + if (\is_resource($v)) { + $hasFile = true; + $params[$k] = self::_processResourceParam($v); + } elseif ($v instanceof \CURLFile) { + $hasFile = true; + } + } + + if ($hasFile) { + $defaultHeaders['Content-Type'] = 'multipart/form-data'; + } else { + $defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + $combinedHeaders = \array_merge($defaultHeaders, $headers); + $rawHeaders = []; + + foreach ($combinedHeaders as $header => $value) { + $rawHeaders[] = $header . ': ' . $value; + } + + return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRaw($method, $url, $params, $headers) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->httpClient()->request( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && '' !== $rheaders['request-id']) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * @param callable $readBodyChunk + * @param mixed $readBodyChunkCallable + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile, + $readBodyChunkCallable + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && '' !== $rheaders['request-id']) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param resource $resource + * + * @throws Exception\InvalidArgumentException + * + * @return \CURLFile|string + */ + private function _processResourceParam($resource) + { + if ('stream' !== \get_resource_type($resource)) { + throw new Exception\InvalidArgumentException( + 'Attempted to upload a resource that is not a stream' + ); + } + + $metaData = \stream_get_meta_data($resource); + if ('plainfile' !== $metaData['wrapper_type']) { + throw new Exception\InvalidArgumentException( + 'Only plainfile resource streams are supported' + ); + } + + // We don't have the filename or mimetype, but the API doesn't care + return new \CURLFile($metaData['uri']); + } + + /** + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + * + * @return array + */ + private function _interpretResponse($rbody, $rcode, $rheaders) + { + $resp = \json_decode($rbody, true); + $jsonError = \json_last_error(); + if (null === $resp && \JSON_ERROR_NONE !== $jsonError) { + $msg = "Invalid response body from API: {$rbody} " + . "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})"; + + throw new Exception\UnexpectedValueException($msg, $rcode); + } + + if ($rcode < 200 || $rcode >= 300) { + $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); + } + + return $resp; + } + + /** + * @static + * + * @param HttpClient\ClientInterface $client + */ + public static function setHttpClient($client) + { + self::$_httpClient = $client; + } + + /** + * @static + * + * @param HttpClient\StreamingClientInterface $client + */ + public static function setStreamingHttpClient($client) + { + self::$_streamingHttpClient = $client; + } + + /** + * @static + * + * Resets any stateful telemetry data + */ + public static function resetTelemetry() + { + self::$requestTelemetry = null; + } + + /** + * @return HttpClient\ClientInterface + */ + private function httpClient() + { + if (!self::$_httpClient) { + self::$_httpClient = HttpClient\CurlClient::instance(); + } + + return self::$_httpClient; + } + + /** + * @return HttpClient\StreamingClientInterface + */ + private function streamingHttpClient() + { + if (!self::$_streamingHttpClient) { + self::$_streamingHttpClient = HttpClient\CurlClient::instance(); + } + + return self::$_streamingHttpClient; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiResource.php b/vendor/stripe/stripe-php/lib/ApiResource.php index 521010b..2b4dc65 100644 --- a/vendor/stripe/stripe-php/lib/ApiResource.php +++ b/vendor/stripe/stripe-php/lib/ApiResource.php @@ -1,120 +1,122 @@ -{$k}; - if ((static::getSavedNestedResources()->includes($k)) - && ($v instanceof ApiResource)) { - $v->saveWithParent = true; - } - } - - /** - * @throws Exception\ApiErrorException - * - * @return ApiResource the refreshed resource - */ - public function refresh() - { - $requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl()); - $url = $this->instanceUrl(); - - list($response, $this->_opts->apiKey) = $requestor->request( - 'get', - $url, - $this->_retrieveOptions, - $this->_opts->headers - ); - $this->setLastResponse($response); - $this->refreshFrom($response->json, $this->_opts); - - return $this; - } - - /** - * @return string the base URL for the given class - */ - public static function baseUrl() - { - return Stripe::$apiBase; - } - - /** - * @return string the endpoint URL for the given class - */ - public static function classUrl() - { - // Replace dots with slashes for namespaced resources, e.g. if the object's name is - // "foo.bar", then its URL will be "/v1/foo/bars". - $base = \str_replace('.', '/', static::OBJECT_NAME); - - return "/v1/{$base}s"; - } - - /** - * @param null|string $id the ID of the resource - * - * @throws Exception\UnexpectedValueException if $id is null - * - * @return string the instance endpoint URL for the given class - */ - public static function resourceUrl($id) - { - if (null === $id) { - $class = static::class; - $message = 'Could not determine which URL to request: ' - . "{$class} instance has invalid ID: {$id}"; - - throw new Exception\UnexpectedValueException($message); - } - $id = Util\Util::utf8($id); - $base = static::classUrl(); - $extn = \urlencode($id); - - return "{$base}/{$extn}"; - } - - /** - * @return string the full API URL for this API resource - */ - public function instanceUrl() - { - return static::resourceUrl($this['id']); - } -} +{$k}; + if ((static::getSavedNestedResources()->includes($k)) + && ($v instanceof ApiResource)) { + $v->saveWithParent = true; + } + } + + /** + * @throws Exception\ApiErrorException + * + * @return ApiResource the refreshed resource + */ + public function refresh() + { + $requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl()); + $url = $this->instanceUrl(); + + list($response, $this->_opts->apiKey) = $requestor->request( + 'get', + $url, + $this->_retrieveOptions, + $this->_opts->headers + ); + $this->setLastResponse($response); + $this->refreshFrom($response->json, $this->_opts); + + return $this; + } + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bars". + + /** @phpstan-ignore-next-line */ + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}s"; + } + + /** + * @param null|string $id the ID of the resource + * + * @throws Exception\UnexpectedValueException if $id is null + * + * @return string the instance endpoint URL for the given class + */ + public static function resourceUrl($id) + { + if (null === $id) { + $class = static::class; + $message = 'Could not determine which URL to request: ' + . "{$class} instance has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($message); + } + $id = Util\Util::utf8($id); + $base = static::classUrl(); + $extn = \urlencode($id); + + return "{$base}/{$extn}"; + } + + /** + * @return string the full API URL for this API resource + */ + public function instanceUrl() + { + return static::resourceUrl($this['id']); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApiResponse.php b/vendor/stripe/stripe-php/lib/ApiResponse.php index e7ee2e9..64ed3e2 100644 --- a/vendor/stripe/stripe-php/lib/ApiResponse.php +++ b/vendor/stripe/stripe-php/lib/ApiResponse.php @@ -1,45 +1,45 @@ -body = $body; - $this->code = $code; - $this->headers = $headers; - $this->json = $json; - } -} +body = $body; + $this->code = $code; + $this->headers = $headers; + $this->json = $json; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplePayDomain.php b/vendor/stripe/stripe-php/lib/ApplePayDomain.php index 5f9489d..4bb458c 100644 --- a/vendor/stripe/stripe-php/lib/ApplePayDomain.php +++ b/vendor/stripe/stripe-php/lib/ApplePayDomain.php @@ -1,31 +1,31 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - */ -class ApplePayDomain extends ApiResource -{ - const OBJECT_NAME = 'apple_pay_domain'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - - /** - * @return string The class URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public static function classUrl() - { - return '/v1/apple_pay/domains'; - } -} +true if the object exists in live mode or the value false if the object exists in test mode. + */ +class ApplePayDomain extends ApiResource +{ + const OBJECT_NAME = 'apple_pay_domain'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/apple_pay/domains'; + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplicationFee.php b/vendor/stripe/stripe-php/lib/ApplicationFee.php index 88aeed6..46a37d2 100644 --- a/vendor/stripe/stripe-php/lib/ApplicationFee.php +++ b/vendor/stripe/stripe-php/lib/ApplicationFee.php @@ -1,90 +1,90 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false 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 destination 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 $refunds A list of refunds that have been applied to the fee. - */ -class ApplicationFee extends ApiResource -{ - const OBJECT_NAME = 'application_fee'; - - use ApiOperations\All; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - - const PATH_REFUNDS = '/refunds'; - - /** - * @param string $id the ID of the application fee on which to retrieve the fee refunds - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of fee refunds - */ - public static function allRefunds($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); - } - - /** - * @param string $id the ID of the application fee on which to create the fee refund - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function createRefund($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts); - } - - /** - * @param string $id the ID of the application fee to which the fee refund belongs - * @param string $refundId the ID of the fee refund to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function retrieveRefund($id, $refundId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); - } - - /** - * @param string $id the ID of the application fee to which the fee refund belongs - * @param string $refundId the ID of the fee refund to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public static function updateRefund($id, $refundId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); - } -} +ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false 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 destination 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. + */ +class ApplicationFee extends ApiResource +{ + const OBJECT_NAME = 'application_fee'; + + use ApiOperations\All; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + + const PATH_REFUNDS = '/refunds'; + + /** + * @param string $id the ID of the application fee on which to retrieve the fee refunds + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> the list of fee refunds + */ + public static function allRefunds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee on which to create the fee refund + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function createRefund($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function retrieveRefund($id, $refundId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function updateRefund($id, $refundId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php b/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php index dc7c34b..12ccb9b 100644 --- a/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php +++ b/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php @@ -1,66 +1,66 @@ -Application Fee Refund objects allow you to refund an application - * fee that has previously been created but not yet refunded. Funds will be - * refunded to the Stripe account from which the fee was originally collected. - * - * Related guide: Refunding - * Application Fees. - * - * @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 $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ -class ApplicationFeeRefund extends ApiResource -{ - const OBJECT_NAME = 'fee_refund'; - - use ApiOperations\Update { - save as protected _save; - } - - /** - * @return string the API URL for this Stripe refund - */ - public function instanceUrl() - { - $id = $this['id']; - $fee = $this['fee']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $fee = Util\Util::utf8($fee); - - $base = ApplicationFee::classUrl(); - $feeExtn = \urlencode($fee); - $extn = \urlencode($id); - - return "{$base}/{$feeExtn}/refunds/{$extn}"; - } - - /** - * @param null|array|string $opts - * - * @return ApplicationFeeRefund the saved refund - */ - public function save($opts = null) - { - return $this->_save($opts); - } -} +Application Fee Refund objects allow you to refund an application + * fee that has previously been created but not yet refunded. Funds will be + * refunded to the Stripe account from which the fee was originally collected. + * + * Related guide: Refunding + * Application Fees. + * + * @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 $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class ApplicationFeeRefund extends ApiResource +{ + const OBJECT_NAME = 'fee_refund'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe refund + */ + public function instanceUrl() + { + $id = $this['id']; + $fee = $this['fee']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $fee = Util\Util::utf8($fee); + + $base = ApplicationFee::classUrl(); + $feeExtn = \urlencode($fee); + $extn = \urlencode($id); + + return "{$base}/{$feeExtn}/refunds/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @return ApplicationFeeRefund the saved refund + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Balance.php b/vendor/stripe/stripe-php/lib/Balance.php index 0fdc285..efc815c 100644 --- a/vendor/stripe/stripe-php/lib/Balance.php +++ b/vendor/stripe/stripe-php/lib/Balance.php @@ -1,45 +1,45 @@ -transactions - * that contributed to the balance (charges, payouts, and so forth). - * - * The available and pending amounts for each currency are broken down further by - * payment source types. - * - * Related guide: Understanding Connect - * Account Balances. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. - * @property \Stripe\StripeObject $issuing - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. - */ -class Balance extends SingletonApiResource -{ - const OBJECT_NAME = 'balance'; - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Balance - */ - public static function retrieve($opts = null) - { - return self::_singletonRetrieve($opts); - } -} +transactions + * that contributed to the balance (charges, payouts, and so forth). + * + * The available and pending amounts for each currency are broken down further by + * payment source types. + * + * Related guide: Understanding Connect + * Account Balances. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property \Stripe\StripeObject $issuing + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. + */ +class Balance extends SingletonApiResource +{ + const OBJECT_NAME = 'balance'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public static function retrieve($opts = null) + { + return self::_singletonRetrieve($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/BalanceTransaction.php b/vendor/stripe/stripe-php/lib/BalanceTransaction.php index d7ddea4..29246ae 100644 --- a/vendor/stripe/stripe-php/lib/BalanceTransaction.php +++ b/vendor/stripe/stripe-php/lib/BalanceTransaction.php @@ -1,71 +1,71 @@ -Balance - * Transaction Types. - * - * @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 $amount Gross amount of the transaction, in %s. - * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. - * @property int $fee Fees (in %s) paid for this transaction. - * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in %s) paid for this transaction. - * @property int $net Net amount of the transaction, in %s. - * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. - * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. - * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. - * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, payment, payment_failure_refund, payment_refund, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. - */ -class BalanceTransaction extends ApiResource -{ - const OBJECT_NAME = 'balance_transaction'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - const TYPE_ADJUSTMENT = 'adjustment'; - const TYPE_ADVANCE = 'advance'; - const TYPE_ADVANCE_FUNDING = 'advance_funding'; - const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment'; - const TYPE_APPLICATION_FEE = 'application_fee'; - const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund'; - const TYPE_CHARGE = 'charge'; - const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer'; - const TYPE_CONTRIBUTION = 'contribution'; - const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; - const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; - const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; - const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; - const TYPE_PAYMENT = 'payment'; - const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; - const TYPE_PAYMENT_REFUND = 'payment_refund'; - const TYPE_PAYOUT = 'payout'; - const TYPE_PAYOUT_CANCEL = 'payout_cancel'; - 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_STRIPE_FEE = 'stripe_fee'; - const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; - const TYPE_TAX_FEE = 'tax_fee'; - const TYPE_TOPUP = 'topup'; - const TYPE_TOPUP_REVERSAL = 'topup_reversal'; - const TYPE_TRANSFER = 'transfer'; - const TYPE_TRANSFER_CANCEL = 'transfer_cancel'; - const TYPE_TRANSFER_FAILURE = 'transfer_failure'; - const TYPE_TRANSFER_REFUND = 'transfer_refund'; -} +Balance + * Transaction Types. + * + * @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 $amount Gross amount of the transaction, in %s. + * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. + * @property int $fee Fees (in %s) paid for this transaction. + * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in %s) paid for this transaction. + * @property int $net Net amount of the transaction, in %s. + * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. + * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. + * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, payment, payment_failure_refund, payment_refund, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. + */ +class BalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'balance_transaction'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_ADVANCE = 'advance'; + const TYPE_ADVANCE_FUNDING = 'advance_funding'; + const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment'; + const TYPE_APPLICATION_FEE = 'application_fee'; + const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund'; + const TYPE_CHARGE = 'charge'; + const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer'; + const TYPE_CONTRIBUTION = 'contribution'; + const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; + const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; + const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; + const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; + const TYPE_PAYMENT = 'payment'; + const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; + const TYPE_PAYMENT_REFUND = 'payment_refund'; + const TYPE_PAYOUT = 'payout'; + const TYPE_PAYOUT_CANCEL = 'payout_cancel'; + 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_STRIPE_FEE = 'stripe_fee'; + const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; + const TYPE_TAX_FEE = 'tax_fee'; + const TYPE_TOPUP = 'topup'; + const TYPE_TOPUP_REVERSAL = 'topup_reversal'; + const TYPE_TRANSFER = 'transfer'; + const TYPE_TRANSFER_CANCEL = 'transfer_cancel'; + const TYPE_TRANSFER_FAILURE = 'transfer_failure'; + const TYPE_TRANSFER_REFUND = 'transfer_refund'; +} diff --git a/vendor/stripe/stripe-php/lib/BankAccount.php b/vendor/stripe/stripe-php/lib/BankAccount.php index 40eca41..bd11b01 100644 --- a/vendor/stripe/stripe-php/lib/BankAccount.php +++ b/vendor/stripe/stripe-php/lib/BankAccount.php @@ -1,132 +1,133 @@ -Customer objects. - * - * On the other hand External Accounts are - * transfer destinations on Account objects for Custom accounts. They - * can be bank accounts or debit cards as well, and are documented in the links - * above. - * - * Related guide: Bank Debits and - * Transfers. - * - * @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 null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. - * @property null|string $account_holder_name The name of the person or business that owns the bank account. - * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. - * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. - * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). - * @property string $country Two-letter ISO code representing the country the bank account is located in. - * @property string $currency Three-letter ISO code for the currency paid out to the bank account. - * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. - * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. - * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. - * @property string $last4 The last four digits of the bank account number. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $routing_number The routing transit number for the bank account. - * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a transfer sent to this bank account fails, we'll set the status to errored and will not continue to send transfers until the bank details are updated.

For external accounts, possible values are new and errored. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

- */ -class BankAccount extends ApiResource -{ - const OBJECT_NAME = 'bank_account'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - /** - * Possible string representations of the bank verification status. - * - * @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status - */ - const STATUS_NEW = 'new'; - const STATUS_VALIDATED = 'validated'; - const STATUS_VERIFIED = 'verified'; - const STATUS_VERIFICATION_FAILED = 'verification_failed'; - const STATUS_ERRORED = 'errored'; - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - } elseif ($this['account']) { - $base = Account::classUrl(); - $parent = $this['account']; - $path = 'external_accounts'; - } else { - $msg = 'Bank accounts cannot be accessed without a customer ID or account ID.'; - - throw new Exception\UnexpectedValueException($msg, null); - } - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . - 'an account ID. Retrieve a bank account using ' . - "`Customer::retrieveSource('customer_id', " . - "'bank_account_id')` or `Account::retrieveExternalAccount(" . - "'account_id', 'bank_account_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Bank accounts cannot be updated without a customer ID or an ' . - 'account ID. Update a bank account using ' . - "`Customer::updateSource('customer_id', 'bank_account_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'bank_account_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return BankAccount the verified bank account - */ - public function verify($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Customer objects. + * + * On the other hand External Accounts are + * transfer destinations on Account objects for Custom accounts. They + * can be bank accounts or debit cards as well, and are documented in the links + * above. + * + * Related guide: Bank Debits and + * Transfers. + * + * @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 null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. + * @property null|string $account_holder_name The name of the person or business that owns the bank account. + * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. + * @property null|string $account_type The bank account type. This can only be checking or savings in most countries. In Japan, this can only be futsu or toza. + * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. + * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). + * @property string $country Two-letter ISO code representing the country the bank account is located in. + * @property string $currency Three-letter ISO code for the currency paid out to the bank account. + * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. + * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. + * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + * @property string $last4 The last four digits of the bank account number. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $routing_number The routing transit number for the bank account. + * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a transfer sent to this bank account fails, we'll set the status to errored and will not continue to send transfers until the bank details are updated.

For external accounts, possible values are new and errored. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

+ */ +class BankAccount extends ApiResource +{ + const OBJECT_NAME = 'bank_account'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the bank verification status. + * + * @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status + */ + const STATUS_NEW = 'new'; + const STATUS_VALIDATED = 'validated'; + const STATUS_VERIFIED = 'verified'; + const STATUS_VERIFICATION_FAILED = 'verification_failed'; + const STATUS_ERRORED = 'errored'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } else { + $msg = 'Bank accounts cannot be accessed without a customer ID or account ID.'; + + throw new Exception\UnexpectedValueException($msg, null); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . + 'an account ID. Retrieve a bank account using ' . + "`Customer::retrieveSource('customer_id', " . + "'bank_account_id')` or `Account::retrieveExternalAccount(" . + "'account_id', 'bank_account_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Bank accounts cannot be updated without a customer ID or an ' . + 'account ID. Update a bank account using ' . + "`Customer::updateSource('customer_id', 'bank_account_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'bank_account_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return BankAccount the verified bank account + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/BaseStripeClient.php b/vendor/stripe/stripe-php/lib/BaseStripeClient.php index 5499fe3..f4de154 100644 --- a/vendor/stripe/stripe-php/lib/BaseStripeClient.php +++ b/vendor/stripe/stripe-php/lib/BaseStripeClient.php @@ -1,269 +1,312 @@ - */ - private $config; - - /** @var \Stripe\Util\RequestOptions */ - private $defaultOpts; - - /** - * Initializes a new instance of the {@link BaseStripeClient} class. - * - * The constructor takes a single argument. The argument can be a string, in which case it - * should be the API key. It can also be an array with various configuration settings. - * - * Configuration settings include the following options: - * - * - api_key (null|string): the Stripe API key, to be used in regular API requests. - * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. - * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client - * will automatically use the {@code Stripe-Account} header with that account ID. - * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client - * will include the {@code Stripe-Version} header with that API version. - * - * The following configuration settings are also available, though setting these should rarely be necessary - * (only useful if you want to send requests to a mock server like stripe-mock): - * - * - api_base (string): the base URL for regular API requests. Defaults to - * {@link DEFAULT_API_BASE}. - * - connect_base (string): the base URL for OAuth requests. Defaults to - * {@link DEFAULT_CONNECT_BASE}. - * - files_base (string): the base URL for file creation requests. Defaults to - * {@link DEFAULT_FILES_BASE}. - * - * @param array|string $config the API key as a string, or an array containing - * the client configuration settings - */ - public function __construct($config = []) - { - if (\is_string($config)) { - $config = ['api_key' => $config]; - } elseif (!\is_array($config)) { - throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); - } - - $config = \array_merge($this->getDefaultConfig(), $config); - $this->validateConfig($config); - - $this->config = $config; - - $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ - 'stripe_account' => $config['stripe_account'], - 'stripe_version' => $config['stripe_version'], - ]); - } - - /** - * Gets the API key used by the client to send requests. - * - * @return null|string the API key used by the client to send requests - */ - public function getApiKey() - { - return $this->config['api_key']; - } - - /** - * Gets the client ID used by the client in OAuth requests. - * - * @return null|string the client ID used by the client in OAuth requests - */ - public function getClientId() - { - return $this->config['client_id']; - } - - /** - * Gets the base URL for Stripe's API. - * - * @return string the base URL for Stripe's API - */ - public function getApiBase() - { - return $this->config['api_base']; - } - - /** - * Gets the base URL for Stripe's OAuth API. - * - * @return string the base URL for Stripe's OAuth API - */ - public function getConnectBase() - { - return $this->config['connect_base']; - } - - /** - * Gets the base URL for Stripe's Files API. - * - * @return string the base URL for Stripe's Files API - */ - public function getFilesBase() - { - return $this->config['files_base']; - } - - /** - * Sends a request to Stripe's API. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @return \Stripe\StripeObject the object returned by Stripe's API - */ - public function request($method, $path, $params, $opts) - { - $opts = $this->defaultOpts->merge($opts, true); - $baseUrl = $opts->apiBase ?: $this->getApiBase(); - $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); - list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); - $opts->discardNonPersistentHeaders(); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * Sends a request to Stripe's API. - * - * @param string $method the HTTP method - * @param string $path the path of the request - * @param array $params the parameters of the request - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @return \Stripe\Collection of ApiResources - */ - public function requestCollection($method, $path, $params, $opts) - { - $obj = $this->request($method, $path, $params, $opts); - if (!($obj instanceof \Stripe\Collection)) { - $received_class = \get_class($obj); - $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; - - throw new \Stripe\Exception\UnexpectedValueException($msg); - } - $obj->setFilters($params); - - return $obj; - } - - /** - * @param \Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\AuthenticationException - * - * @return string - */ - private function apiKeyForRequest($opts) - { - $apiKey = $opts->apiKey ?: $this->getApiKey(); - - if (null === $apiKey) { - $msg = 'No API key provided. Set your API key when constructing the ' - . 'StripeClient instance, or provide it on a per-request basis ' - . 'using the `api_key` key in the $opts argument.'; - - throw new \Stripe\Exception\AuthenticationException($msg); - } - - return $apiKey; - } - - /** - * TODO: replace this with a private constant when we drop support for PHP < 5. - * - * @return array - */ - 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 $config - * - * @throws \Stripe\Exception\InvalidArgumentException - */ - private function validateConfig($config) - { - // api_key - if (null !== $config['api_key'] && !\is_string($config['api_key'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); - } - - if (null !== $config['api_key'] && ('' === $config['api_key'])) { - $msg = 'api_key cannot be the empty string'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - - if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { - $msg = 'api_key cannot contain whitespace'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - - // client_id - if (null !== $config['client_id'] && !\is_string($config['client_id'])) { - throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); - } - - // stripe_account - if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); - } - - // stripe_version - if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); - } - - // api_base - if (!\is_string($config['api_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); - } - - // connect_base - if (!\is_string($config['connect_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); - } - - // files_base - if (!\is_string($config['files_base'])) { - throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); - } - - // check absence of extra keys - $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); - if (!empty($extraConfigKeys)) { - // Wrap in single quote to more easily catch trailing spaces errors - $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; - - throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); - } - } -} + */ + private $config; + + /** @var \Stripe\Util\RequestOptions */ + private $defaultOpts; + + /** + * Initializes a new instance of the {@link BaseStripeClient} class. + * + * The constructor takes a single argument. The argument can be a string, in which case it + * should be the API key. It can also be an array with various configuration settings. + * + * Configuration settings include the following options: + * + * - api_key (null|string): the Stripe API key, to be used in regular API requests. + * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. + * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client + * will automatically use the {@code Stripe-Account} header with that account ID. + * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client + * will include the {@code Stripe-Version} header with that API version. + * + * The following configuration settings are also available, though setting these should rarely be necessary + * (only useful if you want to send requests to a mock server like stripe-mock): + * + * - api_base (string): the base URL for regular API requests. Defaults to + * {@link DEFAULT_API_BASE}. + * - connect_base (string): the base URL for OAuth requests. Defaults to + * {@link DEFAULT_CONNECT_BASE}. + * - files_base (string): the base URL for file creation requests. Defaults to + * {@link DEFAULT_FILES_BASE}. + * + * @param array|string $config the API key as a string, or an array containing + * the client configuration settings + */ + public function __construct($config = []) + { + if (\is_string($config)) { + $config = ['api_key' => $config]; + } elseif (!\is_array($config)) { + throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); + } + + $config = \array_merge($this->getDefaultConfig(), $config); + $this->validateConfig($config); + + $this->config = $config; + + $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ + 'stripe_account' => $config['stripe_account'], + 'stripe_version' => $config['stripe_version'], + ]); + } + + /** + * Gets the API key used by the client to send requests. + * + * @return null|string the API key used by the client to send requests + */ + public function getApiKey() + { + return $this->config['api_key']; + } + + /** + * Gets the client ID used by the client in OAuth requests. + * + * @return null|string the client ID used by the client in OAuth requests + */ + public function getClientId() + { + return $this->config['client_id']; + } + + /** + * Gets the base URL for Stripe's API. + * + * @return string the base URL for Stripe's API + */ + public function getApiBase() + { + return $this->config['api_base']; + } + + /** + * Gets the base URL for Stripe's OAuth API. + * + * @return string the base URL for Stripe's OAuth API + */ + public function getConnectBase() + { + return $this->config['connect_base']; + } + + /** + * Gets the base URL for Stripe's Files API. + * + * @return string the base URL for Stripe's Files API + */ + public function getFilesBase() + { + return $this->config['files_base']; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\StripeObject the object returned by Stripe's API + */ + public function request($method, $path, $params, $opts) + { + $opts = $this->defaultOpts->merge($opts, true); + $baseUrl = $opts->apiBase ?: $this->getApiBase(); + $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * Sends a request to Stripe's API, passing chunks of the streamed response + * into a user-provided $readBodyChunkCallable callback. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param callable $readBodyChunkCallable a function that will be called + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * with chunks of bytes from the body if the request is successful + */ + public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) + { + $opts = $this->defaultOpts->merge($opts, true); + $baseUrl = $opts->apiBase ?: $this->getApiBase(); + $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers); + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\Collection of ApiResources + */ + public function requestCollection($method, $path, $params, $opts) + { + $obj = $this->request($method, $path, $params, $opts); + if (!($obj instanceof \Stripe\Collection)) { + $received_class = \get_class($obj); + $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; + + throw new \Stripe\Exception\UnexpectedValueException($msg); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\SearchResult of ApiResources + */ + public function requestSearchResult($method, $path, $params, $opts) + { + $obj = $this->request($method, $path, $params, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + $received_class = \get_class($obj); + $msg = "Expected to receive `Stripe\\SearchResult` object from Stripe API. Instead received `{$received_class}`."; + + throw new \Stripe\Exception\UnexpectedValueException($msg); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\AuthenticationException + * + * @return string + */ + private function apiKeyForRequest($opts) + { + $apiKey = $opts->apiKey ?: $this->getApiKey(); + + if (null === $apiKey) { + $msg = 'No API key provided. Set your API key when constructing the ' + . 'StripeClient instance, or provide it on a per-request basis ' + . 'using the `api_key` key in the $opts argument.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $apiKey; + } + + /** + * TODO: replace this with a private constant when we drop support for PHP < 5. + * + * @return array + */ + 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 $config + * + * @throws \Stripe\Exception\InvalidArgumentException + */ + private function validateConfig($config) + { + // api_key + if (null !== $config['api_key'] && !\is_string($config['api_key'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); + } + + if (null !== $config['api_key'] && ('' === $config['api_key'])) { + $msg = 'api_key cannot be the empty string'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { + $msg = 'api_key cannot contain whitespace'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + // client_id + if (null !== $config['client_id'] && !\is_string($config['client_id'])) { + throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); + } + + // stripe_account + if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); + } + + // stripe_version + if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); + } + + // api_base + if (!\is_string($config['api_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); + } + + // connect_base + if (!\is_string($config['connect_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); + } + + // files_base + if (!\is_string($config['files_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); + } + + // check absence of extra keys + $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); + if (!empty($extraConfigKeys)) { + // Wrap in single quote to more easily catch trailing spaces errors + $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; + + throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); + } + } +} diff --git a/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php b/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php new file mode 100644 index 0000000..c0751c0 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/BaseStripeClientInterface.php @@ -0,0 +1,44 @@ +overriden when creating the session. - * @property \Stripe\StripeObject $features - * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ -class Configuration extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'billing_portal.configuration'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +overriden when creating the session. + * @property \Stripe\StripeObject $features + * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/BillingPortal/Session.php b/vendor/stripe/stripe-php/lib/BillingPortal/Session.php index ea11d51..3ac636d 100644 --- a/vendor/stripe/stripe-php/lib/BillingPortal/Session.php +++ b/vendor/stripe/stripe-php/lib/BillingPortal/Session.php @@ -1,42 +1,41 @@ -product - * overview and integration - * guide. - * - * @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 string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $customer The ID of the customer for this session. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. - * @property string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. - * @property string $url The short-lived URL of the session that gives customers access to the customer portal. - */ -class Session extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'billing_portal.session'; - - use \Stripe\ApiOperations\Create; -} +integration + * guide. + * + * @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 string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $customer The ID of the customer for this session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used. + * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. + * @property string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. + * @property string $url The short-lived URL of the session that gives customers access to the customer portal. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.session'; + + use \Stripe\ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/BitcoinReceiver.php b/vendor/stripe/stripe-php/lib/BitcoinReceiver.php index 208610a..ee89485 100644 --- a/vendor/stripe/stripe-php/lib/BitcoinReceiver.php +++ b/vendor/stripe/stripe-php/lib/BitcoinReceiver.php @@ -1,71 +1,71 @@ -currency that you are collecting as payment. - * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. - * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. - * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. - * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. - * @property null|string $customer The customer ID of the bitcoin receiver. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email The customer's email address, set by the API call that creates the receiver. - * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. - * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. - * @property null|string $refund_address The refund address of this bitcoin receiver. - * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. - * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. - * @property null|bool $used_for_payment Indicate if this source is used for payment. - */ -class BitcoinReceiver extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_receiver'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * @return string The class URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public static function classUrl() - { - return '/v1/bitcoin/receivers'; - } - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - $base = BitcoinReceiver::classUrl(); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$extn}"; - } -} +currency that you are collecting as payment. + * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. + * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. + * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. + * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. + * @property null|string $customer The customer ID of the bitcoin receiver. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email The customer's email address, set by the API call that creates the receiver. + * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. + * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. + * @property null|string $refund_address The refund address of this bitcoin receiver. + * @property \Stripe\Collection<\Stripe\BitcoinTransaction> $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. + * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. + * @property null|bool $used_for_payment Indicate if this source is used for payment. + */ +class BitcoinReceiver extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_receiver'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/bitcoin/receivers'; + } + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + $base = BitcoinReceiver::classUrl(); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$extn}"; + } +} diff --git a/vendor/stripe/stripe-php/lib/BitcoinTransaction.php b/vendor/stripe/stripe-php/lib/BitcoinTransaction.php index 3aa7118..35e3624 100644 --- a/vendor/stripe/stripe-php/lib/BitcoinTransaction.php +++ b/vendor/stripe/stripe-php/lib/BitcoinTransaction.php @@ -1,19 +1,19 @@ -currency that the transaction was converted to in real-time. - * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. - * @property string $receiver The receiver to which this transaction was sent. - */ -class BitcoinTransaction extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_transaction'; -} +currency that the transaction was converted to in real-time. + * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. + * @property string $receiver The receiver to which this transaction was sent. + */ +class BitcoinTransaction extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_transaction'; +} diff --git a/vendor/stripe/stripe-php/lib/Capability.php b/vendor/stripe/stripe-php/lib/Capability.php index 3580df6..1dc796d 100644 --- a/vendor/stripe/stripe-php/lib/Capability.php +++ b/vendor/stripe/stripe-php/lib/Capability.php @@ -1,87 +1,88 @@ -Account - * capabilities. - * - * @property string $id The identifier for the capability. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string|\Stripe\Account $account The account for which the capability enables functionality. - * @property bool $requested Whether the capability has been requested. - * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $requirements - * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. - */ -class Capability extends ApiResource -{ - const OBJECT_NAME = 'capability'; - - use ApiOperations\Update; - - const STATUS_ACTIVE = 'active'; - const STATUS_INACTIVE = 'inactive'; - const STATUS_PENDING = 'pending'; - const STATUS_UNREQUESTED = 'unrequested'; - - /** - * @return string the API URL for this Stripe account reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $account = $this['account']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $account = Util\Util::utf8($account); - - $base = Account::classUrl(); - $accountExtn = \urlencode($account); - $extn = \urlencode($id); - - return "{$base}/{$accountExtn}/capabilities/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Capabilities cannot be retrieved without an account ID. ' . - 'Retrieve a capability using `Account::retrieveCapability(' . - "'account_id', 'capability_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Capabilities cannot be updated without an account ID. ' . - 'Update a capability using `Account::updateCapability(' . - "'account_id', 'capability_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} +Account + * capabilities. + * + * @property string $id The identifier for the capability. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\Account $account The account for which the capability enables functionality. + * @property \Stripe\StripeObject $future_requirements + * @property bool $requested Whether the capability has been requested. + * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $requirements + * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. + */ +class Capability extends ApiResource +{ + const OBJECT_NAME = 'capability'; + + use ApiOperations\Update; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_PENDING = 'pending'; + const STATUS_UNREQUESTED = 'unrequested'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/capabilities/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Capabilities cannot be retrieved without an account ID. ' . + 'Retrieve a capability using `Account::retrieveCapability(' . + "'account_id', 'capability_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Capabilities cannot be updated without an account ID. ' . + 'Update a capability using `Account::updateCapability(' . + "'account_id', 'capability_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Card.php b/vendor/stripe/stripe-php/lib/Card.php index 7f757d6..8a229e5 100644 --- a/vendor/stripe/stripe-php/lib/Card.php +++ b/vendor/stripe/stripe-php/lib/Card.php @@ -1,142 +1,143 @@ -Card Payments - * with Sources. - * - * @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 null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. - * @property null|string $address_city City/District/Suburb/Town/Village. - * @property null|string $address_country Billing address country, if provided when creating card. - * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). - * @property null|string $address_line1_check If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. - * @property null|string $address_line2 Address line 2 (Apartment/Suite/Unit/Building). - * @property null|string $address_state State/County/Province/Region. - * @property null|string $address_zip ZIP or postal code. - * @property null|string $address_zip_check If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked. - * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. - * @property string $brand Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown. - * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. - * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. - * @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: pass, fail, unavailable, or unchecked. 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 Check if a card is valid without a charge. - * @property null|bool $default_for_currency Whether this card is the default external account for its currency. - * @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

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.

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.

- * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. - * @property string $last4 The last four digits of the card. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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. - * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. - * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. - */ -class Card extends ApiResource -{ - const OBJECT_NAME = 'card'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - /** - * Possible string representations of the CVC check status. - * - * @see https://stripe.com/docs/api/cards/object#card_object-cvc_check - */ - const CVC_CHECK_FAIL = 'fail'; - const CVC_CHECK_PASS = 'pass'; - const CVC_CHECK_UNAVAILABLE = 'unavailable'; - const CVC_CHECK_UNCHECKED = 'unchecked'; - - /** - * Possible string representations of the funding of the card. - * - * @see https://stripe.com/docs/api/cards/object#card_object-funding - */ - const FUNDING_CREDIT = 'credit'; - const FUNDING_DEBIT = 'debit'; - const FUNDING_PREPAID = 'prepaid'; - const FUNDING_UNKNOWN = 'unknown'; - - /** - * Possible string representations of the tokenization method when using Apple Pay or Google Pay. - * - * @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method - */ - const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay'; - const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay'; - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because cards are nested resources that may belong to different - * top-level resources. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - } elseif ($this['account']) { - $base = Account::classUrl(); - $parent = $this['account']; - $path = 'external_accounts'; - } elseif ($this['recipient']) { - $base = Recipient::classUrl(); - $parent = $this['recipient']; - $path = 'cards'; - } else { - $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; - - throw new Exception\UnexpectedValueException($msg); - } - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Cards cannot be retrieved without a customer ID or an ' . - 'account ID. Retrieve a card using ' . - "`Customer::retrieveSource('customer_id', 'card_id')` or " . - "`Account::retrieveExternalAccount('account_id', 'card_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Cards cannot be updated without a customer ID or an ' . - 'account ID. Update a card using ' . - "`Customer::updateSource('customer_id', 'card_id', " . - '$updateParams)` or `Account::updateExternalAccount(' . - "'account_id', 'card_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} +Card Payments + * with Sources. + * + * @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 null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. + * @property null|string $address_city City/District/Suburb/Town/Village. + * @property null|string $address_country Billing address country, if provided when creating card. + * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). + * @property null|string $address_line1_check If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string $address_line2 Address line 2 (Apartment/Suite/Unit/Building). + * @property null|string $address_state State/County/Province/Region. + * @property null|string $address_zip ZIP or postal code. + * @property null|string $address_zip_check If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. + * @property string $brand Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown. + * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. + * @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: pass, fail, unavailable, or unchecked. 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 Check if a card is valid without a charge. + * @property null|bool $default_for_currency Whether this card is the default external account for its currency. + * @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

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.

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.

+ * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. + * @property string $last4 The last four digits of the card. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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. + * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. + * @property null|string $status For external accounts, possible values are new and errored. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated. + * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. + */ +class Card extends ApiResource +{ + const OBJECT_NAME = 'card'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the CVC check status. + * + * @see https://stripe.com/docs/api/cards/object#card_object-cvc_check + */ + const CVC_CHECK_FAIL = 'fail'; + const CVC_CHECK_PASS = 'pass'; + const CVC_CHECK_UNAVAILABLE = 'unavailable'; + const CVC_CHECK_UNCHECKED = 'unchecked'; + + /** + * Possible string representations of the funding of the card. + * + * @see https://stripe.com/docs/api/cards/object#card_object-funding + */ + const FUNDING_CREDIT = 'credit'; + const FUNDING_DEBIT = 'debit'; + const FUNDING_PREPAID = 'prepaid'; + const FUNDING_UNKNOWN = 'unknown'; + + /** + * Possible string representations of the tokenization method when using Apple Pay or Google Pay. + * + * @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method + */ + const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay'; + const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because cards are nested resources that may belong to different + * top-level resources. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } elseif ($this['recipient']) { + $base = Recipient::classUrl(); + $parent = $this['recipient']; + $path = 'cards'; + } else { + $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; + + throw new Exception\UnexpectedValueException($msg); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Cards cannot be retrieved without a customer ID or an ' . + 'account ID. Retrieve a card using ' . + "`Customer::retrieveSource('customer_id', 'card_id')` or " . + "`Account::retrieveExternalAccount('account_id', 'card_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Cards cannot be updated without a customer ID or an ' . + 'account ID. Update a card using ' . + "`Customer::updateSource('customer_id', 'card_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'card_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/CashBalance.php b/vendor/stripe/stripe-php/lib/CashBalance.php new file mode 100644 index 0000000..2072e78 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/CashBalance.php @@ -0,0 +1,66 @@ +Cash balance represents real funds. Customers can add + * funds to their cash balance by sending a bank transfer. These funds can be used + * for payment and can eventually be paid out to your bank account. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. + * @property string $customer The ID of the customer whose cash balance this object represents. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $settings + */ +class CashBalance extends ApiResource +{ + const OBJECT_NAME = 'cash_balance'; + + /** + * @return string the API URL for this balance transaction + */ + public function instanceUrl() + { + $customer = $this['customer']; + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + + return "{$base}/{$customerExtn}/cash_balance"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Customer Cash Balance cannot be retrieved without a ' . + 'customer ID. Retrieve a Customer Cash Balance using ' . + "`Customer::retrieveCashBalance('customer_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Customer Cash Balance cannot be updated without a ' . + 'customer ID. Retrieve a Customer Cash Balance using ' . + "`Customer::updateCashBalance('customer_id')`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Charge.php b/vendor/stripe/stripe-php/lib/Charge.php index b9fc301..9c46b03 100644 --- a/vendor/stripe/stripe-php/lib/Charge.php +++ b/vendor/stripe/stripe-php/lib/Charge.php @@ -1,146 +1,163 @@ -Charge object. You - * can retrieve and refund individual charges as well as list all charges. Charges - * are identified by a unique, random ID. - * - * Related guide: Accept a - * payment with the Charges API. - * - * @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 $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). - * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. - * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. - * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). - * @property \Stripe\StripeObject $billing_details - * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. - * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. - * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. - * @property bool $disputed Whether the charge has been disputed. - * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). - * @property null|string $failure_message Message to user further explaining reason for charge failure if available. - * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. - * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. - * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. - * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. - * @property null|string $payment_method ID of the payment method used in this charge. - * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. - * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. - * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. - * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge. - * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. - * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. - * @property null|\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 contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. - * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. - * @property null|string $statement_descriptor_suffix Provides information about the charge 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 The status of the payment is either succeeded, pending, or failed. - * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). - * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. - * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. - */ -class Charge extends ApiResource -{ - const OBJECT_NAME = 'charge'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * Possible string representations of decline codes. - * These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception. - * - * @see https://stripe.com/docs/declines/codes - */ - const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required'; - const DECLINED_APPROVE_WITH_ID = 'approve_with_id'; - const DECLINED_CALL_ISSUER = 'call_issuer'; - const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported'; - const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded'; - const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported'; - const DECLINED_DO_NOT_HONOR = 'do_not_honor'; - const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again'; - const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction'; - const DECLINED_EXPIRED_CARD = 'expired_card'; - const DECLINED_FRAUDULENT = 'fraudulent'; - const DECLINED_GENERIC_DECLINE = 'generic_decline'; - const DECLINED_INCORRECT_NUMBER = 'incorrect_number'; - const DECLINED_INCORRECT_CVC = 'incorrect_cvc'; - const DECLINED_INCORRECT_PIN = 'incorrect_pin'; - const DECLINED_INCORRECT_ZIP = 'incorrect_zip'; - const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const DECLINED_INVALID_ACCOUNT = 'invalid_account'; - const DECLINED_INVALID_AMOUNT = 'invalid_amount'; - const DECLINED_INVALID_CVC = 'invalid_cvc'; - const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year'; - const DECLINED_INVALID_NUMBER = 'invalid_number'; - const DECLINED_INVALID_PIN = 'invalid_pin'; - const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available'; - const DECLINED_LOST_CARD = 'lost_card'; - const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist'; - const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available'; - const DECLINED_NO_ACTION_TAKEN = 'no_action_taken'; - const DECLINED_NOT_PERMITTED = 'not_permitted'; - const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required'; - const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required'; - const DECLINED_PICKUP_CARD = 'pickup_card'; - const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded'; - const DECLINED_PROCESSING_ERROR = 'processing_error'; - const DECLINED_REENTER_TRANSACTION = 'reenter_transaction'; - const DECLINED_RESTRICTED_CARD = 'restricted_card'; - const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations'; - const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization'; - const DECLINED_SECURITY_VIOLATION = 'security_violation'; - const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed'; - const DECLINED_STOLEN_CARD = 'stolen_card'; - const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order'; - const DECLINED_TESTMODE_DECLINE = 'testmode_decline'; - const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed'; - const DECLINED_TRY_AGAIN_LATER = 'try_again_later'; - const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge the captured charge - */ - public function capture($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/capture'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Charge object. You + * can retrieve and refund individual charges as well as list all charges. Charges + * are identified by a unique, random ID. + * + * Related guide: Accept a + * payment with the Charges API. + * + * @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 $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). + * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. + * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. + * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + * @property \Stripe\StripeObject $billing_details + * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. + * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. + * @property bool $disputed Whether the charge has been disputed. + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for charge failure if available. + * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. + * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. + * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. + * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. + * @property null|string $payment_method ID of the payment method used in this charge. + * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. + * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. + * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. + * @property \Stripe\Collection<\Stripe\Refund> $refunds A list of refunds that have been applied to the charge. + * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. + * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. + * @property null|\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 contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. + * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. + * @property null|string $statement_descriptor_suffix Provides information about the charge 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 The status of the payment is either succeeded, pending, or failed. + * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). + * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Charge extends ApiResource +{ + const OBJECT_NAME = 'charge'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * Possible string representations of decline codes. + * These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception. + * + * @see https://stripe.com/docs/declines/codes + */ + const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required'; + const DECLINED_APPROVE_WITH_ID = 'approve_with_id'; + const DECLINED_CALL_ISSUER = 'call_issuer'; + const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported'; + const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded'; + const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported'; + const DECLINED_DO_NOT_HONOR = 'do_not_honor'; + const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again'; + const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction'; + const DECLINED_EXPIRED_CARD = 'expired_card'; + const DECLINED_FRAUDULENT = 'fraudulent'; + const DECLINED_GENERIC_DECLINE = 'generic_decline'; + const DECLINED_INCORRECT_NUMBER = 'incorrect_number'; + const DECLINED_INCORRECT_CVC = 'incorrect_cvc'; + const DECLINED_INCORRECT_PIN = 'incorrect_pin'; + const DECLINED_INCORRECT_ZIP = 'incorrect_zip'; + const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const DECLINED_INVALID_ACCOUNT = 'invalid_account'; + const DECLINED_INVALID_AMOUNT = 'invalid_amount'; + const DECLINED_INVALID_CVC = 'invalid_cvc'; + const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year'; + const DECLINED_INVALID_NUMBER = 'invalid_number'; + const DECLINED_INVALID_PIN = 'invalid_pin'; + const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available'; + const DECLINED_LOST_CARD = 'lost_card'; + const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist'; + const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available'; + const DECLINED_NO_ACTION_TAKEN = 'no_action_taken'; + const DECLINED_NOT_PERMITTED = 'not_permitted'; + const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required'; + const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required'; + const DECLINED_PICKUP_CARD = 'pickup_card'; + const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded'; + const DECLINED_PROCESSING_ERROR = 'processing_error'; + const DECLINED_REENTER_TRANSACTION = 'reenter_transaction'; + const DECLINED_RESTRICTED_CARD = 'restricted_card'; + const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations'; + const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization'; + const DECLINED_SECURITY_VIOLATION = 'security_violation'; + const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed'; + const DECLINED_STOLEN_CARD = 'stolen_card'; + const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order'; + const DECLINED_TESTMODE_DECLINE = 'testmode_decline'; + const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed'; + const DECLINED_TRY_AGAIN_LATER = 'try_again_later'; + const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge the captured charge + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the charge search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/charges/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Checkout/Session.php b/vendor/stripe/stripe-php/lib/Checkout/Session.php index 11a6908..ac91bf2 100644 --- a/vendor/stripe/stripe-php/lib/Checkout/Session.php +++ b/vendor/stripe/stripe-php/lib/Checkout/Session.php @@ -1,93 +1,133 @@ -Checkout. We recommend - * creating a new Session each time your customer attempts to pay. - * - * Once payment is successful, the Checkout Session will contain a reference to the - * Customer, and either the - * successful PaymentIntent or an - * active Subscription. - * - * You can create a Checkout Session on your server and pass its ID to the client - * to begin Checkout. - * - * Related guide: Checkout - * Server Quickstart. - * - * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. - * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. - * @property null|int $amount_total Total of all items after discounts and taxes are applied. - * @property \Stripe\StripeObject $automatic_tax - * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. - * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. - * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. - * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. - * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in payment or subscription mode. - * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. - * @property \Stripe\Collection $line_items The line items purchased by the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $mode The mode of the Checkout Session. - * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. - * @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 paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. - * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. - * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. - * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. - * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. - * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. - * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. - * @property \Stripe\StripeObject $tax_id_collection - * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. - * @property null|string $url The URL to the Checkout Session. - */ -class Session extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'checkout.session'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\NestedResource; - use \Stripe\ApiOperations\Retrieve; - - const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; - const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; - - const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; - const PAYMENT_STATUS_PAID = 'paid'; - const PAYMENT_STATUS_UNPAID = 'unpaid'; - - const SUBMIT_TYPE_AUTO = 'auto'; - const SUBMIT_TYPE_BOOK = 'book'; - const SUBMIT_TYPE_DONATE = 'donate'; - const SUBMIT_TYPE_PAY = 'pay'; - - const PATH_LINE_ITEMS = '/line_items'; - - /** - * @param string $id the ID of the session on which to retrieve the items - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of items - */ - public static function allLineItems($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); - } -} +Checkout or Payment Links. We + * recommend creating a new Session each time your customer attempts to pay. + * + * Once payment is successful, the Checkout Session will contain a reference to the + * Customer, and either the + * successful PaymentIntent or an + * active Subscription. + * + * You can create a Checkout Session on your server and pass its ID to the client + * to begin Checkout. + * + * Related guide: Checkout + * Server Quickstart. + * + * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $after_expiration When set, provides configuration for actions to take if this Checkout Session expires. + * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. + * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. + * @property null|int $amount_total Total of all items after discounts and taxes are applied. + * @property \Stripe\StripeObject $automatic_tax + * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. + * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. + * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. + * @property null|\Stripe\StripeObject $consent Results of consent_collection for this session. + * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. + * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. + * @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in payment or subscription mode. + * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. + * @property int $expires_at The timestamp at which the Checkout Session will expire. + * @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $mode The mode of the Checkout Session. + * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. + * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this 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 paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. + * @property \Stripe\StripeObject $phone_number_collection + * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. + * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. + * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. + * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. + * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to this Session. + * @property null|string|\Stripe\ShippingRate $shipping_rate The ID of the ShippingRate for Checkout Sessions in payment mode. + * @property null|string $status The status of the Checkout Session, one of open, complete, or expired. + * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. + * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. + * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. + * @property \Stripe\StripeObject $tax_id_collection + * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'checkout.session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\NestedResource; + use \Stripe\ApiOperations\Retrieve; + + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; + const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + + const CUSTOMER_CREATION_ALWAYS = 'always'; + const CUSTOMER_CREATION_IF_REQUIRED = 'if_required'; + + const MODE_PAYMENT = 'payment'; + const MODE_SETUP = 'setup'; + const MODE_SUBSCRIPTION = 'subscription'; + + const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; + const PAYMENT_STATUS_PAID = 'paid'; + const PAYMENT_STATUS_UNPAID = 'unpaid'; + + const STATUS_COMPLETE = 'complete'; + const STATUS_EXPIRED = 'expired'; + const STATUS_OPEN = 'open'; + + const SUBMIT_TYPE_AUTO = 'auto'; + const SUBMIT_TYPE_BOOK = 'book'; + const SUBMIT_TYPE_DONATE = 'donate'; + const SUBMIT_TYPE_PAY = 'pay'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session the expired session + */ + public function expire($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/expire'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_LINE_ITEMS = '/line_items'; + + /** + * @param string $id the ID of the session on which to retrieve the items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> the list of items + */ + public static function allLineItems($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Collection.php b/vendor/stripe/stripe-php/lib/Collection.php index 899299d..1e832ad 100644 --- a/vendor/stripe/stripe-php/lib/Collection.php +++ b/vendor/stripe/stripe-php/lib/Collection.php @@ -1,281 +1,312 @@ -filters; - } - - /** - * Sets the filters, removing paging options. - * - * @param array $filters the filters - */ - public function setFilters($filters) - { - $this->filters = $filters; - } - - public function offsetGet($k) - { - if (\is_string($k)) { - return parent::offsetGet($k); - } - $msg = "You tried to access the {$k} index, but Collection " . - 'types only support string keys. (HINT: List calls ' . - 'return an object with a `data` (which is the data ' . - "array). You likely want to call ->data[{$k}])"; - - throw new Exception\InvalidArgumentException($msg); - } - - public function all($params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - if (!($obj instanceof \Stripe\Collection)) { - throw new \Stripe\Exception\UnexpectedValueException( - 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' - ); - } - $obj->setFilters($params); - - return $obj; - } - - public function create($params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - list($response, $opts) = $this->_request('post', $url, $params, $opts); - - return Util\Util::convertToStripeObject($response, $opts); - } - - public function retrieve($id, $params = null, $opts = null) - { - self::_validateParams($params); - list($url, $params) = $this->extractPathAndUpdateParams($params); - - $id = Util\Util::utf8($id); - $extn = \urlencode($id); - list($response, $opts) = $this->_request( - 'get', - "{$url}/{$extn}", - $params, - $opts - ); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @return int the number of objects in the current page - */ - public function count() - { - return \count($this->data); - } - - /** - * @return \ArrayIterator an iterator that can be used to iterate - * across objects in the current page - */ - public function getIterator() - { - return new \ArrayIterator($this->data); - } - - /** - * @return \ArrayIterator an iterator that can be used to iterate - * backwards across objects in the current page - */ - public function getReverseIterator() - { - return new \ArrayIterator(\array_reverse($this->data)); - } - - /** - * @return \Generator|StripeObject[] A generator that can be used to - * iterate across all objects across all pages. As page boundaries are - * encountered, the next page will be fetched automatically for - * continued iteration. - */ - public function autoPagingIterator() - { - $page = $this; - - while (true) { - $filters = $this->filters ?: []; - if (\array_key_exists('ending_before', $filters) - && !\array_key_exists('starting_after', $filters)) { - foreach ($page->getReverseIterator() as $item) { - yield $item; - } - $page = $page->previousPage(); - } else { - foreach ($page as $item) { - yield $item; - } - $page = $page->nextPage(); - } - - if ($page->isEmpty()) { - break; - } - } - } - - /** - * Returns an empty collection. This is returned from {@see nextPage()} - * when we know that there isn't a next page in order to replicate the - * behavior of the API when it attempts to return a page beyond the last. - * - * @param null|array|string $opts - * - * @return Collection - */ - public static function emptyCollection($opts = null) - { - return Collection::constructFrom(['data' => []], $opts); - } - - /** - * Returns true if the page object contains no element. - * - * @return bool - */ - public function isEmpty() - { - return empty($this->data); - } - - /** - * Fetches the next page in the resource list (if there is one). - * - * This method will try to respect the limit of the current page. If none - * was given, the default limit will be fetched again. - * - * @param null|array $params - * @param null|array|string $opts - * - * @return Collection - */ - public function nextPage($params = null, $opts = null) - { - if (!$this->has_more) { - return static::emptyCollection($opts); - } - - $lastId = \end($this->data)->id; - - $params = \array_merge( - $this->filters ?: [], - ['starting_after' => $lastId], - $params ?: [] - ); - - return $this->all($params, $opts); - } - - /** - * Fetches the previous page in the resource list (if there is one). - * - * This method will try to respect the limit of the current page. If none - * was given, the default limit will be fetched again. - * - * @param null|array $params - * @param null|array|string $opts - * - * @return Collection - */ - public function previousPage($params = null, $opts = null) - { - if (!$this->has_more) { - return static::emptyCollection($opts); - } - - $firstId = $this->data[0]->id; - - $params = \array_merge( - $this->filters ?: [], - ['ending_before' => $firstId], - $params ?: [] - ); - - return $this->all($params, $opts); - } - - /** - * Gets the first item from the current page. Returns `null` if the current page is empty. - * - * @return null|\Stripe\StripeObject - */ - public function first() - { - return \count($this->data) > 0 ? $this->data[0] : null; - } - - /** - * Gets the last item from the current page. Returns `null` if the current page is empty. - * - * @return null|\Stripe\StripeObject - */ - public function last() - { - return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; - } - - private function extractPathAndUpdateParams($params) - { - $url = \parse_url($this->url); - if (!isset($url['path'])) { - throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); - } - - if (isset($url['query'])) { - // If the URL contains a query param, parse it out into $params so they - // don't interact weirdly with each other. - $query = []; - \parse_str($url['query'], $query); - $params = \array_merge($params ?: [], $query); - } - - return [$url['path'], $params]; - } -} + + * + * @property string $object + * @property string $url + * @property bool $has_more + * @property TStripeObject[] $data + */ +class Collection extends StripeObject implements \Countable, \IteratorAggregate +{ + const OBJECT_NAME = 'list'; + + use ApiOperations\Request; + + /** @var array */ + protected $filters = []; + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * Returns the filters. + * + * @return array the filters + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Sets the filters, removing paging options. + * + * @param array $filters the filters + */ + public function setFilters($filters) + { + $this->filters = $filters; + } + + #[\ReturnTypeWillChange] + public function offsetGet($k) + { + if (\is_string($k)) { + return parent::offsetGet($k); + } + $msg = "You tried to access the {$k} index, but Collection " . + 'types only support string keys. (HINT: List calls ' . + 'return an object with a `data` (which is the data ' . + "array). You likely want to call ->data[{$k}])"; + + throw new Exception\InvalidArgumentException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return Collection + */ + public function all($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return TStripeObject + */ + public function create($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return TStripeObject + */ + public function retrieve($id, $params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + $id = Util\Util::utf8($id); + $extn = \urlencode($id); + list($response, $opts) = $this->_request( + 'get', + "{$url}/{$extn}", + $params, + $opts + ); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @return int the number of objects in the current page + */ + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * across objects in the current page + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * backwards across objects in the current page + */ + public function getReverseIterator() + { + return new \ArrayIterator(\array_reverse($this->data)); + } + + /** + * @return \Generator|TStripeObject[] A generator that can be used to + * iterate across all objects across all pages. As page boundaries are + * encountered, the next page will be fetched automatically for + * continued iteration. + */ + public function autoPagingIterator() + { + $page = $this; + + while (true) { + $filters = $this->filters ?: []; + if (\array_key_exists('ending_before', $filters) + && !\array_key_exists('starting_after', $filters)) { + foreach ($page->getReverseIterator() as $item) { + yield $item; + } + $page = $page->previousPage(); + } else { + foreach ($page as $item) { + yield $item; + } + $page = $page->nextPage(); + } + + if ($page->isEmpty()) { + break; + } + } + } + + /** + * Returns an empty collection. This is returned from {@see nextPage()} + * when we know that there isn't a next page in order to replicate the + * behavior of the API when it attempts to return a page beyond the last. + * + * @param null|array|string $opts + * + * @return Collection + */ + public static function emptyCollection($opts = null) + { + return Collection::constructFrom(['data' => []], $opts); + } + + /** + * Returns true if the page object contains no element. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->data); + } + + /** + * Fetches the next page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function nextPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $lastId = \end($this->data)->id; + + $params = \array_merge( + $this->filters ?: [], + ['starting_after' => $lastId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Fetches the previous page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function previousPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $firstId = $this->data[0]->id; + + $params = \array_merge( + $this->filters ?: [], + ['ending_before' => $firstId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Gets the first item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function first() + { + return \count($this->data) > 0 ? $this->data[0] : null; + } + + /** + * Gets the last item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function last() + { + return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; + } + + private function extractPathAndUpdateParams($params) + { + $url = \parse_url($this->url); + if (!isset($url['path'])) { + throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = []; + \parse_str($url['query'], $query); + $params = \array_merge($params ?: [], $query); + } + + return [$url['path'], $params]; + } +} diff --git a/vendor/stripe/stripe-php/lib/CountrySpec.php b/vendor/stripe/stripe-php/lib/CountrySpec.php index 223afb3..86b5738 100644 --- a/vendor/stripe/stripe-php/lib/CountrySpec.php +++ b/vendor/stripe/stripe-php/lib/CountrySpec.php @@ -1,30 +1,30 @@ -an online guide. - * - * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. - * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). - * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). - * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. - * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. - * @property \Stripe\StripeObject $verification_fields - */ -class CountrySpec extends ApiResource -{ - const OBJECT_NAME = 'country_spec'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} +an online guide. + * + * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. + * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). + * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). + * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. + * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. + * @property \Stripe\StripeObject $verification_fields + */ +class CountrySpec extends ApiResource +{ + const OBJECT_NAME = 'country_spec'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Coupon.php b/vendor/stripe/stripe-php/lib/Coupon.php index 41afdcf..a124fdb 100644 --- a/vendor/stripe/stripe-php/lib/Coupon.php +++ b/vendor/stripe/stripe-php/lib/Coupon.php @@ -1,41 +1,41 @@ -invoices or orders. Coupons do - * not work with conventional one-off charges. - * - * @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 null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. - * @property \Stripe\StripeObject $applies_to - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. - * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. - * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 Name of the coupon displayed to customers on for instance invoices or receipts. - * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. - * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. - * @property int $times_redeemed Number of times this coupon has been applied to a customer. - * @property bool $valid Taking account of the above properties, whether this coupon can still be applied to a customer. - */ -class Coupon extends ApiResource -{ - const OBJECT_NAME = 'coupon'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +invoices or orders. + * Coupons do not work with conventional one-off charges. + * + * @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 null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. + * @property \Stripe\StripeObject $applies_to + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. + * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. + * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 Name of the coupon displayed to customers on for instance invoices or receipts. + * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. + * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. + * @property int $times_redeemed Number of times this coupon has been applied to a customer. + * @property bool $valid Taking account of the above properties, whether this coupon can still be applied to a customer. + */ +class Coupon extends ApiResource +{ + const OBJECT_NAME = 'coupon'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/CreditNote.php b/vendor/stripe/stripe-php/lib/CreditNote.php index 591c5d7..f840242 100644 --- a/vendor/stripe/stripe-php/lib/CreditNote.php +++ b/vendor/stripe/stripe-php/lib/CreditNote.php @@ -1,111 +1,111 @@ -Credit Notes. - * - * @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 $amount The integer amount in %s representing the total amount of the credit note, including tax. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer ID of the customer. - * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. - * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. - * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. - * @property string|\Stripe\Invoice $invoice ID of the invoice. - * @property \Stripe\Collection $lines Line items that make up the credit note - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $memo Customer-facing text that appears on the credit note PDF. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. - * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. - * @property string $pdf The link to download the PDF of the credit note. - * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory - * @property null|string|\Stripe\Refund $refund Refund related to this credit note. - * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. - * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. - * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. - * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. - * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. - * @property null|int $voided_at The time that the credit note was voided. - */ -class CreditNote extends ApiResource -{ - const OBJECT_NAME = 'credit_note'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const REASON_DUPLICATE = 'duplicate'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_ORDER_CHANGE = 'order_change'; - const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'; - - const STATUS_ISSUED = 'issued'; - const STATUS_VOID = 'void'; - - const TYPE_POST_PAYMENT = 'post_payment'; - const TYPE_PRE_PAYMENT = 'pre_payment'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote the previewed credit note - */ - public static function preview($params = null, $opts = null) - { - $url = static::classUrl() . '/preview'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote the voided credit note - */ - public function voidCreditNote($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/void'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - const PATH_LINES = '/lines'; - - /** - * @param string $id the ID of the credit note on which to retrieve the credit note line items - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of credit note line items - */ - public static function allLines($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); - } -} +Credit Notes. + * + * @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 $amount The integer amount in %s representing the total amount of the credit note, including tax. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer ID of the customer. + * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. + * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. + * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. + * @property string|\Stripe\Invoice $invoice ID of the invoice. + * @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $memo Customer-facing text that appears on the credit note PDF. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. + * @property string $pdf The link to download the PDF of the credit note. + * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory + * @property null|string|\Stripe\Refund $refund Refund related to this credit note. + * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. + * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. + * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. + * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. + * @property null|int $voided_at The time that the credit note was voided. + */ +class CreditNote extends ApiResource +{ + const OBJECT_NAME = 'credit_note'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_ORDER_CHANGE = 'order_change'; + const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'; + + const STATUS_ISSUED = 'issued'; + const STATUS_VOID = 'void'; + + const TYPE_POST_PAYMENT = 'post_payment'; + const TYPE_PRE_PAYMENT = 'pre_payment'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the previewed credit note + */ + public static function preview($params = null, $opts = null) + { + $url = static::classUrl() . '/preview'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the voided credit note + */ + public function voidCreditNote($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the credit note on which to retrieve the credit note line items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php b/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php index 254886b..1e1755e 100644 --- a/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php +++ b/vendor/stripe/stripe-php/lib/CreditNoteLineItem.php @@ -1,26 +1,26 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $quantity The number of units of product being credited. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. - * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. - * @property null|int $unit_amount The cost of each unit of product being credited. - * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. - */ -class CreditNoteLineItem extends ApiResource -{ - const OBJECT_NAME = 'credit_note_line_item'; -} +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $quantity The number of units of product being credited. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. + * @property null|int $unit_amount The cost of each unit of product being credited. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class CreditNoteLineItem extends ApiResource +{ + const OBJECT_NAME = 'credit_note_line_item'; +} diff --git a/vendor/stripe/stripe-php/lib/Customer.php b/vendor/stripe/stripe-php/lib/Customer.php index 6cc983a..e81d427 100644 --- a/vendor/stripe/stripe-php/lib/Customer.php +++ b/vendor/stripe/stripe-php/lib/Customer.php @@ -1,277 +1,343 @@ -Customer objects allow you to perform recurring charges, and to - * track multiple charges, that are associated with the same customer. The API - * allows you to create, delete, and update your customers. You can retrieve - * individual customers as well as a list of all your customers. - * - * Related guide: Save a card during - * payment. - * - * @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 null|\Stripe\StripeObject $address The customer's address. - * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

- * @property null|bool $delinquent

When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

- * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. - * @property null|string $email The customer's email address. - * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. - * @property \Stripe\StripeObject $invoice_settings - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 The customer's full name or business name. - * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. - * @property null|string $phone The customer's phone number. - * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. - * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. - * @property \Stripe\Collection $sources The customer's payment sources, if any. - * @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any. - * @property \Stripe\StripeObject $tax - * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". - * @property \Stripe\Collection $tax_ids The customer's tax IDs. - */ -class Customer extends ApiResource -{ - const OBJECT_NAME = 'customer'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const TAX_EXEMPT_EXEMPT = 'exempt'; - const TAX_EXEMPT_NONE = 'none'; - const TAX_EXEMPT_REVERSE = 'reverse'; - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'source', - ]); - } - - return $savedNestedResources; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @return \Stripe\Customer the updated customer - */ - public function deleteDiscount($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/discount'; - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom(['discount' => null], $opts, true); - } - - const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; - - /** - * @param string $id the ID of the customer on which to retrieve the customer balance transactions - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of customer balance transactions - */ - public static function allBalanceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the customer balance transaction - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function createBalanceTransaction($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the customer balance transaction belongs - * @param string $balanceTransactionId the ID of the customer balance transaction to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); - } - - const PATH_SOURCES = '/sources'; - - /** - * @param string $id the ID of the customer on which to retrieve the payment sources - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) - */ - public static function allSources($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the payment source - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function createSource($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function deleteSource($id, $sourceId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function retrieveSource($id, $sourceId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the payment source belongs - * @param string $sourceId the ID of the payment source to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public static function updateSource($id, $sourceId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); - } - - const PATH_TAX_IDS = '/tax_ids'; - - /** - * @param string $id the ID of the customer on which to retrieve the tax ids - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of tax ids - */ - public static function allTaxIds($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); - } - - /** - * @param string $id the ID of the customer on which to create the tax id - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function createTaxId($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the tax id belongs - * @param string $taxIdId the ID of the tax id to delete - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) - { - return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); - } - - /** - * @param string $id the ID of the customer to which the tax id belongs - * @param string $taxIdId the ID of the tax id to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); - } -} +Save a card during + * payment. + * + * @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 null|\Stripe\StripeObject $address The customer's address. + * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance".The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

+ * @property null|bool $delinquent

When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. + * @property null|string $email The customer's email address. + * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. + * @property \Stripe\StripeObject $invoice_settings + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 The customer's full name or business name. + * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. + * @property null|string $phone The customer's phone number. + * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. + * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + * @property \Stripe\Collection<\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any. + * @property \Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any. + * @property \Stripe\StripeObject $tax + * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". + * @property \Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this customer belongs to. + */ +class Customer extends ApiResource +{ + const OBJECT_NAME = 'customer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const TAX_EXEMPT_EXEMPT = 'exempt'; + const TAX_EXEMPT_NONE = 'none'; + const TAX_EXEMPT_REVERSE = 'reverse'; + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @return \Stripe\Customer the updated customer + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->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 + * + * @return \Stripe\Collection<\Stripe\Customer> list of PaymentMethods + */ + public static function allPaymentMethods($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/payment_methods'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the customer search results + */ + 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 + * + * @return \Stripe\cash_balance + */ + public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); + } + + /** + * @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 + * + * @return \Stripe\cash_balance + */ + public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); + } + const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; + + /** + * @param string $id the ID of the customer on which to retrieve the customer balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> the list of customer balance transactions + */ + public static function allBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the customer balance transaction + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function createBalanceTransaction($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + const PATH_SOURCES = '/sources'; + + /** + * @param string $id the ID of the customer on which to retrieve the payment sources + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) + */ + public static function allSources($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the payment source + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function createSource($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function deleteSource($id, $sourceId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function retrieveSource($id, $sourceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function updateSource($id, $sourceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + const PATH_TAX_IDS = '/tax_ids'; + + /** + * @param string $id the ID of the customer on which to retrieve the tax ids + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TaxId> the list of tax ids + */ + public static function allTaxIds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the tax id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function createTaxId($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php b/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php index 8c30676..ad3bc21 100644 --- a/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php +++ b/vendor/stripe/stripe-php/lib/CustomerBalanceTransaction.php @@ -1,103 +1,103 @@ -balance - * value, which denotes a debit or credit that's automatically applied to their - * next invoice upon finalization. You may modify the value directly by using the - * update customer API, - * or by creating a Customer Balance Transaction, which increments or decrements - * the customer's balance by the specified amount. - * - * Related guide: Customer Balance to - * learn more. - * - * @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 $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. - */ -class CustomerBalanceTransaction extends ApiResource -{ - const OBJECT_NAME = 'customer_balance_transaction'; - - const TYPE_ADJUSTMENT = 'adjustment'; - const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; - const TYPE_CREDIT_NOTE = 'credit_note'; - const TYPE_INITIAL = 'initial'; - const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; - const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; - const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; - - const TYPE_ADJUSTEMENT = 'adjustment'; - - /** - * @return string the API URL for this balance transaction - */ - public function instanceUrl() - { - $id = $this['id']; - $customer = $this['customer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - "Could not determine which URL to request: class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - $extn = \urlencode($id); - - return "{$base}/{$customerExtn}/balance_transactions/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Customer Balance Transactions cannot be retrieved without a ' . - 'customer ID. Retrieve a Customer Balance Transaction using ' . - "`Customer::retrieveBalanceTransaction('customer_id', " . - "'balance_transaction_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Customer Balance Transactions cannot be updated without a ' . - 'customer ID. Update a Customer Balance Transaction using ' . - "`Customer::updateBalanceTransaction('customer_id', " . - "'balance_transaction_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} +balance + * value, which denotes a debit or credit that's automatically applied to their + * next invoice upon finalization. You may modify the value directly by using the + * update customer API, + * or by creating a Customer Balance Transaction, which increments or decrements + * the customer's balance by the specified amount. + * + * Related guide: Customer Balance to + * learn more. + * + * @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 $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. + */ +class CustomerBalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'customer_balance_transaction'; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; + const TYPE_CREDIT_NOTE = 'credit_note'; + const TYPE_INITIAL = 'initial'; + const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; + const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; + const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; + + const TYPE_ADJUSTEMENT = 'adjustment'; + + /** + * @return string the API URL for this balance transaction + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/balance_transactions/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Customer Balance Transactions cannot be retrieved without a ' . + 'customer ID. Retrieve a Customer Balance Transaction using ' . + "`Customer::retrieveBalanceTransaction('customer_id', " . + "'balance_transaction_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Customer Balance Transactions cannot be updated without a ' . + 'customer ID. Update a Customer Balance Transaction using ' . + "`Customer::updateBalanceTransaction('customer_id', " . + "'balance_transaction_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Discount.php b/vendor/stripe/stripe-php/lib/Discount.php index f32e3c5..fd3b176 100644 --- a/vendor/stripe/stripe-php/lib/Discount.php +++ b/vendor/stripe/stripe-php/lib/Discount.php @@ -1,23 +1,23 @@ -Disputes and Fraud - * documentation. - * - * Related guide: Disputes and - * Fraud. - * - * @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 $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). - * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - * @property string|\Stripe\Charge $charge ID of the charge that was disputed. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject $evidence - * @property \Stripe\StripeObject $evidence_details - * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $network_reason_code Network-dependent reason code for the dispute. - * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. - * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. - * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost. - */ -class Dispute extends ApiResource -{ - const OBJECT_NAME = 'dispute'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; - const REASON_CHECK_RETURNED = 'check_returned'; - const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; - const REASON_CUSTOMER_INITIATED = 'customer_initiated'; - const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; - const REASON_DUPLICATE = 'duplicate'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_GENERAL = 'general'; - const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; - const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; - const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; - const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; - const REASON_UNRECOGNIZED = 'unrecognized'; - - const STATUS_CHARGE_REFUNDED = 'charge_refunded'; - const STATUS_LOST = 'lost'; - const STATUS_NEEDS_RESPONSE = 'needs_response'; - const STATUS_UNDER_REVIEW = 'under_review'; - const STATUS_WARNING_CLOSED = 'warning_closed'; - const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; - const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; - const STATUS_WON = 'won'; - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute the closed dispute - */ - // TODO: add $params to standardize signature - public function close($opts = null) - { - $url = $this->instanceUrl() . '/close'; - list($response, $opts) = $this->_request('post', $url, null, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Disputes and Fraud + * documentation. + * + * Related guide: Disputes and + * Fraud. + * + * @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 $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). + * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + * @property string|\Stripe\Charge $charge ID of the charge that was disputed. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $evidence + * @property \Stripe\StripeObject $evidence_details + * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $network_reason_code Network-dependent reason code for the dispute. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. + * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. + * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost. + */ +class Dispute extends ApiResource +{ + const OBJECT_NAME = 'dispute'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; + const REASON_CHECK_RETURNED = 'check_returned'; + const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; + const REASON_CUSTOMER_INITIATED = 'customer_initiated'; + const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_GENERAL = 'general'; + const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; + const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; + const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; + const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; + const REASON_UNRECOGNIZED = 'unrecognized'; + + const STATUS_CHARGE_REFUNDED = 'charge_refunded'; + const STATUS_LOST = 'lost'; + const STATUS_NEEDS_RESPONSE = 'needs_response'; + const STATUS_UNDER_REVIEW = 'under_review'; + const STATUS_WARNING_CLOSED = 'warning_closed'; + const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; + const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; + const STATUS_WON = 'won'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute the closed dispute + */ + // TODO: add $params to standardize signature + public function close($opts = null) + { + $url = $this->instanceUrl() . '/close'; + list($response, $opts) = $this->_request('post', $url, null, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/EphemeralKey.php b/vendor/stripe/stripe-php/lib/EphemeralKey.php index 253256c..8822319 100644 --- a/vendor/stripe/stripe-php/lib/EphemeralKey.php +++ b/vendor/stripe/stripe-php/lib/EphemeralKey.php @@ -1,43 +1,43 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. - * @property array $associated_objects - */ -class EphemeralKey extends ApiResource -{ - const OBJECT_NAME = 'ephemeral_key'; - - use ApiOperations\Create { - create as protected _create; - } - - use ApiOperations\Delete; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\EphemeralKey the created key - */ - public static function create($params = null, $opts = null) - { - if (!$opts || !isset($opts['stripe_version'])) { - throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); - } - - return self::_create($params, $opts); - } -} +true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. + * @property array $associated_objects + */ +class EphemeralKey extends ApiResource +{ + const OBJECT_NAME = 'ephemeral_key'; + + use ApiOperations\Create { + create as protected _create; + } + + use ApiOperations\Delete; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey the created key + */ + public static function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return self::_create($params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/ErrorObject.php b/vendor/stripe/stripe-php/lib/ErrorObject.php index a9fe1a3..c2e6d26 100644 --- a/vendor/stripe/stripe-php/lib/ErrorObject.php +++ b/vendor/stripe/stripe-php/lib/ErrorObject.php @@ -1,164 +1,162 @@ - null, - 'code' => null, - 'decline_code' => null, - 'doc_url' => null, - 'message' => null, - 'param' => null, - 'payment_intent' => null, - 'payment_method' => null, - 'setup_intent' => null, - 'source' => null, - 'type' => null, - ], $values); - parent::refreshFrom($values, $opts, $partial); - } -} + null, + 'code' => null, + 'decline_code' => null, + 'doc_url' => null, + 'message' => null, + 'param' => null, + 'payment_intent' => null, + 'payment_method' => null, + 'setup_intent' => null, + 'source' => null, + 'type' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/vendor/stripe/stripe-php/lib/Event.php b/vendor/stripe/stripe-php/lib/Event.php index 518c5d4..97c7b74 100644 --- a/vendor/stripe/stripe-php/lib/Event.php +++ b/vendor/stripe/stripe-php/lib/Event.php @@ -1,231 +1,255 @@ -Event object. For example, when a charge succeeds, we create a - * charge.succeeded event; and when an invoice payment attempt fails, - * we create an invoice.payment_failed event. Note that many API - * requests may cause multiple events to be created. For example, if you create a - * new subscription for a customer, you will receive both a - * customer.subscription.created event and a - * charge.succeeded event. - * - * Events occur when the state of another API resource changes. The state of that - * resource at the time of the change is embedded in the event's data field. For - * example, a charge.succeeded event will contain a charge, and an - * invoice.payment_failed event will contain an invoice. - * - * As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. - * We also have a separate webhooks system for sending the - * Event objects directly to an endpoint on your server. Webhooks are - * managed in your account - * settings, and our Using - * Webhooks guide will help you get set up. - * - * When using Connect, you can also - * receive notifications of events that occur in connected accounts. For these - * events, there will be an additional account attribute in the - * received Event object. - * - * NOTE: Right now, access to events through the Retrieve Event API is - * guaranteed only for 30 days. - * - * @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 string $account The connected account that originated the event. - * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $data - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. - * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. - * @property string $type Description of the event (e.g., invoice.created or charge.refunded). - */ -class Event extends ApiResource -{ - const OBJECT_NAME = 'event'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * Possible string representations of event types. - * - * @see https://stripe.com/docs/api#event_types - */ - const ACCOUNT_UPDATED = 'account.updated'; - const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; - const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; - const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; - const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; - const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated'; - const APPLICATION_FEE_CREATED = 'application_fee.created'; - const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; - const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; - const BALANCE_AVAILABLE = 'balance.available'; - const CAPABILITY_UPDATED = 'capability.updated'; - const CHARGE_CAPTURED = 'charge.captured'; - const CHARGE_EXPIRED = 'charge.expired'; - const CHARGE_FAILED = 'charge.failed'; - const CHARGE_PENDING = 'charge.pending'; - const CHARGE_REFUNDED = 'charge.refunded'; - const CHARGE_SUCCEEDED = 'charge.succeeded'; - const CHARGE_UPDATED = 'charge.updated'; - const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; - const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; - const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; - const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; - const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; - const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; - const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; - const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; - const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; - const COUPON_CREATED = 'coupon.created'; - const COUPON_DELETED = 'coupon.deleted'; - const COUPON_UPDATED = 'coupon.updated'; - const CREDIT_NOTE_CREATED = 'credit_note.created'; - const CREDIT_NOTE_UPDATED = 'credit_note.updated'; - const CREDIT_NOTE_VOIDED = 'credit_note.voided'; - const CUSTOMER_CREATED = 'customer.created'; - const CUSTOMER_DELETED = 'customer.deleted'; - const CUSTOMER_UPDATED = 'customer.updated'; - const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; - const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; - const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; - const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; - const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; - const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; - const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; - const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; - const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; - const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; - const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; - const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; - const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; - const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; - const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; - const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; - const FILE_CREATED = 'file.created'; - const INVOICE_CREATED = 'invoice.created'; - const INVOICE_DELETED = 'invoice.deleted'; - const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; - const INVOICE_FINALIZED = 'invoice.finalized'; - const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; - const INVOICE_PAID = 'invoice.paid'; - const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; - const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; - const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; - const INVOICE_SENT = 'invoice.sent'; - 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 ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; - const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; - const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; - const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; - const ISSUING_CARD_CREATED = 'issuing_card.created'; - const ISSUING_CARD_UPDATED = 'issuing_card.updated'; - const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; - const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; - const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; - const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; - const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; - const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; - const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; - const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; - const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; - const MANDATE_UPDATED = 'mandate.updated'; - const ORDER_CREATED = 'order.created'; - const ORDER_PAYMENT_FAILED = 'order.payment_failed'; - const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; - const ORDER_UPDATED = 'order.updated'; - const ORDER_RETURN_CREATED = 'order_return.created'; - const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; - const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; - const PAYMENT_INTENT_CREATED = 'payment_intent.created'; - const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; - const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; - const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; - const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; - const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; - const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; - const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; - const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; - const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; - const PAYOUT_CANCELED = 'payout.canceled'; - const PAYOUT_CREATED = 'payout.created'; - const PAYOUT_FAILED = 'payout.failed'; - const PAYOUT_PAID = 'payout.paid'; - const PAYOUT_UPDATED = 'payout.updated'; - const PERSON_CREATED = 'person.created'; - const PERSON_DELETED = 'person.deleted'; - const PERSON_UPDATED = 'person.updated'; - const PING = 'ping'; - const PLAN_CREATED = 'plan.created'; - const PLAN_DELETED = 'plan.deleted'; - const PLAN_UPDATED = 'plan.updated'; - const PRICE_CREATED = 'price.created'; - const PRICE_DELETED = 'price.deleted'; - const PRICE_UPDATED = 'price.updated'; - const PRODUCT_CREATED = 'product.created'; - const PRODUCT_DELETED = 'product.deleted'; - const PRODUCT_UPDATED = 'product.updated'; - const PROMOTION_CODE_CREATED = 'promotion_code.created'; - const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; - const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; - const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; - const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; - const RECIPIENT_CREATED = 'recipient.created'; - const RECIPIENT_DELETED = 'recipient.deleted'; - const RECIPIENT_UPDATED = 'recipient.updated'; - const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; - const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; - const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; - const REVIEW_CLOSED = 'review.closed'; - const REVIEW_OPENED = 'review.opened'; - const SETUP_INTENT_CANCELED = 'setup_intent.canceled'; - const SETUP_INTENT_CREATED = 'setup_intent.created'; - const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action'; - const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed'; - const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded'; - const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; - const SKU_CREATED = 'sku.created'; - const SKU_DELETED = 'sku.deleted'; - const SKU_UPDATED = 'sku.updated'; - const SOURCE_CANCELED = 'source.canceled'; - const SOURCE_CHARGEABLE = 'source.chargeable'; - const SOURCE_FAILED = 'source.failed'; - const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; - const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; - const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; - const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; - const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; - const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; - const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; - const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; - const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; - const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; - const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; - const TAX_RATE_CREATED = 'tax_rate.created'; - const TAX_RATE_UPDATED = 'tax_rate.updated'; - const TOPUP_CANCELED = 'topup.canceled'; - const TOPUP_CREATED = 'topup.created'; - const TOPUP_FAILED = 'topup.failed'; - const TOPUP_REVERSED = 'topup.reversed'; - const TOPUP_SUCCEEDED = 'topup.succeeded'; - const TRANSFER_CREATED = 'transfer.created'; - const TRANSFER_REVERSED = 'transfer.reversed'; - const TRANSFER_UPDATED = 'transfer.updated'; -} +Event object. For example, when a charge succeeds, we create a + * charge.succeeded event; and when an invoice payment attempt fails, + * we create an invoice.payment_failed event. Note that many API + * requests may cause multiple events to be created. For example, if you create a + * new subscription for a customer, you will receive both a + * customer.subscription.created event and a + * charge.succeeded event. + * + * Events occur when the state of another API resource changes. The state of that + * resource at the time of the change is embedded in the event's data field. For + * example, a charge.succeeded event will contain a charge, and an + * invoice.payment_failed event will contain an invoice. + * + * As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. + * We also have a separate webhooks system for sending the + * Event objects directly to an endpoint on your server. Webhooks are + * managed in your account + * settings, and our Using + * Webhooks guide will help you get set up. + * + * When using Connect, you can also + * receive notifications of events that occur in connected accounts. For these + * events, there will be an additional account attribute in the + * received Event object. + * + * NOTE: Right now, access to events through the Retrieve Event API is + * guaranteed only for 30 days. + * + * This class includes constants for the possible string representations of + * event types. See https://stripe.com/docs/api#event_types for more details. + * + * @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 string $account The connected account that originated the event. + * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $data + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. + * @property string $type Description of the event (e.g., invoice.created or charge.refunded). + */ +class Event extends ApiResource +{ + const OBJECT_NAME = 'event'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; + const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; + const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; + const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; + 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 BALANCE_AVAILABLE = 'balance.available'; + const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; + const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; + const CAPABILITY_UPDATED = 'capability.updated'; + const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available'; + const CHARGE_CAPTURED = 'charge.captured'; + const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; + const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; + const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; + const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; + const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; + 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_SUCCEEDED = 'charge.succeeded'; + const CHARGE_UPDATED = 'charge.updated'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; + const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; + const CHECKOUT_SESSION_EXPIRED = 'checkout.session.expired'; + const COUPON_CREATED = 'coupon.created'; + const COUPON_DELETED = 'coupon.deleted'; + const COUPON_UPDATED = 'coupon.updated'; + const CREDIT_NOTE_CREATED = 'credit_note.created'; + const CREDIT_NOTE_UPDATED = 'credit_note.updated'; + const CREDIT_NOTE_VOIDED = 'credit_note.voided'; + const CUSTOMER_CREATED = 'customer.created'; + const CUSTOMER_DELETED = 'customer.deleted'; + const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; + const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; + const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; + const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; + const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; + const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; + const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; + const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; + const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; + const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; + const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; + const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; + const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; + const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; + const CUSTOMER_UPDATED = 'customer.updated'; + const FILE_CREATED = 'file.created'; + const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled'; + const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created'; + const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing'; + 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 INVOICE_CREATED = 'invoice.created'; + const INVOICE_DELETED = 'invoice.deleted'; + const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; + const INVOICE_FINALIZED = 'invoice.finalized'; + const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const INVOICE_PAID = 'invoice.paid'; + const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; + const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; + const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; + const INVOICE_SENT = 'invoice.sent'; + 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 ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; + const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; + const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; + const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; + const ISSUING_CARD_CREATED = 'issuing_card.created'; + const ISSUING_CARD_UPDATED = 'issuing_card.updated'; + const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; + const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; + const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; + const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; + const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; + const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; + const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; + const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; + const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; + const MANDATE_UPDATED = 'mandate.updated'; + const ORDER_CREATED = 'order.created'; + const ORDER_PAYMENT_FAILED = 'order.payment_failed'; + const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; + const ORDER_UPDATED = 'order.updated'; + const ORDER_RETURN_CREATED = 'order_return.created'; + const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; + const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; + const PAYMENT_INTENT_CREATED = 'payment_intent.created'; + const PAYMENT_INTENT_PARTIALLY_FUNDED = 'payment_intent.partially_funded'; + const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; + const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; + const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; + const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; + const PAYMENT_LINK_CREATED = 'payment_link.created'; + const PAYMENT_LINK_UPDATED = 'payment_link.updated'; + const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; + const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; + const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; + const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; + const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; + const PAYOUT_CANCELED = 'payout.canceled'; + const PAYOUT_CREATED = 'payout.created'; + const PAYOUT_FAILED = 'payout.failed'; + const PAYOUT_PAID = 'payout.paid'; + const PAYOUT_UPDATED = 'payout.updated'; + const PERSON_CREATED = 'person.created'; + const PERSON_DELETED = 'person.deleted'; + const PERSON_UPDATED = 'person.updated'; + const PING = 'ping'; + const PLAN_CREATED = 'plan.created'; + const PLAN_DELETED = 'plan.deleted'; + const PLAN_UPDATED = 'plan.updated'; + const PRICE_CREATED = 'price.created'; + const PRICE_DELETED = 'price.deleted'; + const PRICE_UPDATED = 'price.updated'; + const PRODUCT_CREATED = 'product.created'; + const PRODUCT_DELETED = 'product.deleted'; + const PRODUCT_UPDATED = 'product.updated'; + const PROMOTION_CODE_CREATED = 'promotion_code.created'; + const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; + const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; + const QUOTE_ACCEPTED = 'quote.accepted'; + const QUOTE_CANCELED = 'quote.canceled'; + const QUOTE_CREATED = 'quote.created'; + const QUOTE_FINALIZED = 'quote.finalized'; + const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; + const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; + const RECIPIENT_CREATED = 'recipient.created'; + const RECIPIENT_DELETED = 'recipient.deleted'; + const RECIPIENT_UPDATED = 'recipient.updated'; + const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; + const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; + const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; + const REVIEW_CLOSED = 'review.closed'; + const REVIEW_OPENED = 'review.opened'; + const SETUP_INTENT_CANCELED = 'setup_intent.canceled'; + const SETUP_INTENT_CREATED = 'setup_intent.created'; + const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action'; + const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed'; + const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded'; + const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; + const SKU_CREATED = 'sku.created'; + const SKU_DELETED = 'sku.deleted'; + const SKU_UPDATED = 'sku.updated'; + const SOURCE_CANCELED = 'source.canceled'; + const SOURCE_CHARGEABLE = 'source.chargeable'; + const SOURCE_FAILED = 'source.failed'; + const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; + const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; + const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; + const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; + const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; + const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; + const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; + const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; + const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; + const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; + const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; + const TAX_RATE_CREATED = 'tax_rate.created'; + const TAX_RATE_UPDATED = 'tax_rate.updated'; + const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed'; + const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded'; + const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing'; + const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created'; + const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted'; + const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure'; + const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready'; + const TOPUP_CANCELED = 'topup.canceled'; + const TOPUP_CREATED = 'topup.created'; + const TOPUP_FAILED = 'topup.failed'; + const TOPUP_REVERSED = 'topup.reversed'; + const TOPUP_SUCCEEDED = 'topup.succeeded'; + const TRANSFER_CREATED = 'transfer.created'; + const TRANSFER_FAILED = 'transfer.failed'; + const TRANSFER_PAID = 'transfer.paid'; + const TRANSFER_REVERSED = 'transfer.reversed'; + const TRANSFER_UPDATED = 'transfer.updated'; +} diff --git a/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php b/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php index 33f2ede..1abc974 100644 --- a/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php +++ b/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php @@ -1,12 +1,12 @@ -setHttpStatus($httpStatus); - $instance->setHttpBody($httpBody); - $instance->setJsonBody($jsonBody); - $instance->setHttpHeaders($httpHeaders); - $instance->setStripeCode($stripeCode); - - $instance->setRequestId(null); - if ($httpHeaders && isset($httpHeaders['Request-Id'])) { - $instance->setRequestId($httpHeaders['Request-Id']); - } - - $instance->setError($instance->constructErrorObject()); - - return $instance; - } - - /** - * Gets the Stripe error object. - * - * @return null|\Stripe\ErrorObject - */ - public function getError() - { - return $this->error; - } - - /** - * Sets the Stripe error object. - * - * @param null|\Stripe\ErrorObject $error - */ - public function setError($error) - { - $this->error = $error; - } - - /** - * Gets the HTTP body as a string. - * - * @return null|string - */ - public function getHttpBody() - { - return $this->httpBody; - } - - /** - * Sets the HTTP body as a string. - * - * @param null|string $httpBody - */ - public function setHttpBody($httpBody) - { - $this->httpBody = $httpBody; - } - - /** - * Gets the HTTP headers array. - * - * @return null|array|\Stripe\Util\CaseInsensitiveArray - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Sets the HTTP headers array. - * - * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders - */ - public function setHttpHeaders($httpHeaders) - { - $this->httpHeaders = $httpHeaders; - } - - /** - * Gets the HTTP status code. - * - * @return null|int - */ - public function getHttpStatus() - { - return $this->httpStatus; - } - - /** - * Sets the HTTP status code. - * - * @param null|int $httpStatus - */ - public function setHttpStatus($httpStatus) - { - $this->httpStatus = $httpStatus; - } - - /** - * Gets the JSON deserialized body. - * - * @return null|array - */ - public function getJsonBody() - { - return $this->jsonBody; - } - - /** - * Sets the JSON deserialized body. - * - * @param null|array $jsonBody - */ - public function setJsonBody($jsonBody) - { - $this->jsonBody = $jsonBody; - } - - /** - * Gets the Stripe request ID. - * - * @return null|string - */ - public function getRequestId() - { - return $this->requestId; - } - - /** - * Sets the Stripe request ID. - * - * @param null|string $requestId - */ - public function setRequestId($requestId) - { - $this->requestId = $requestId; - } - - /** - * Gets the Stripe error code. - * - * Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible - * values. - * - * @return null|string - */ - public function getStripeCode() - { - return $this->stripeCode; - } - - /** - * Sets the Stripe error code. - * - * @param null|string $stripeCode - */ - public function setStripeCode($stripeCode) - { - $this->stripeCode = $stripeCode; - } - - /** - * Returns the string representation of the exception. - * - * @return string - */ - public function __toString() - { - $statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) "; - $idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) "; - - return "{$statusStr}{$idStr}{$this->getMessage()}"; - } - - protected function constructErrorObject() - { - if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) { - return null; - } - - return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']); - } -} +setHttpStatus($httpStatus); + $instance->setHttpBody($httpBody); + $instance->setJsonBody($jsonBody); + $instance->setHttpHeaders($httpHeaders); + $instance->setStripeCode($stripeCode); + + $instance->setRequestId(null); + if ($httpHeaders && isset($httpHeaders['Request-Id'])) { + $instance->setRequestId($httpHeaders['Request-Id']); + } + + $instance->setError($instance->constructErrorObject()); + + return $instance; + } + + /** + * Gets the Stripe error object. + * + * @return null|\Stripe\ErrorObject + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the Stripe error object. + * + * @param null|\Stripe\ErrorObject $error + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the HTTP headers array. + * + * @return null|array|\Stripe\Util\CaseInsensitiveArray + */ + public function getHttpHeaders() + { + return $this->httpHeaders; + } + + /** + * Sets the HTTP headers array. + * + * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders + */ + public function setHttpHeaders($httpHeaders) + { + $this->httpHeaders = $httpHeaders; + } + + /** + * Gets the HTTP status code. + * + * @return null|int + */ + public function getHttpStatus() + { + return $this->httpStatus; + } + + /** + * Sets the HTTP status code. + * + * @param null|int $httpStatus + */ + public function setHttpStatus($httpStatus) + { + $this->httpStatus = $httpStatus; + } + + /** + * Gets the JSON deserialized body. + * + * @return null|array + */ + public function getJsonBody() + { + return $this->jsonBody; + } + + /** + * Sets the JSON deserialized body. + * + * @param null|array $jsonBody + */ + public function setJsonBody($jsonBody) + { + $this->jsonBody = $jsonBody; + } + + /** + * Gets the Stripe request ID. + * + * @return null|string + */ + public function getRequestId() + { + return $this->requestId; + } + + /** + * Sets the Stripe request ID. + * + * @param null|string $requestId + */ + public function setRequestId($requestId) + { + $this->requestId = $requestId; + } + + /** + * Gets the Stripe error code. + * + * Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible + * values. + * + * @return null|string + */ + public function getStripeCode() + { + return $this->stripeCode; + } + + /** + * Sets the Stripe error code. + * + * @param null|string $stripeCode + */ + public function setStripeCode($stripeCode) + { + $this->stripeCode = $stripeCode; + } + + /** + * Returns the string representation of the exception. + * + * @return string + */ + public function __toString() + { + $statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) "; + $idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) "; + + return "{$statusStr}{$idStr}{$this->getMessage()}"; + } + + protected function constructErrorObject() + { + if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) { + return null; + } + + return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']); + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php b/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php index 9e5c718..bd9356b 100644 --- a/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php +++ b/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php @@ -1,11 +1,11 @@ -setDeclineCode($declineCode); - $instance->setStripeParam($stripeParam); - - return $instance; - } - - /** - * Gets the decline code. - * - * @return null|string - */ - public function getDeclineCode() - { - return $this->declineCode; - } - - /** - * Sets the decline code. - * - * @param null|string $declineCode - */ - public function setDeclineCode($declineCode) - { - $this->declineCode = $declineCode; - } - - /** - * Gets the parameter related to the error. - * - * @return null|string - */ - public function getStripeParam() - { - return $this->stripeParam; - } - - /** - * Sets the parameter related to the error. - * - * @param null|string $stripeParam - */ - public function setStripeParam($stripeParam) - { - $this->stripeParam = $stripeParam; - } -} +setDeclineCode($declineCode); + $instance->setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the decline code. + * + * @return null|string + */ + public function getDeclineCode() + { + return $this->declineCode; + } + + /** + * Sets the decline code. + * + * @param null|string $declineCode + */ + public function setDeclineCode($declineCode) + { + $this->declineCode = $declineCode; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php b/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php index c84f37d..a0ccea9 100644 --- a/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php +++ b/vendor/stripe/stripe-php/lib/Exception/ExceptionInterface.php @@ -1,22 +1,22 @@ -setStripeParam($stripeParam); - - return $instance; - } - - /** - * Gets the parameter related to the error. - * - * @return null|string - */ - public function getStripeParam() - { - return $this->stripeParam; - } - - /** - * Sets the parameter related to the error. - * - * @param null|string $stripeParam - */ - public function setStripeParam($stripeParam) - { - $this->stripeParam = $stripeParam; - } -} +setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php b/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php index dd42662..bc1986f 100644 --- a/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php +++ b/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php @@ -1,10 +1,10 @@ -jsonBody) { - return null; - } - - return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); - } -} +jsonBody) { + return null; + } + + return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php b/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php index c8dba29..f1d6f94 100644 --- a/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php +++ b/vendor/stripe/stripe-php/lib/Exception/OAuth/UnknownOAuthErrorException.php @@ -1,12 +1,12 @@ -setHttpBody($httpBody); - $instance->setSigHeader($sigHeader); - - return $instance; - } - - /** - * Gets the HTTP body as a string. - * - * @return null|string - */ - public function getHttpBody() - { - return $this->httpBody; - } - - /** - * Sets the HTTP body as a string. - * - * @param null|string $httpBody - */ - public function setHttpBody($httpBody) - { - $this->httpBody = $httpBody; - } - - /** - * Gets the `Stripe-Signature` HTTP header. - * - * @return null|string - */ - public function getSigHeader() - { - return $this->sigHeader; - } - - /** - * Sets the `Stripe-Signature` HTTP header. - * - * @param null|string $sigHeader - */ - public function setSigHeader($sigHeader) - { - $this->sigHeader = $sigHeader; - } -} +setHttpBody($httpBody); + $instance->setSigHeader($sigHeader); + + return $instance; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the `Stripe-Signature` HTTP header. + * + * @return null|string + */ + public function getSigHeader() + { + return $this->sigHeader; + } + + /** + * Sets the `Stripe-Signature` HTTP header. + * + * @param null|string $sigHeader + */ + public function setSigHeader($sigHeader) + { + $this->sigHeader = $sigHeader; + } +} diff --git a/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php b/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php index 0a629ed..5270eeb 100644 --- a/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php +++ b/vendor/stripe/stripe-php/lib/Exception/UnexpectedValueException.php @@ -1,7 +1,7 @@ -Exchange Rate objects allow you to determine the rates that Stripe - * is currently using to convert from one currency to another. Since this number is - * variable throughout the day, there are various reasons why you might want to - * know the current rate (for example, to dynamically price an item for a user with - * a default payment in a foreign currency). - * - * If you want a guarantee that the charge is made with a certain exchange rate you - * expect is current, you can pass in exchange_rate to charges - * endpoints. If the value is no longer up to date, the charge won't go through. - * Please refer to our Exchange - * Rates API guide for more details. - * - * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. - */ -class ExchangeRate extends ApiResource -{ - const OBJECT_NAME = 'exchange_rate'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} +Exchange Rate objects allow you to determine the rates that Stripe + * is currently using to convert from one currency to another. Since this number is + * variable throughout the day, there are various reasons why you might want to + * know the current rate (for example, to dynamically price an item for a user with + * a default payment in a foreign currency). + * + * If you want a guarantee that the charge is made with a certain exchange rate you + * expect is current, you can pass in exchange_rate to charges + * endpoints. If the value is no longer up to date, the charge won't go through. + * Please refer to our Exchange + * Rates API guide for more details. + * + * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + */ +class ExchangeRate extends ApiResource +{ + const OBJECT_NAME = 'exchange_rate'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/File.php b/vendor/stripe/stripe-php/lib/File.php index 9f60564..28f0852 100644 --- a/vendor/stripe/stripe-php/lib/File.php +++ b/vendor/stripe/stripe-php/lib/File.php @@ -1,87 +1,87 @@ -create file request (for - * example, when uploading dispute evidence) or it may have been created by Stripe - * (for example, the results of a Sigma scheduled - * query). - * - * Related guide: File Upload - * Guide. - * - * @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|int $expires_at The time at which the file expires and is no longer available in epoch seconds. - * @property null|string $filename A filename for the file, suitable for saving to a filesystem. - * @property null|\Stripe\Collection $links A list of file links that point at this file. - * @property string $purpose The purpose of the uploaded file. - * @property int $size The size in bytes of the file object. - * @property null|string $title A user friendly title for the document. - * @property null|string $type The type of the file returned (e.g., csv, pdf, jpg, or png). - * @property null|string $url The URL from which the file can be downloaded using your live secret API key. - */ -class File extends ApiResource -{ - const OBJECT_NAME = 'file'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; - const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; - const PURPOSE_BUSINESS_ICON = 'business_icon'; - const PURPOSE_BUSINESS_LOGO = 'business_logo'; - const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; - const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; - const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document'; - const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run'; - const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; - const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable'; - const PURPOSE_PCI_DOCUMENT = 'pci_document'; - const PURPOSE_SELFIE = 'selfie'; - const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query'; - const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; - - // This resource can have two different object names. In latter API - // versions, only `file` is used, but since stripe-php may be used with - // any API version, we need to support deserializing the older - // `file_upload` object into the same class. - const OBJECT_NAME_ALT = 'file_upload'; - - use ApiOperations\Create { - create as protected _create; - } - - public static function classUrl() - { - return '/v1/files'; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\File the created file - */ - public static function create($params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (null === $opts->apiBase) { - $opts->apiBase = Stripe::$apiUploadBase; - } - // Manually flatten params, otherwise curl's multipart encoder will - // choke on nested arrays. - $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); - - return static::_create($flatParams, $opts); - } -} +create file request (for + * example, when uploading dispute evidence) or it may have been created by Stripe + * (for example, the results of a Sigma scheduled + * query). + * + * Related guide: File Upload + * Guide. + * + * @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|int $expires_at The time at which the file expires and is no longer available in epoch seconds. + * @property null|string $filename A filename for the file, suitable for saving to a filesystem. + * @property null|\Stripe\Collection<\Stripe\FileLink> $links A list of file links that point at this file. + * @property string $purpose The purpose of the uploaded file. + * @property int $size The size in bytes of the file object. + * @property null|string $title A user friendly title for the document. + * @property null|string $type The type of the file returned (e.g., csv, pdf, jpg, or png). + * @property null|string $url The URL from which the file can be downloaded using your live secret API key. + */ +class File extends ApiResource +{ + const OBJECT_NAME = 'file'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; + const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; + const PURPOSE_BUSINESS_ICON = 'business_icon'; + const PURPOSE_BUSINESS_LOGO = 'business_logo'; + const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; + const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; + const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document'; + const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run'; + const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; + const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable'; + const PURPOSE_PCI_DOCUMENT = 'pci_document'; + const PURPOSE_SELFIE = 'selfie'; + const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query'; + const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; + + // This resource can have two different object names. In latter API + // versions, only `file` is used, but since stripe-php may be used with + // any API version, we need to support deserializing the older + // `file_upload` object into the same class. + const OBJECT_NAME_ALT = 'file_upload'; + + use ApiOperations\Create { + create as protected _create; + } + + public static function classUrl() + { + return '/v1/files'; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File the created file + */ + public static function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (null === $opts->apiBase) { + $opts->apiBase = Stripe::$apiUploadBase; + } + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return static::_create($flatParams, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/FileLink.php b/vendor/stripe/stripe-php/lib/FileLink.php index ce3b10b..23eab02 100644 --- a/vendor/stripe/stripe-php/lib/FileLink.php +++ b/vendor/stripe/stripe-php/lib/FileLink.php @@ -1,30 +1,30 @@ -File object with non-Stripe users, you - * can create a FileLink. FileLinks contain a URL that - * can be used to retrieve the contents of the file without authentication. - * - * @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 bool $expired Whether this link is already expired. - * @property null|int $expires_at Time at which the link expires. - * @property string|\Stripe\File $file The file object this link points to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $url The publicly accessible URL to download the file. - */ -class FileLink extends ApiResource -{ - const OBJECT_NAME = 'file_link'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +File object with non-Stripe users, you + * can create a FileLink. FileLinks contain a URL that + * can be used to retrieve the contents of the file without authentication. + * + * @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 bool $expired Whether this link is already expired. + * @property null|int $expires_at Time at which the link expires. + * @property string|\Stripe\File $file The file object this link points to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $url The publicly accessible URL to download the file. + */ +class FileLink extends ApiResource +{ + const OBJECT_NAME = 'file_link'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php b/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php new file mode 100644 index 0000000..13d6724 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/FinancialConnections/Account.php @@ -0,0 +1,84 @@ +subcategory. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution. + * @property string $institution_name The name of the institution that holds this account. + * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners. + * @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners. + * @property null|string[] $permissions The list of permissions granted by this account. + * @property string $status The status of the link to the account. + * @property string $subcategory

If category is cash, one of:

- checking - savings - other

If category is credit, one of:

- mortgage - line_of_credit - credit_card - other

If category is investment or other, this will be other.

+ * @property string[] $supported_payment_method_types The PaymentMethod type(s) that can be created from this account. + */ +class Account extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.account'; + + use \Stripe\ApiOperations\Retrieve; + + const CATEGORY_CASH = 'cash'; + const CATEGORY_CREDIT = 'credit'; + const CATEGORY_INVESTMENT = 'investment'; + const CATEGORY_OTHER = 'other'; + + const STATUS_ACTIVE = 'active'; + const STATUS_DISCONNECTED = 'disconnected'; + const STATUS_INACTIVE = 'inactive'; + + const SUBCATEGORY_CHECKING = 'checking'; + const SUBCATEGORY_CREDIT_CARD = 'credit_card'; + const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit'; + const SUBCATEGORY_MORTGAGE = 'mortgage'; + const SUBCATEGORY_OTHER = 'other'; + const SUBCATEGORY_SAVINGS = 'savings'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account the disconnected account + */ + public function disconnect($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/disconnect'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account the refreshed account + */ + public function refresh($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/refresh'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php b/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php new file mode 100644 index 0000000..0ab0ca9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php @@ -0,0 +1,20 @@ + $owners A paginated list of owners for this account. + */ +class AccountOwnership extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.account_ownership'; +} diff --git a/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php b/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php new file mode 100644 index 0000000..2a0dc26 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/FinancialConnections/Session.php @@ -0,0 +1,27 @@ + $accounts The accounts that were collected as part of this Session. + * @property string $client_secret A value that will be passed to the client to launch the authentication flow. + * @property \Stripe\StripeObject $filters + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string[] $permissions Permissions requested for accounts collected during this session. + * @property string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.session'; + + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/FundingInstructions.php b/vendor/stripe/stripe-php/lib/FundingInstructions.php new file mode 100644 index 0000000..9bf1b47 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/FundingInstructions.php @@ -0,0 +1,28 @@ +balance + * that is automatically applied to future invoices and payments using the + * customer_balance payment method. Customers can fund this balance by + * initiating a bank transfer to any account in the + * financial_addresses field. Related guide: Customer + * 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 + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $funding_type The funding_type of the returned instructions + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + */ +class FundingInstructions extends ApiResource +{ + const OBJECT_NAME = 'funding_instructions'; + + const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; +} diff --git a/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php b/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php index 3c7861e..0dca25b 100644 --- a/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php +++ b/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php @@ -1,22 +1,22 @@ -defaultOptions = $defaultOptions; - $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); - $this->initUserAgentInfo(); - - $this->enableHttp2 = $this->canSafelyUseHttp2(); - } - - public function __destruct() - { - $this->closeCurlHandle(); - } - - public function initUserAgentInfo() - { - $curlVersion = \curl_version(); - $this->userAgentInfo = [ - 'httplib' => 'curl ' . $curlVersion['version'], - 'ssllib' => $curlVersion['ssl_version'], - ]; - } - - public function getDefaultOptions() - { - return $this->defaultOptions; - } - - public function getUserAgentInfo() - { - return $this->userAgentInfo; - } - - /** - * @return bool - */ - public function getEnablePersistentConnections() - { - return $this->enablePersistentConnections; - } - - /** - * @param bool $enable - */ - public function setEnablePersistentConnections($enable) - { - $this->enablePersistentConnections = $enable; - } - - /** - * @return bool - */ - public function getEnableHttp2() - { - return $this->enableHttp2; - } - - /** - * @param bool $enable - */ - public function setEnableHttp2($enable) - { - $this->enableHttp2 = $enable; - } - - /** - * @return null|callable - */ - public function getRequestStatusCallback() - { - return $this->requestStatusCallback; - } - - /** - * Sets a callback that is called after each request. The callback will - * receive the following parameters: - *
    - *
  1. string $rbody The response body
  2. - *
  3. integer $rcode The response status code
  4. - *
  5. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
  6. - *
  7. integer $errno The curl error number
  8. - *
  9. string|null $message The curl error message
  10. - *
  11. boolean $shouldRetry Whether the request will be retried
  12. - *
  13. integer $numRetries The number of the retry attempt
  14. - *
. - * - * @param null|callable $requestStatusCallback - */ - public function setRequestStatusCallback($requestStatusCallback) - { - $this->requestStatusCallback = $requestStatusCallback; - } - - // USER DEFINED TIMEOUTS - - const DEFAULT_TIMEOUT = 80; - const DEFAULT_CONNECT_TIMEOUT = 30; - - private $timeout = self::DEFAULT_TIMEOUT; - private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT; - - public function setTimeout($seconds) - { - $this->timeout = (int) \max($seconds, 0); - - return $this; - } - - public function setConnectTimeout($seconds) - { - $this->connectTimeout = (int) \max($seconds, 0); - - return $this; - } - - public function getTimeout() - { - return $this->timeout; - } - - public function getConnectTimeout() - { - return $this->connectTimeout; - } - - // END OF USER DEFINED TIMEOUTS - - private function constructRequest($method, $absUrl, $headers, $params, $hasFile) - { - $method = \strtolower($method); - - $opts = []; - if (\is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value - $opts = \call_user_func_array($this->defaultOptions, \func_get_args()); - if (!\is_array($opts)) { - throw new Exception\UnexpectedValueException('Non-array value returned by defaultOptions CurlClient callback'); - } - } elseif (\is_array($this->defaultOptions)) { // set default curlopts from array - $opts = $this->defaultOptions; - } - - $params = Util\Util::objectsToIds($params); - - if ('get' === $method) { - if ($hasFile) { - throw new Exception\UnexpectedValueException( - 'Issuing a GET request with a file parameter' - ); - } - $opts[\CURLOPT_HTTPGET] = 1; - if (\count($params) > 0) { - $encoded = Util\Util::encodeParameters($params); - $absUrl = "{$absUrl}?{$encoded}"; - } - } elseif ('post' === $method) { - $opts[\CURLOPT_POST] = 1; - $opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); - } elseif ('delete' === $method) { - $opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE'; - if (\count($params) > 0) { - $encoded = Util\Util::encodeParameters($params); - $absUrl = "{$absUrl}?{$encoded}"; - } - } else { - throw new Exception\UnexpectedValueException("Unrecognized method {$method}"); - } - - // It is only safe to retry network failures on POST requests if we - // add an Idempotency-Key header - if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) { - if (!$this->hasHeader($headers, 'Idempotency-Key')) { - $headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid(); - } - } - - // By default for large request body sizes (> 1024 bytes), cURL will - // send a request without a body and with a `Expect: 100-continue` - // header, which gives the server a chance to respond with an error - // status code in cases where one can be determined right away (say - // on an authentication problem for example), and saves the "large" - // request body from being ever sent. - // - // Unfortunately, the bindings don't currently correctly handle the - // success case (in which the server sends back a 100 CONTINUE), so - // we'll error under that condition. To compensate for that problem - // for the time being, override cURL's behavior by simply always - // sending an empty `Expect:` header. - $headers[] = 'Expect: '; - - $absUrl = Util\Util::utf8($absUrl); - $opts[\CURLOPT_URL] = $absUrl; - $opts[\CURLOPT_RETURNTRANSFER] = true; - $opts[\CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout; - $opts[\CURLOPT_TIMEOUT] = $this->timeout; - $opts[\CURLOPT_HTTPHEADER] = $headers; - $opts[\CURLOPT_CAINFO] = Stripe::getCABundlePath(); - if (!Stripe::getVerifySslCerts()) { - $opts[\CURLOPT_SSL_VERIFYPEER] = false; - } - - if (!isset($opts[\CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) { - // For HTTPS requests, enable HTTP/2, if supported - $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; - } - - // Stripe's API servers are only accessible over IPv4. Force IPv4 resolving to avoid - // potential issues (cf. https://github.com/stripe/stripe-php/issues/1045). - $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; - - return [$opts, $absUrl]; - } - - public function request($method, $absUrl, $headers, $params, $hasFile) - { - list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); - - list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); - - return [$rbody, $rcode, $rheaders]; - } - - public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk) - { - list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); - - $opts[\CURLOPT_RETURNTRANSFER] = false; - list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); - - return [$rbody, $rcode, $rheaders]; - } - - /** - * Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines - * from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes - * from the body. You usually want to handle the body differently depending - * on what was in the header. - * - * This function makes it easier to specify different callbacks depending - * on the contents of the heeder. After the header has been completely read - * and the body begins to stream, it will call $determineWriteCallback with - * the array of headers. $determineWriteCallback should, based on the - * headers it receives, return a "writeCallback" that describes what to do - * with the incoming HTTP response body. - * - * @param array $opts - * @param callable $determineWriteCallback - * - * @return array - */ - private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) - { - $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { - return self::parseLineIntoHeaderArray($header_line, $rheaders); - }; - - $writeCallback = null; - $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { - if (null === $writeCallback) { - $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); - } - - return \call_user_func_array($writeCallback, [$curl, $data]); - }; - - return [$headerCallback, $writeCallbackWrapper]; - } - - private static function parseLineIntoHeaderArray($line, &$headers) - { - if (false === \strpos($line, ':')) { - return \strlen($line); - } - list($key, $value) = \explode(':', \trim($line), 2); - $headers[\trim($key)] = \trim($value); - - return \strlen($line); - } - - /** - * Like `executeRequestWithRetries` except: - * 1. Does not buffer the body of a successful (status code < 300) - * response into memory -- instead, calls the caller-provided - * $readBodyChunk with each chunk of incoming data. - * 2. Does not retry if a network error occurs while streaming the - * body of a successful response. - * - * @param array $opts cURL options - * @param string $absUrl - * @param callable @readBodyChunk - * @param mixed $readBodyChunk - * - * @return array - */ - public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) - { - /** @var bool */ - $shouldRetry = false; - /** @var int */ - $numRetries = 0; - - // Will contain the bytes of the body of the last request - // if it was not successful and should not be retries - /** @var null|string */ - $rbody = null; - - // Status code of the last request - /** @var null|bool */ - $rcode = null; - - // Array of headers from the last request - /** @var null|array */ - $lastRHeaders = null; - - $errno = null; - $message = null; - - $determineWriteCallback = function ($rheaders) use ( - &$readBodyChunk, - &$shouldRetry, - &$rbody, - &$numRetries, - &$rcode, - &$lastRHeaders, - &$errno - ) { - $lastRHeaders = $rheaders; - $errno = \curl_errno($this->curlHandle); - - $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); - - // Send the bytes from the body of a successful request to the caller-provided $readBodyChunk. - if ($rcode < 300) { - $rbody = null; - - return function ($curl, $data) use (&$readBodyChunk) { - // Don't expose the $curl handle to the user, and don't require them to - // return the length of $data. - \call_user_func_array($readBodyChunk, [$data]); - - return \strlen($data); - }; - } - - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); - - // Discard the body from an unsuccessful request that should be retried. - if ($shouldRetry) { - return function ($curl, $data) { - return \strlen($data); - }; - } else { - // Otherwise, buffer the body into $rbody. It will need to be parsed to determine - // which exception to throw to the user. - $rbody = ''; - - return function ($curl, $data) use (&$rbody) { - $rbody .= $data; - - return \strlen($data); - }; - } - }; - - while (true) { - list($headerCallback, $writeCallback) = $this->useHeadersToDetermineWriteCallback($opts, $determineWriteCallback); - $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; - $opts[\CURLOPT_WRITEFUNCTION] = $writeCallback; - - $shouldRetry = false; - $rbody = null; - $this->resetCurlHandle(); - \curl_setopt_array($this->curlHandle, $opts); - $result = \curl_exec($this->curlHandle); - $errno = \curl_errno($this->curlHandle); - if (0 !== $errno) { - $message = \curl_error($this->curlHandle); - } - if (!$this->getEnablePersistentConnections()) { - $this->closeCurlHandle(); - } - - if (\is_callable($this->getRequestStatusCallback())) { - \call_user_func_array( - $this->getRequestStatusCallback(), - [$rbody, $rcode, $lastRHeaders, $errno, $message, $shouldRetry, $numRetries] - ); - } - - if ($shouldRetry) { - ++$numRetries; - $sleepSeconds = $this->sleepTime($numRetries, $lastRHeaders); - \usleep((int) ($sleepSeconds * 1000000)); - } else { - break; - } - } - - if (0 !== $errno) { - $this->handleCurlError($absUrl, $errno, $message, $numRetries); - } - - return [$rbody, $rcode, $lastRHeaders]; - } - - /** - * @param array $opts cURL options - * @param string $absUrl - */ - public function executeRequestWithRetries($opts, $absUrl) - { - $numRetries = 0; - - while (true) { - $rcode = 0; - $errno = 0; - $message = null; - - // Create a callback to capture HTTP headers for the response - $rheaders = new Util\CaseInsensitiveArray(); - $headerCallback = function ($curl, $header_line) use (&$rheaders) { - return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); - }; - $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; - - $this->resetCurlHandle(); - \curl_setopt_array($this->curlHandle, $opts); - $rbody = \curl_exec($this->curlHandle); - - if (false === $rbody) { - $errno = \curl_errno($this->curlHandle); - $message = \curl_error($this->curlHandle); - } else { - $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); - } - if (!$this->getEnablePersistentConnections()) { - $this->closeCurlHandle(); - } - - $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); - - if (\is_callable($this->getRequestStatusCallback())) { - \call_user_func_array( - $this->getRequestStatusCallback(), - [$rbody, $rcode, $rheaders, $errno, $message, $shouldRetry, $numRetries] - ); - } - - if ($shouldRetry) { - ++$numRetries; - $sleepSeconds = $this->sleepTime($numRetries, $rheaders); - \usleep((int) ($sleepSeconds * 1000000)); - } else { - break; - } - } - - if (false === $rbody) { - $this->handleCurlError($absUrl, $errno, $message, $numRetries); - } - - return [$rbody, $rcode, $rheaders]; - } - - /** - * @param string $url - * @param int $errno - * @param string $message - * @param int $numRetries - * - * @throws Exception\ApiConnectionException - */ - private function handleCurlError($url, $errno, $message, $numRetries) - { - switch ($errno) { - case \CURLE_COULDNT_CONNECT: - case \CURLE_COULDNT_RESOLVE_HOST: - case \CURLE_OPERATION_TIMEOUTED: - $msg = "Could not connect to Stripe ({$url}). Please check your " - . 'internet connection and try again. If this problem persists, ' - . "you should check Stripe's service status at " - . 'https://twitter.com/stripestatus, or'; - - break; - - case \CURLE_SSL_CACERT: - case \CURLE_SSL_PEER_CERTIFICATE: - $msg = "Could not verify Stripe's SSL certificate. Please make sure " - . 'that your network is not intercepting certificates. ' - . "(Try going to {$url} in your browser.) " - . 'If this problem persists,'; - - break; - - default: - $msg = 'Unexpected error communicating with Stripe. ' - . 'If this problem persists,'; - } - $msg .= ' let us know at support@stripe.com.'; - - $msg .= "\n\n(Network error [errno {$errno}]: {$message})"; - - if ($numRetries > 0) { - $msg .= "\n\nRequest was retried {$numRetries} times."; - } - - throw new Exception\ApiConnectionException($msg); - } - - /** - * Checks if an error is a problem that we should retry on. This includes both - * socket errors that may represent an intermittent problem and some special - * HTTP statuses. - * - * @param int $errno - * @param int $rcode - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders - * @param int $numRetries - * - * @return bool - */ - private function shouldRetry($errno, $rcode, $rheaders, $numRetries) - { - if ($numRetries >= Stripe::getMaxNetworkRetries()) { - return false; - } - - // Retry on timeout-related problems (either on open or read). - if (\CURLE_OPERATION_TIMEOUTED === $errno) { - return true; - } - - // Destination refused the connection, the connection was reset, or a - // variety of other connection failures. This could occur from a single - // saturated server, so retry in case it's intermittent. - if (\CURLE_COULDNT_CONNECT === $errno) { - return true; - } - - // The API may ask us not to retry (eg; if doing so would be a no-op) - // or advise us to retry (eg; in cases of lock timeouts); we defer to that. - if (isset($rheaders['stripe-should-retry'])) { - if ('false' === $rheaders['stripe-should-retry']) { - return false; - } - if ('true' === $rheaders['stripe-should-retry']) { - return true; - } - } - - // 409 Conflict - if (409 === $rcode) { - return true; - } - - // Retry on 500, 503, and other internal errors. - // - // Note that we expect the stripe-should-retry header to be false - // in most cases when a 500 is returned, since our idempotency framework - // would typically replay it anyway. - if ($rcode >= 500) { - return true; - } - - return false; - } - - /** - * Provides the number of seconds to wait before retrying a request. - * - * @param int $numRetries - * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders - * - * @return int - */ - private function sleepTime($numRetries, $rheaders) - { - // Apply exponential backoff with $initialNetworkRetryDelay on the - // number of $numRetries so far as inputs. Do not allow the number to exceed - // $maxNetworkRetryDelay. - $sleepSeconds = \min( - Stripe::getInitialNetworkRetryDelay() * 1.0 * 2 ** ($numRetries - 1), - Stripe::getMaxNetworkRetryDelay() - ); - - // Apply some jitter by randomizing the value in the range of - // ($sleepSeconds / 2) to ($sleepSeconds). - $sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat()); - - // But never sleep less than the base sleep seconds. - $sleepSeconds = \max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds); - - // And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. - $retryAfter = isset($rheaders['retry-after']) ? (float) ($rheaders['retry-after']) : 0.0; - if (\floor($retryAfter) === $retryAfter && $retryAfter <= Stripe::getMaxRetryAfter()) { - $sleepSeconds = \max($sleepSeconds, $retryAfter); - } - - return $sleepSeconds; - } - - /** - * Initializes the curl handle. If already initialized, the handle is closed first. - */ - private function initCurlHandle() - { - $this->closeCurlHandle(); - $this->curlHandle = \curl_init(); - } - - /** - * Closes the curl handle if initialized. Do nothing if already closed. - */ - private function closeCurlHandle() - { - if (null !== $this->curlHandle) { - \curl_close($this->curlHandle); - $this->curlHandle = null; - } - } - - /** - * Resets the curl handle. If the handle is not already initialized, or if persistent - * connections are disabled, the handle is reinitialized instead. - */ - private function resetCurlHandle() - { - if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) { - \curl_reset($this->curlHandle); - } else { - $this->initCurlHandle(); - } - } - - /** - * Indicates whether it is safe to use HTTP/2 or not. - * - * @return bool - */ - private function canSafelyUseHttp2() - { - // Versions of curl older than 7.60.0 don't respect GOAWAY frames - // (cf. https://github.com/curl/curl/issues/2416), which Stripe use. - $curlVersion = \curl_version()['version']; - - return \version_compare($curlVersion, '7.60.0') >= 0; - } - - /** - * Checks if a list of headers contains a specific header name. - * - * @param string[] $headers - * @param string $name - * - * @return bool - */ - private function hasHeader($headers, $name) - { - foreach ($headers as $header) { - if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) { - return true; - } - } - - return false; - } -} +defaultOptions = $defaultOptions; + $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); + $this->initUserAgentInfo(); + + $this->enableHttp2 = $this->canSafelyUseHttp2(); + } + + public function __destruct() + { + $this->closeCurlHandle(); + } + + public function initUserAgentInfo() + { + $curlVersion = \curl_version(); + $this->userAgentInfo = [ + 'httplib' => 'curl ' . $curlVersion['version'], + 'ssllib' => $curlVersion['ssl_version'], + ]; + } + + public function getDefaultOptions() + { + return $this->defaultOptions; + } + + public function getUserAgentInfo() + { + return $this->userAgentInfo; + } + + /** + * @return bool + */ + public function getEnablePersistentConnections() + { + return $this->enablePersistentConnections; + } + + /** + * @param bool $enable + */ + public function setEnablePersistentConnections($enable) + { + $this->enablePersistentConnections = $enable; + } + + /** + * @return bool + */ + public function getEnableHttp2() + { + return $this->enableHttp2; + } + + /** + * @param bool $enable + */ + public function setEnableHttp2($enable) + { + $this->enableHttp2 = $enable; + } + + /** + * @return null|callable + */ + public function getRequestStatusCallback() + { + return $this->requestStatusCallback; + } + + /** + * Sets a callback that is called after each request. The callback will + * receive the following parameters: + *
    + *
  1. string $rbody The response body
  2. + *
  3. integer $rcode The response status code
  4. + *
  5. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
  6. + *
  7. integer $errno The curl error number
  8. + *
  9. string|null $message The curl error message
  10. + *
  11. boolean $shouldRetry Whether the request will be retried
  12. + *
  13. integer $numRetries The number of the retry attempt
  14. + *
. + * + * @param null|callable $requestStatusCallback + */ + public function setRequestStatusCallback($requestStatusCallback) + { + $this->requestStatusCallback = $requestStatusCallback; + } + + // USER DEFINED TIMEOUTS + + const DEFAULT_TIMEOUT = 80; + const DEFAULT_CONNECT_TIMEOUT = 30; + + private $timeout = self::DEFAULT_TIMEOUT; + private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT; + + public function setTimeout($seconds) + { + $this->timeout = (int) \max($seconds, 0); + + return $this; + } + + public function setConnectTimeout($seconds) + { + $this->connectTimeout = (int) \max($seconds, 0); + + return $this; + } + + public function getTimeout() + { + return $this->timeout; + } + + public function getConnectTimeout() + { + return $this->connectTimeout; + } + + // END OF USER DEFINED TIMEOUTS + + private function constructRequest($method, $absUrl, $headers, $params, $hasFile) + { + $method = \strtolower($method); + + $opts = []; + if (\is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value + $opts = \call_user_func_array($this->defaultOptions, \func_get_args()); + if (!\is_array($opts)) { + throw new Exception\UnexpectedValueException('Non-array value returned by defaultOptions CurlClient callback'); + } + } elseif (\is_array($this->defaultOptions)) { // set default curlopts from array + $opts = $this->defaultOptions; + } + + $params = Util\Util::objectsToIds($params); + + if ('get' === $method) { + if ($hasFile) { + throw new Exception\UnexpectedValueException( + 'Issuing a GET request with a file parameter' + ); + } + $opts[\CURLOPT_HTTPGET] = 1; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } elseif ('post' === $method) { + $opts[\CURLOPT_POST] = 1; + $opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); + } elseif ('delete' === $method) { + $opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE'; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } else { + throw new Exception\UnexpectedValueException("Unrecognized method {$method}"); + } + + // It is only safe to retry network failures on POST requests if we + // add an Idempotency-Key header + if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) { + if (!$this->hasHeader($headers, 'Idempotency-Key')) { + $headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid(); + } + } + + // By default for large request body sizes (> 1024 bytes), cURL will + // send a request without a body and with a `Expect: 100-continue` + // header, which gives the server a chance to respond with an error + // status code in cases where one can be determined right away (say + // on an authentication problem for example), and saves the "large" + // request body from being ever sent. + // + // Unfortunately, the bindings don't currently correctly handle the + // success case (in which the server sends back a 100 CONTINUE), so + // we'll error under that condition. To compensate for that problem + // for the time being, override cURL's behavior by simply always + // sending an empty `Expect:` header. + $headers[] = 'Expect: '; + + $absUrl = Util\Util::utf8($absUrl); + $opts[\CURLOPT_URL] = $absUrl; + $opts[\CURLOPT_RETURNTRANSFER] = true; + $opts[\CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout; + $opts[\CURLOPT_TIMEOUT] = $this->timeout; + $opts[\CURLOPT_HTTPHEADER] = $headers; + $opts[\CURLOPT_CAINFO] = Stripe::getCABundlePath(); + if (!Stripe::getVerifySslCerts()) { + $opts[\CURLOPT_SSL_VERIFYPEER] = false; + } + + if (!isset($opts[\CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) { + // For HTTPS requests, enable HTTP/2, if supported + $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; + } + + // If the user didn't explicitly specify a CURLOPT_IPRESOLVE option, we + // force IPv4 resolving as Stripe's API servers are only accessible over + // IPv4 (see. https://github.com/stripe/stripe-php/issues/1045). + // We let users specify a custom option in case they need to say proxy + // through an IPv6 proxy. + if (!isset($opts[\CURLOPT_IPRESOLVE])) { + $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + } + + return [$opts, $absUrl]; + } + + public function request($method, $absUrl, $headers, $params, $hasFile) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); + + list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); + + return [$rbody, $rcode, $rheaders]; + } + + public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); + + $opts[\CURLOPT_RETURNTRANSFER] = false; + list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); + + return [$rbody, $rcode, $rheaders]; + } + + /** + * Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines + * from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes + * from the body. You usually want to handle the body differently depending + * on what was in the header. + * + * This function makes it easier to specify different callbacks depending + * on the contents of the heeder. After the header has been completely read + * and the body begins to stream, it will call $determineWriteCallback with + * the array of headers. $determineWriteCallback should, based on the + * headers it receives, return a "writeCallback" that describes what to do + * with the incoming HTTP response body. + * + * @param array $opts + * @param callable $determineWriteCallback + * + * @return array + */ + private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) + { + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + return self::parseLineIntoHeaderArray($header_line, $rheaders); + }; + + $writeCallback = null; + $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { + if (null === $writeCallback) { + $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); + } + + return \call_user_func_array($writeCallback, [$curl, $data]); + }; + + return [$headerCallback, $writeCallbackWrapper]; + } + + private static function parseLineIntoHeaderArray($line, &$headers) + { + if (false === \strpos($line, ':')) { + return \strlen($line); + } + list($key, $value) = \explode(':', \trim($line), 2); + $headers[\trim($key)] = \trim($value); + + return \strlen($line); + } + + /** + * Like `executeRequestWithRetries` except: + * 1. Does not buffer the body of a successful (status code < 300) + * response into memory -- instead, calls the caller-provided + * $readBodyChunk with each chunk of incoming data. + * 2. Does not retry if a network error occurs while streaming the + * body of a successful response. + * + * @param array $opts cURL options + * @param string $absUrl + * @param callable $readBodyChunk + * + * @return array + */ + public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) + { + /** @var bool */ + $shouldRetry = false; + /** @var int */ + $numRetries = 0; + + // Will contain the bytes of the body of the last request + // if it was not successful and should not be retries + /** @var null|string */ + $rbody = null; + + // Status code of the last request + /** @var null|bool */ + $rcode = null; + + // Array of headers from the last request + /** @var null|array */ + $lastRHeaders = null; + + $errno = null; + $message = null; + + $determineWriteCallback = function ($rheaders) use ( + &$readBodyChunk, + &$shouldRetry, + &$rbody, + &$numRetries, + &$rcode, + &$lastRHeaders, + &$errno + ) { + $lastRHeaders = $rheaders; + $errno = \curl_errno($this->curlHandle); + + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + + // Send the bytes from the body of a successful request to the caller-provided $readBodyChunk. + if ($rcode < 300) { + $rbody = null; + + return function ($curl, $data) use (&$readBodyChunk) { + // Don't expose the $curl handle to the user, and don't require them to + // return the length of $data. + \call_user_func_array($readBodyChunk, [$data]); + + return \strlen($data); + }; + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + // Discard the body from an unsuccessful request that should be retried. + if ($shouldRetry) { + return function ($curl, $data) { + return \strlen($data); + }; + } else { + // Otherwise, buffer the body into $rbody. It will need to be parsed to determine + // which exception to throw to the user. + $rbody = ''; + + return function ($curl, $data) use (&$rbody) { + $rbody .= $data; + + return \strlen($data); + }; + } + }; + + while (true) { + list($headerCallback, $writeCallback) = $this->useHeadersToDetermineWriteCallback($opts, $determineWriteCallback); + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + $opts[\CURLOPT_WRITEFUNCTION] = $writeCallback; + + $shouldRetry = false; + $rbody = null; + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $result = \curl_exec($this->curlHandle); + $errno = \curl_errno($this->curlHandle); + if (0 !== $errno) { + $message = \curl_error($this->curlHandle); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $lastRHeaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $lastRHeaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (0 !== $errno) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $lastRHeaders]; + } + + /** + * @param array $opts cURL options + * @param string $absUrl + */ + public function executeRequestWithRetries($opts, $absUrl) + { + $numRetries = 0; + + while (true) { + $rcode = 0; + $errno = 0; + $message = null; + + // Create a callback to capture HTTP headers for the response + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); + }; + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $rbody = \curl_exec($this->curlHandle); + + if (false === $rbody) { + $errno = \curl_errno($this->curlHandle); + $message = \curl_error($this->curlHandle); + } else { + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $rheaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $rheaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (false === $rbody) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $rheaders]; + } + + /** + * @param string $url + * @param int $errno + * @param string $message + * @param int $numRetries + * + * @throws Exception\ApiConnectionException + */ + private function handleCurlError($url, $errno, $message, $numRetries) + { + switch ($errno) { + case \CURLE_COULDNT_CONNECT: + case \CURLE_COULDNT_RESOLVE_HOST: + case \CURLE_OPERATION_TIMEOUTED: + $msg = "Could not connect to Stripe ({$url}). Please check your " + . 'internet connection and try again. If this problem persists, ' + . "you should check Stripe's service status at " + . 'https://twitter.com/stripestatus, or'; + + break; + + case \CURLE_SSL_CACERT: + case \CURLE_SSL_PEER_CERTIFICATE: + $msg = "Could not verify Stripe's SSL certificate. Please make sure " + . 'that your network is not intercepting certificates. ' + . "(Try going to {$url} in your browser.) " + . 'If this problem persists,'; + + break; + + default: + $msg = 'Unexpected error communicating with Stripe. ' + . 'If this problem persists,'; + } + $msg .= ' let us know at support@stripe.com.'; + + $msg .= "\n\n(Network error [errno {$errno}]: {$message})"; + + if ($numRetries > 0) { + $msg .= "\n\nRequest was retried {$numRetries} times."; + } + + throw new Exception\ApiConnectionException($msg); + } + + /** + * Checks if an error is a problem that we should retry on. This includes both + * socket errors that may represent an intermittent problem and some special + * HTTP statuses. + * + * @param int $errno + * @param int $rcode + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * @param int $numRetries + * + * @return bool + */ + private function shouldRetry($errno, $rcode, $rheaders, $numRetries) + { + if ($numRetries >= Stripe::getMaxNetworkRetries()) { + return false; + } + + // Retry on timeout-related problems (either on open or read). + if (\CURLE_OPERATION_TIMEOUTED === $errno) { + return true; + } + + // Destination refused the connection, the connection was reset, or a + // variety of other connection failures. This could occur from a single + // saturated server, so retry in case it's intermittent. + if (\CURLE_COULDNT_CONNECT === $errno) { + return true; + } + + // The API may ask us not to retry (eg; if doing so would be a no-op) + // or advise us to retry (eg; in cases of lock timeouts); we defer to that. + if (isset($rheaders['stripe-should-retry'])) { + if ('false' === $rheaders['stripe-should-retry']) { + return false; + } + if ('true' === $rheaders['stripe-should-retry']) { + return true; + } + } + + // 409 Conflict + if (409 === $rcode) { + return true; + } + + // Retry on 500, 503, and other internal errors. + // + // Note that we expect the stripe-should-retry header to be false + // in most cases when a 500 is returned, since our idempotency framework + // would typically replay it anyway. + if ($rcode >= 500) { + return true; + } + + return false; + } + + /** + * Provides the number of seconds to wait before retrying a request. + * + * @param int $numRetries + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * + * @return int + */ + private function sleepTime($numRetries, $rheaders) + { + // Apply exponential backoff with $initialNetworkRetryDelay on the + // number of $numRetries so far as inputs. Do not allow the number to exceed + // $maxNetworkRetryDelay. + $sleepSeconds = \min( + Stripe::getInitialNetworkRetryDelay() * 1.0 * 2 ** ($numRetries - 1), + Stripe::getMaxNetworkRetryDelay() + ); + + // Apply some jitter by randomizing the value in the range of + // ($sleepSeconds / 2) to ($sleepSeconds). + $sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat()); + + // But never sleep less than the base sleep seconds. + $sleepSeconds = \max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds); + + // And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. + $retryAfter = isset($rheaders['retry-after']) ? (float) ($rheaders['retry-after']) : 0.0; + if (\floor($retryAfter) === $retryAfter && $retryAfter <= Stripe::getMaxRetryAfter()) { + $sleepSeconds = \max($sleepSeconds, $retryAfter); + } + + return $sleepSeconds; + } + + /** + * Initializes the curl handle. If already initialized, the handle is closed first. + */ + private function initCurlHandle() + { + $this->closeCurlHandle(); + $this->curlHandle = \curl_init(); + } + + /** + * Closes the curl handle if initialized. Do nothing if already closed. + */ + private function closeCurlHandle() + { + if (null !== $this->curlHandle) { + \curl_close($this->curlHandle); + $this->curlHandle = null; + } + } + + /** + * Resets the curl handle. If the handle is not already initialized, or if persistent + * connections are disabled, the handle is reinitialized instead. + */ + private function resetCurlHandle() + { + if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) { + \curl_reset($this->curlHandle); + } else { + $this->initCurlHandle(); + } + } + + /** + * Indicates whether it is safe to use HTTP/2 or not. + * + * @return bool + */ + private function canSafelyUseHttp2() + { + // Versions of curl older than 7.60.0 don't respect GOAWAY frames + // (cf. https://github.com/curl/curl/issues/2416), which Stripe use. + $curlVersion = \curl_version()['version']; + + return \version_compare($curlVersion, '7.60.0') >= 0; + } + + /** + * Checks if a list of headers contains a specific header name. + * + * @param string[] $headers + * @param string $name + * + * @return bool + */ + private function hasHeader($headers, $name) + { + foreach ($headers as $header) { + if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) { + return true; + } + } + + return false; + } +} diff --git a/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php b/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php new file mode 100644 index 0000000..e3e1100 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php @@ -0,0 +1,23 @@ +type and options parameters used. You can find the - * result of each verification check performed in the appropriate sub-resource: - * document, id_number, selfie. - * - * Each VerificationReport contains a copy of any data collected by the user as - * well as reference IDs which can be used to access collected images through the - * FileUpload API. To configure and - * create VerificationReports, use the VerificationSession - * API. - * - * Related guides: Accessing - * verification results. - * - * @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 \Stripe\StripeObject $document Result from a document check - * @property \Stripe\StripeObject $id_number Result from an id_number check - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $options - * @property \Stripe\StripeObject $selfie Result from a selfie check - * @property string $type Type of report. - * @property null|string $verification_session ID of the VerificationSession that created this report. - */ -class VerificationReport extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'identity.verification_report'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - const TYPE_DOCUMENT = 'document'; - const TYPE_ID_NUMBER = 'id_number'; -} +type and options parameters used. You can find the + * result of each verification check performed in the appropriate sub-resource: + * document, id_number, selfie. + * + * Each VerificationReport contains a copy of any data collected by the user as + * well as reference IDs which can be used to access collected images through the + * FileUpload API. To configure and + * create VerificationReports, use the VerificationSession + * API. + * + * Related guides: Accessing + * verification results. + * + * @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 \Stripe\StripeObject $document Result from a document check + * @property \Stripe\StripeObject $id_number Result from an id_number check + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $options + * @property \Stripe\StripeObject $selfie Result from a selfie check + * @property string $type Type of report. + * @property null|string $verification_session ID of the VerificationSession that created this report. + */ +class VerificationReport extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_report'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; +} diff --git a/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php b/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php index 7e2d6a0..65296cc 100644 --- a/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php +++ b/vendor/stripe/stripe-php/lib/Identity/VerificationSession.php @@ -1,88 +1,88 @@ -verification check to perform. - * Only create one VerificationSession for each verification in your system. - * - * A VerificationSession transitions through multiple statuses throughout its - * lifetime as it progresses through the verification flow. The VerificationSession - * contains the user’s verified data after verification checks are complete. - * - * Related guide: The Verification - * Sessions API - * - * @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 null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. - * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $options - * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. - * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. - * @property string $type The type of verification check to be performed. - * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 24 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. - * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. - */ -class VerificationSession extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'identity.verification_session'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_INPUT = 'requires_input'; - const STATUS_VERIFIED = 'verified'; - - const TYPE_DOCUMENT = 'document'; - const TYPE_ID_NUMBER = 'id_number'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\VerificationSession the canceled verification session - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\VerificationSession the redacted verification session - */ - public function redact($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/redact'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +verification check to perform. + * Only create one VerificationSession for each verification in your system. + * + * A VerificationSession transitions through multiple statuses throughout its + * lifetime as it progresses through the verification flow. The VerificationSession + * contains the user’s verified data after verification checks are complete. + * + * Related guide: The Verification + * Sessions API + * + * @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 null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. + * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $options + * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. + * @property string $type The type of verification check to be performed. + * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. + * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. + */ +class VerificationSession extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_INPUT = 'requires_input'; + const STATUS_VERIFIED = 'verified'; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession the canceled verification session + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession the redacted verification session + */ + public function redact($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/redact'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Invoice.php b/vendor/stripe/stripe-php/lib/Invoice.php index 5ced41d..4a24993 100644 --- a/vendor/stripe/stripe-php/lib/Invoice.php +++ b/vendor/stripe/stripe-php/lib/Invoice.php @@ -1,262 +1,283 @@ -invoice - * items, and proration adjustments that may be caused by subscription - * upgrades/downgrades (if necessary). - * - * If your invoice is configured to be billed through automatic charges, Stripe - * automatically finalizes your invoice and attempts payment. Note that finalizing - * the invoice, when - * automatic, does not happen immediately as the invoice is created. Stripe - * waits until one hour after the last webhook was successfully sent (or the last - * webhook timed out after failing). If you (and the platforms you may have - * connected to) have no webhooks configured, Stripe waits one hour after creation - * to finalize the invoice. - * - * If your invoice is configured to be billed by sending an email, then based on - * your email - * settings, Stripe will email the invoice to your customer and await payment. - * These emails can contain a link to a hosted page to pay the invoice. - * - * Stripe applies any customer credit on the account before determining the amount - * due for the invoice (i.e., the amount that will be actually charged). If the - * amount due for the invoice is less than Stripe's minimum allowed - * charge per currency, the invoice is automatically marked paid, and we add - * the amount due to the customer's credit balance which is applied to the next - * invoice. - * - * More details on the customer's credit balance are here. - * - * Related guide: Send - * Invoices to Customers. - * - * @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 null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. - * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. - * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. - * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. - * @property int $amount_paid The amount, in %s, that was paid. - * @property int $amount_remaining The amount remaining, in %s, that is due. - * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. - * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. - * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. - * @property \Stripe\StripeObject $automatic_tax - * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. - * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. - * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. - * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. - * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. - * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. - * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. - * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. - * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. - * @property null|string $footer Footer displayed on the invoice. - * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. - * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. - * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. - * @property \Stripe\Collection $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. - * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. - * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. - * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. - * @property \Stripe\StripeObject $payment_settings - * @property int $period_end End of the usage period during which invoice items were added to this invoice. - * @property int $period_start Start of the usage period during which invoice items were added to this invoice. - * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. - * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. - * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. - * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. - * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more - * @property \Stripe\StripeObject $status_transitions - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. - * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. - * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated - * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. - * @property \Stripe\StripeObject $threshold_reason - * @property int $total Total after discounts and taxes. - * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. - * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. - * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. - */ -class Invoice extends ApiResource -{ - const OBJECT_NAME = 'invoice'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; - const BILLING_SEND_INVOICE = 'send_invoice'; - - const BILLING_REASON_MANUAL = 'manual'; - const BILLING_REASON_SUBSCRIPTION = 'subscription'; - const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; - const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; - const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold'; - const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update'; - const BILLING_REASON_UPCOMING = 'upcoming'; - - const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; - const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; - - const STATUS_DELETED = 'deleted'; - const STATUS_DRAFT = 'draft'; - const STATUS_OPEN = 'open'; - const STATUS_PAID = 'paid'; - const STATUS_UNCOLLECTIBLE = 'uncollectible'; - const STATUS_VOID = 'void'; - - use ApiOperations\NestedResource; - - const PATH_LINES = '/lines'; - - /** - * @param string $id the ID of the invoice on which to retrieve the lines - * @param null|array $params - * @param null|array|string $opts - * - * @throws StripeExceptionApiErrorException if the request fails - * - * @return \Stripe\Collection the list of lines (InvoiceLineItem) - */ - public static function allLines($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the finalized invoice - */ - public function finalizeInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/finalize'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the uncollectible invoice - */ - public function markUncollectible($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/mark_uncollectible'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the paid invoice - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the sent invoice - */ - public function sendInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/send'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the upcoming invoice - */ - public static function upcoming($params = null, $opts = null) - { - $url = static::classUrl() . '/upcoming'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice the voided invoice - */ - public function voidInvoice($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/void'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +invoice + * items, and proration adjustments that may be caused by subscription + * upgrades/downgrades (if necessary). + * + * If your invoice is configured to be billed through automatic charges, Stripe + * automatically finalizes your invoice and attempts payment. Note that finalizing + * the invoice, when + * automatic, does not happen immediately as the invoice is created. Stripe + * waits until one hour after the last webhook was successfully sent (or the last + * webhook timed out after failing). If you (and the platforms you may have + * connected to) have no webhooks configured, Stripe waits one hour after creation + * to finalize the invoice. + * + * If your invoice is configured to be billed by sending an email, then based on + * your email + * settings, Stripe will email the invoice to your customer and await payment. + * These emails can contain a link to a hosted page to pay the invoice. + * + * Stripe applies any customer credit on the account before determining the amount + * due for the invoice (i.e., the amount that will be actually charged). If the + * amount due for the invoice is less than Stripe's minimum allowed + * charge per currency, the invoice is automatically marked paid, and we add + * the amount due to the customer's credit balance which is applied to the next + * invoice. + * + * More details on the customer's credit balance are here. + * + * Related guide: Send + * Invoices to Customers. + * + * @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 null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. + * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. + * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. + * @property int $amount_paid The amount, in %s, that was paid. + * @property int $amount_remaining The amount remaining, in %s, that is due. + * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice. + * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. + * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. + * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property \Stripe\StripeObject $automatic_tax + * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. + * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. + * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. + * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. + * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. + * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $footer Footer displayed on the invoice. + * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + * @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. + * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. + * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + * @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + * @property \Stripe\StripeObject $payment_settings + * @property int $period_end End of the usage period during which invoice items were added to this invoice. + * @property int $period_start Start of the usage period during which invoice items were added to this invoice. + * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. + * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. + * @property null|string|\Stripe\Quote $quote The quote this invoice was generated from. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. + * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. + * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. + * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. + * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to. + * @property \Stripe\StripeObject $threshold_reason + * @property int $total Total after discounts and taxes. + * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. + * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + */ +class Invoice extends ApiResource +{ + const OBJECT_NAME = 'invoice'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const BILLING_SEND_INVOICE = 'send_invoice'; + + const BILLING_REASON_MANUAL = 'manual'; + const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept'; + const BILLING_REASON_SUBSCRIPTION = 'subscription'; + const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; + const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; + const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold'; + const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update'; + const BILLING_REASON_UPCOMING = 'upcoming'; + + const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; + + const STATUS_DELETED = 'deleted'; + const STATUS_DRAFT = 'draft'; + const STATUS_OPEN = 'open'; + const STATUS_PAID = 'paid'; + const STATUS_UNCOLLECTIBLE = 'uncollectible'; + const STATUS_VOID = 'void'; + + use ApiOperations\NestedResource; + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the invoice on which to retrieve the lines + * @param null|array $params + * @param null|array|string $opts + * + * @throws StripeExceptionApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of lines (InvoiceLineItem) + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the finalized invoice + */ + public function finalizeInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the uncollectible invoice + */ + public function markUncollectible($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/mark_uncollectible'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the paid invoice + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the sent invoice + */ + public function sendInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/send'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the upcoming invoice + */ + public static function upcoming($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the voided invoice + */ + public function voidInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the invoice search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/invoices/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/InvoiceItem.php b/vendor/stripe/stripe-php/lib/InvoiceItem.php index 6153bbf..d2a852a 100644 --- a/vendor/stripe/stripe-php/lib/InvoiceItem.php +++ b/vendor/stripe/stripe-php/lib/InvoiceItem.php @@ -1,49 +1,50 @@ -Subscription - * Invoices. - * - * @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 $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. - * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. - * @property null|\Stripe\Price $price The price of the invoice item. - * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. - * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. - * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. - * @property string $subscription_item The subscription item that this invoice item has been created for, if any. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. - * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. - * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. - */ -class InvoiceItem extends ApiResource -{ - const OBJECT_NAME = 'invoiceitem'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +Subscription + * Invoices. + * + * @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 $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. + * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. + * @property null|\Stripe\Price $price The price of the invoice item. + * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. + * @property string $subscription_item The subscription item that this invoice item has been created for, if any. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. + * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class InvoiceItem extends ApiResource +{ + const OBJECT_NAME = 'invoiceitem'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/InvoiceLineItem.php b/vendor/stripe/stripe-php/lib/InvoiceLineItem.php index e579afb..7a9ae51 100644 --- a/vendor/stripe/stripe-php/lib/InvoiceLineItem.php +++ b/vendor/stripe/stripe-php/lib/InvoiceLineItem.php @@ -1,33 +1,34 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. - * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. - * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property string $invoice_item The ID of the invoice item associated with this line item if any. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. - * @property \Stripe\StripeObject $period - * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. - * @property null|\Stripe\Price $price The price of the line item. - * @property bool $proration Whether this is a proration. - * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. - * @property null|string $subscription The subscription that the invoice item pertains to, if any. - * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. - * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. - */ -class InvoiceLineItem extends ApiResource -{ - const OBJECT_NAME = 'line_item'; -} +ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. + * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property string $invoice_item The ID of the invoice item associated with this line item if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. + * @property null|\Stripe\Price $price The price of the line item. + * @property bool $proration Whether this is a proration. + * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items + * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. + * @property null|string $subscription The subscription that the invoice item pertains to, if any. + * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. + */ +class InvoiceLineItem extends ApiResource +{ + const OBJECT_NAME = 'line_item'; +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Authorization.php b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php index a649235..a21007a 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/Authorization.php +++ b/vendor/stripe/stripe-php/lib/Issuing/Authorization.php @@ -1,81 +1,81 @@ -issued card is used to - * make a purchase, an Issuing Authorization object is created. Authorizations - * must be approved for the purchase to be completed successfully. - * - * Related guide: Issued Card - * Authorizations. - * - * @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 $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. - * @property bool $approved Whether the authorization has been approved. - * @property string $authorization_method How the card details were provided. - * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. - * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. - * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\StripeObject $merchant_data - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. - * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. - * @property string $status The current status of the authorization in its lifecycle. - * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. - * @property \Stripe\StripeObject $verification_data - * @property null|string $wallet What, if any, digital wallet was used for this authorization. One of apple_pay, google_pay, or samsung_pay. - */ -class Authorization extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.authorization'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Authorization the approved authorization - */ - public function approve($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/approve'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Authorization the declined authorization - */ - public function decline($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/decline'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +issued card is used to + * make a purchase, an Issuing Authorization object is created. Authorizations + * must be approved for the purchase to be completed successfully. + * + * Related guide: Issued Card + * Authorizations. + * + * @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 $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property bool $approved Whether the authorization has been approved. + * @property string $authorization_method How the card details were provided. + * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. + * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. + * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. + * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. + * @property string $status The current status of the authorization in its lifecycle. + * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. + * @property \Stripe\StripeObject $verification_data + * @property null|string $wallet The digital wallet used for this authorization. One of apple_pay, google_pay, or samsung_pay. + */ +class Authorization extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.authorization'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization the approved authorization + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization the declined authorization + */ + public function decline($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/decline'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Card.php b/vendor/stripe/stripe-php/lib/Issuing/Card.php index e0ac774..f94101a 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/Card.php +++ b/vendor/stripe/stripe-php/lib/Issuing/Card.php @@ -1,59 +1,60 @@ -create physical or - * virtual cards that are issued to cardholders. - * - * @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 string $brand The brand of the card. - * @property null|string $cancellation_reason The reason why the card was canceled. - * @property \Stripe\Issuing\Cardholder $cardholder

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a Cardholder

- * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. - * @property int $exp_month The expiration month of the card. - * @property int $exp_year The expiration year of the card. - * @property string $last4 The last 4 digits of the card number. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. - * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. - * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. - * @property null|string $replacement_reason The reason why the previous card needed to be replaced. - * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. - * @property \Stripe\StripeObject $spending_controls - * @property string $status Whether authorizations can be approved on this card. - * @property string $type The type of the card. - */ -class Card extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.card'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card - */ - public function details($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/details'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } -} +create physical or + * virtual cards that are issued to cardholders. + * + * @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 string $brand The brand of the card. + * @property null|string $cancellation_reason The reason why the card was canceled. + * @property \Stripe\Issuing\Cardholder $cardholder

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a Cardholder

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property int $exp_month The expiration month of the card. + * @property int $exp_year The expiration year of the card. + * @property string $last4 The last 4 digits of the card number. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. + * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. + * @property null|string $replacement_reason The reason why the previous card needed to be replaced. + * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. + * @property \Stripe\StripeObject $spending_controls + * @property string $status Whether authorizations can be approved on this card. + * @property string $type The type of the card. + * @property null|\Stripe\StripeObject $wallets Information relating to digital wallets (like Apple Pay and Google Pay). + */ +class Card extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.card'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card + */ + public function details($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/details'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php b/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php index 98f4e0b..2097a55 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php +++ b/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php @@ -1,19 +1,19 @@ -Cardholder object represents an individual or business - * entity who is issued cards. - * - * Related guide: How to create a - * Cardholder - * - * @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 \Stripe\StripeObject $billing - * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $email The cardholder's email address. - * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The cardholder's name. This will be printed on cards issued to them. - * @property null|string $phone_number The cardholder's phone number. - * @property \Stripe\StripeObject $requirements - * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. - * @property string $status Specifies whether to permit authorizations on this cardholder's cards. - * @property string $type One of individual or company. - */ -class Cardholder extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.cardholder'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +Cardholder object represents an individual or business + * entity who is issued cards. + * + * Related guide: How to create a + * Cardholder + * + * @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 \Stripe\StripeObject $billing + * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $email The cardholder's email address. + * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The cardholder's name. This will be printed on cards issued to them. + * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. + * @property string $status Specifies whether to permit authorizations on this cardholder's cards. + * @property string $type One of individual or company. + */ +class Cardholder extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.cardholder'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Dispute.php b/vendor/stripe/stripe-php/lib/Issuing/Dispute.php index 2a80c3b..49aa2f2 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/Dispute.php +++ b/vendor/stripe/stripe-php/lib/Issuing/Dispute.php @@ -1,53 +1,53 @@ -card issuer, you can dispute - * transactions that the cardholder does not recognize, suspects to be fraudulent, - * or has other issues with. - * - * Related guide: Disputing - * Transactions - * - * @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 $amount Disputed amount. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). - * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency The currency the transaction was made in. - * @property \Stripe\StripeObject $evidence - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $status Current status of the dispute. - * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. - */ -class Dispute extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.dispute'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute the submited dispute - */ - public function submit($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/submit'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +card issuer, you can dispute + * transactions that the cardholder does not recognize, suspects to be fraudulent, + * or has other issues with. + * + * Related guide: Disputing + * Transactions + * + * @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 $amount Disputed amount. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency The currency the transaction was made in. + * @property \Stripe\StripeObject $evidence + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $status Current status of the dispute. + * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. + */ +class Dispute extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.dispute'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute the submited dispute + */ + public function submit($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/submit'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Issuing/Transaction.php b/vendor/stripe/stripe-php/lib/Issuing/Transaction.php index 3c44d7e..e9b9021 100644 --- a/vendor/stripe/stripe-php/lib/Issuing/Transaction.php +++ b/vendor/stripe/stripe-php/lib/Issuing/Transaction.php @@ -1,43 +1,44 @@ -issued card that - * results in funds entering or leaving your Stripe account, such as a completed - * purchase or refund, is represented by an Issuing Transaction - * object. - * - * Related guide: Issued Card - * Transactions. - * - * @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 $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. - * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. - * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. - * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. - * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. - * @property string $merchant_currency The currency with which the merchant is taking payment. - * @property \Stripe\StripeObject $merchant_data - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. - * @property string $type The nature of the transaction. - */ -class Transaction extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'issuing.transaction'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +issued card that + * results in funds entering or leaving your Stripe account, such as a completed + * purchase or refund, is represented by an Issuing Transaction + * object. + * + * Related guide: Issued Card + * Transactions. + * + * @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 $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. + * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. + * @property string $merchant_currency The currency with which the merchant is taking payment. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property string $type The nature of the transaction. + * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. + */ +class Transaction extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.transaction'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/LineItem.php b/vendor/stripe/stripe-php/lib/LineItem.php index 0a41346..80c2a61 100644 --- a/vendor/stripe/stripe-php/lib/LineItem.php +++ b/vendor/stripe/stripe-php/lib/LineItem.php @@ -1,26 +1,26 @@ -ISO currency code, in lowercase. Must be a supported currency. - * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. - * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. - * @property null|\Stripe\Price $price The price used to generate the line item. - * @property null|int $quantity The quantity of products being purchased. - * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. - */ -class LineItem extends ApiResource -{ - const OBJECT_NAME = 'item'; - - use ApiOperations\All; -} +ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. + * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. + * @property null|\Stripe\Price $price The price used to generate the line item. + * @property null|int $quantity The quantity of products being purchased. + * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. + */ +class LineItem extends ApiResource +{ + const OBJECT_NAME = 'item'; + + use ApiOperations\All; +} diff --git a/vendor/stripe/stripe-php/lib/LoginLink.php b/vendor/stripe/stripe-php/lib/LoginLink.php index 3351356..a016fca 100644 --- a/vendor/stripe/stripe-php/lib/LoginLink.php +++ b/vendor/stripe/stripe-php/lib/LoginLink.php @@ -1,15 +1,15 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $multi_use - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. - * @property \Stripe\StripeObject $payment_method_details - * @property \Stripe\StripeObject $single_use - * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. - * @property string $type The type of the mandate. - */ -class Mandate extends ApiResource -{ - const OBJECT_NAME = 'mandate'; - - use ApiOperations\Retrieve; -} +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $multi_use + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. + * @property \Stripe\StripeObject $payment_method_details + * @property \Stripe\StripeObject $single_use + * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. + * @property string $type The type of the mandate. + */ +class Mandate extends ApiResource +{ + const OBJECT_NAME = 'mandate'; + + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/OAuth.php b/vendor/stripe/stripe-php/lib/OAuth.php index 7b0886e..71deeae 100644 --- a/vendor/stripe/stripe-php/lib/OAuth.php +++ b/vendor/stripe/stripe-php/lib/OAuth.php @@ -1,101 +1,101 @@ -request( - 'post', - '/oauth/token', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - /** - * Disconnects an account from your platform. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return StripeObject object containing the response from the API - */ - public static function deauthorize($params = null, $opts = null) - { - $params = $params ?: []; - $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; - $requestor = new ApiRequestor(null, $base); - $params['client_id'] = self::_getClientId($params); - list($response, $apiKey) = $requestor->request( - 'post', - '/oauth/deauthorize', - $params, - null - ); - - return Util\Util::convertToStripeObject($response->json, $opts); - } - - private static function _getClientId($params = null) - { - $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; - if (null === $clientId) { - $clientId = Stripe::getClientId(); - } - if (null === $clientId) { - $msg = 'No client_id provided. (HINT: set your client_id using ' - . '"Stripe::setClientId()". You can find your client_ids ' - . 'in your Stripe dashboard at ' - . 'https://dashboard.stripe.com/account/applications/settings, ' - . 'after registering your account as a platform. See ' - . 'https://stripe.com/docs/connect/standard-accounts for details, ' - . 'or email support@stripe.com if you have any questions.'; - - throw new Exception\AuthenticationException($msg); - } - - return $clientId; - } -} +request( + 'post', + '/oauth/token', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return StripeObject object containing the response from the API + */ + public static function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; + $requestor = new ApiRequestor(null, $base); + $params['client_id'] = self::_getClientId($params); + list($response, $apiKey) = $requestor->request( + 'post', + '/oauth/deauthorize', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + private static function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + if (null === $clientId) { + $clientId = Stripe::getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '"Stripe::setClientId()". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + return $clientId; + } +} diff --git a/vendor/stripe/stripe-php/lib/OAuthErrorObject.php b/vendor/stripe/stripe-php/lib/OAuthErrorObject.php index 620c5bb..945cb66 100644 --- a/vendor/stripe/stripe-php/lib/OAuthErrorObject.php +++ b/vendor/stripe/stripe-php/lib/OAuthErrorObject.php @@ -1,31 +1,31 @@ - null, - 'error_description' => null, - ], $values); - parent::refreshFrom($values, $opts, $partial); - } -} + null, + 'error_description' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/vendor/stripe/stripe-php/lib/Order.php b/vendor/stripe/stripe-php/lib/Order.php index 52fa2c7..0396e21 100644 --- a/vendor/stripe/stripe-php/lib/Order.php +++ b/vendor/stripe/stripe-php/lib/Order.php @@ -1,81 +1,81 @@ -products. You can - * create, retrieve, and pay individual orders, as well as list all orders. Orders - * are identified by a unique, random ID. - * - * Related guide: 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 int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. - * @property null|int $amount_returned The total amount that was returned to the customer. - * @property null|string $application ID of the Connect Application that created the order. - * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. - * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer used for the order. - * @property null|string $email The email address of the customer placing the order. - * @property string $external_coupon_code External coupon code to load for this order. - * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order. - * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. - * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. - * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. - * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. - * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. - * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. - */ -class Order extends ApiResource -{ - const OBJECT_NAME = 'order'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn the newly created return - */ - public function returnOrder($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/returns'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order the paid order - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +products. You can + * create, retrieve, and pay individual orders, as well as list all orders. Orders + * are identified by a unique, random ID. + * + * Related guide: 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 int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + * @property null|int $amount_returned The total amount that was returned to the customer. + * @property null|string $application ID of the Connect Application that created the order. + * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. + * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The customer used for the order. + * @property null|string $email The email address of the customer placing the order. + * @property string $external_coupon_code External coupon code to load for this order. + * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\Collection<\Stripe\OrderReturn> $returns A list of returns that have taken place for this order. + * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. + * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. + * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. + * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. + * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. + * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. + */ +class Order extends ApiResource +{ + const OBJECT_NAME = 'order'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn the newly created return + */ + public function returnOrder($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/returns'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order the paid order + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/OrderItem.php b/vendor/stripe/stripe-php/lib/OrderItem.php index e2e6e39..48c558d 100644 --- a/vendor/stripe/stripe-php/lib/OrderItem.php +++ b/vendor/stripe/stripe-php/lib/OrderItem.php @@ -1,19 +1,19 @@ -order items. Returns always - * belong to an order, and may optionally contain a refund. - * - * Related guide: Handling - * Returns. - * - * @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 $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\OrderItem[] $items The items included in this order return. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Order $order The order that this return includes items from. - * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. - */ -class OrderReturn extends ApiResource -{ - const OBJECT_NAME = 'order_return'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} +order items. Returns always + * belong to an order, and may optionally contain a refund. + * + * Related guide: Handling + * Returns. + * + * @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 $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\OrderItem[] $items The items included in this order return. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Order $order The order that this return includes items from. + * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. + */ +class OrderReturn extends ApiResource +{ + const OBJECT_NAME = 'order_return'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/PaymentIntent.php b/vendor/stripe/stripe-php/lib/PaymentIntent.php index 7a02f1f..8fcde39 100644 --- a/vendor/stripe/stripe-php/lib/PaymentIntent.php +++ b/vendor/stripe/stripe-php/lib/PaymentIntent.php @@ -1,125 +1,195 @@ -multiple - * statuses throughout its lifetime as it interfaces with Stripe.js to perform - * authentication flows and ultimately creates at most one successful charge. - * - * Related guide: Payment Intents API. - * - * @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 $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - * @property int $amount_capturable Amount that can be captured from this PaymentIntent. - * @property int $amount_received Amount that was collected by this PaymentIntent. - * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. - * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. - * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. - * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). - * @property string $capture_method Controls when the funds will be captured from the customer's account. - * @property \Stripe\Collection $charges Charges that were created by this PaymentIntent, if any. - * @property null|string $client_secret

The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to accept a payment and learn about how client_secret should be handled.

- * @property string $confirmation_method - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

- * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. - * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the documentation. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. - * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. - * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. - * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. - * @property null|string $setup_future_usage

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 $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. - * @property null|\Stripe\StripeObject $transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details. - * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details. - */ -class PaymentIntent extends ApiResource -{ - const OBJECT_NAME = 'payment_intent'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_ACTION = 'requires_action'; - const STATUS_REQUIRES_CAPTURE = 'requires_capture'; - const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; - const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the canceled payment intent - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the captured payment intent - */ - public function capture($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/capture'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent the confirmed payment intent - */ - public function confirm($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/confirm'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +multiple + * statuses throughout its lifetime as it interfaces with Stripe.js to perform + * authentication flows and ultimately creates at most one successful charge. + * + * Related guide: Payment Intents API. + * + * @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 $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_capturable Amount that can be captured from this PaymentIntent. + * @property \Stripe\StripeObject $amount_details + * @property int $amount_received Amount that was collected by this PaymentIntent. + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. + * @property null|\Stripe\StripeObject $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard + * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). + * @property string $capture_method Controls when the funds will be captured from the customer's account. + * @property \Stripe\Collection<\Stripe\Charge> $charges Charges that were created by this PaymentIntent, if any. + * @property null|string $client_secret

The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to accept a payment and learn about how client_secret should be handled.

+ * @property string $confirmation_method + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. + * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the documentation. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + * @property null|\Stripe\StripeObject $processing If present, this property tells you about the processing state of the payment. + * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. + * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. + * @property null|string $setup_future_usage

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 $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. + * @property null|\Stripe\StripeObject $transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details. + * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details. + */ +class PaymentIntent extends ApiResource +{ + const OBJECT_NAME = 'payment_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CAPTURE = 'requires_capture'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the applied payment intent + */ + public function applyCustomerBalance($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/apply_customer_balance'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the canceled payment intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the captured payment intent + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the confirmed payment intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the incremented payment intent + */ + public function incrementAuthorization($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/increment_authorization'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the verified payment intent + */ + public function verifyMicrodeposits($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify_microdeposits'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the payment intent search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/payment_intents/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/PaymentLink.php b/vendor/stripe/stripe-php/lib/PaymentLink.php new file mode 100644 index 0000000..1d9e538 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/PaymentLink.php @@ -0,0 +1,70 @@ +checkout session to + * render the payment page. You can use checkout + * session events to track payments through payment links. + * + * Related guide: Payment Links API + * + * @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 payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated. + * @property \Stripe\StripeObject $after_completion + * @property bool $allow_promotion_codes Whether user redeemable promotion codes are enabled. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + * @property null|float $application_fee_percent This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + * @property \Stripe\StripeObject $automatic_tax + * @property string $billing_address_collection Configuration for collecting the customer's billing address. + * @property \Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. + * @property \Stripe\StripeObject $phone_number_collection + * @property null|\Stripe\StripeObject $shipping_address_collection Configuration for collecting the customer's shipping address. + * @property null|\Stripe\StripeObject $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + * @property string $url The public URL that can be shared with customers. + */ +class PaymentLink extends ApiResource +{ + const OBJECT_NAME = 'payment_link'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; + const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + + /** + * @param null|array $params + * @param null|array|string $opts + * @param mixed $id + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\PaymentLink> list of LineItems + */ + public static function allLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/PaymentMethod.php b/vendor/stripe/stripe-php/lib/PaymentMethod.php index 36a01d3..f0f2fd9 100644 --- a/vendor/stripe/stripe-php/lib/PaymentMethod.php +++ b/vendor/stripe/stripe-php/lib/PaymentMethod.php @@ -1,90 +1,95 @@ -PaymentIntents to - * collect payments or saved to Customer objects to store instrument details for - * future payments. - * - * Related guides: Payment Methods and - * More Payment - * Scenarios. - * - * @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 \Stripe\StripeObject $acss_debit - * @property \Stripe\StripeObject $afterpay_clearpay - * @property \Stripe\StripeObject $alipay - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bacs_debit - * @property \Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $billing_details - * @property \Stripe\StripeObject $boleto - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. - * @property \Stripe\StripeObject $eps - * @property \Stripe\StripeObject $fpx - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $grabpay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $interac_present - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $oxxo - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort - * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. - * @property \Stripe\StripeObject $wechat_pay - */ -class PaymentMethod extends ApiResource -{ - const OBJECT_NAME = 'payment_method'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod the attached payment method - */ - public function attach($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/attach'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod the detached payment method - */ - public function detach($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/detach'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +PaymentIntents to + * collect payments or save them to Customer objects to store instrument details + * for future payments. + * + * Related guides: Payment Methods and + * More Payment + * Scenarios. + * + * @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 \Stripe\StripeObject $acss_debit + * @property \Stripe\StripeObject $afterpay_clearpay + * @property \Stripe\StripeObject $alipay + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bacs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $billing_details + * @property \Stripe\StripeObject $boleto + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + * @property \Stripe\StripeObject $customer_balance + * @property \Stripe\StripeObject $eps + * @property \Stripe\StripeObject $fpx + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $grabpay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $interac_present + * @property \Stripe\StripeObject $klarna + * @property \Stripe\StripeObject $konbini + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $oxxo + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $paynow + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + * @property \Stripe\StripeObject $us_bank_account + * @property \Stripe\StripeObject $wechat_pay + */ +class PaymentMethod extends ApiResource +{ + const OBJECT_NAME = 'payment_method'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod the attached payment method + */ + public function attach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/attach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod the detached payment method + */ + public function detach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/detach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Payout.php b/vendor/stripe/stripe-php/lib/Payout.php index edbe492..efd9e5a 100644 --- a/vendor/stripe/stripe-php/lib/Payout.php +++ b/vendor/stripe/stripe-php/lib/Payout.php @@ -1,108 +1,108 @@ -Payout object is created when you receive funds from Stripe, or - * when you initiate a payout to either a bank account or debit card of a connected Stripe account. You - * can retrieve individual payouts, as well as list all payouts. Payouts are made - * on varying schedules, - * depending on your country and industry. - * - * Related guide: Receiving Payouts. - * - * @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 $amount Amount (in %s) to be transferred to your bank account or debit card. - * @property int $arrival_date Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. - * @property bool $automatic Returns true if the payout was created by an automated payout schedule, and false if it was requested manually. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to. - * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. - * @property null|string $failure_code Error code explaining reason for payout failure if available. See Types of payout failures for a list of failure codes. - * @property null|string $failure_message Message to user further explaining reason for payout failure if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) - * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. - * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. - * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. - * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. - * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it is submitted to the bank, when it becomes in_transit. The status then changes to paid if the transaction goes through, or to failed or canceled (within 5 business days). Some failed payouts may initially show as paid but then change to failed. - * @property string $type Can be bank_account or card. - */ -class Payout extends ApiResource -{ - const OBJECT_NAME = 'payout'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FAILURE_ACCOUNT_CLOSED = 'account_closed'; - const FAILURE_ACCOUNT_FROZEN = 'account_frozen'; - const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted'; - const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed'; - const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; - const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; - const FAILURE_DECLINED = 'declined'; - const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; - const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; - const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; - const FAILURE_INVALID_CURRENCY = 'invalid_currency'; - const FAILURE_NO_ACCOUNT = 'no_account'; - const FAILURE_UNSUPPORTED_CARD = 'unsupported_card'; - - const METHOD_INSTANT = 'instant'; - const METHOD_STANDARD = 'standard'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_IN_TRANSIT = 'in_transit'; - const STATUS_PAID = 'paid'; - const STATUS_PENDING = 'pending'; - - const TYPE_BANK_ACCOUNT = 'bank_account'; - const TYPE_CARD = 'card'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout the canceled payout - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout the reversed payout - */ - public function reverse($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/reverse'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Payout object is created when you receive funds from Stripe, or + * when you initiate a payout to either a bank account or debit card of a connected Stripe account. You + * can retrieve individual payouts, as well as list all payouts. Payouts are made + * on varying schedules, + * depending on your country and industry. + * + * Related guide: Receiving Payouts. + * + * @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 $amount Amount (in %s) to be transferred to your bank account or debit card. + * @property int $arrival_date Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. + * @property bool $automatic Returns true if the payout was created by an automated payout schedule, and false if it was requested manually. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to. + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. + * @property null|string $failure_code Error code explaining reason for payout failure if available. See Types of payout failures for a list of failure codes. + * @property null|string $failure_message Message to user further explaining reason for payout failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) + * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. + * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. + * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. + * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. + * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it is submitted to the bank, when it becomes in_transit. The status then changes to paid if the transaction goes through, or to failed or canceled (within 5 business days). Some failed payouts may initially show as paid but then change to failed. + * @property string $type Can be bank_account or card. + */ +class Payout extends ApiResource +{ + const OBJECT_NAME = 'payout'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_ACCOUNT_CLOSED = 'account_closed'; + const FAILURE_ACCOUNT_FROZEN = 'account_frozen'; + const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted'; + const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed'; + const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; + const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const FAILURE_DECLINED = 'declined'; + const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; + const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; + const FAILURE_INVALID_CURRENCY = 'invalid_currency'; + const FAILURE_NO_ACCOUNT = 'no_account'; + const FAILURE_UNSUPPORTED_CARD = 'unsupported_card'; + + const METHOD_INSTANT = 'instant'; + const METHOD_STANDARD = 'standard'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_IN_TRANSIT = 'in_transit'; + const STATUS_PAID = 'paid'; + const STATUS_PENDING = 'pending'; + + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout the canceled payout + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout the reversed payout + */ + public function reverse($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reverse'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Person.php b/vendor/stripe/stripe-php/lib/Person.php index ad2b46f..73529ff 100644 --- a/vendor/stripe/stripe-php/lib/Person.php +++ b/vendor/stripe/stripe-php/lib/Person.php @@ -1,120 +1,123 @@ -Standard onboarding - * or Express onboarding - * documentation for information about platform pre-filling and account - * onboarding steps. - * - * Related guide: Handling - * Identity Verification with the API. - * - * @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 string $account The account the person is associated with. - * @property \Stripe\StripeObject $address - * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). - * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $dob - * @property null|string $email The person's email address. - * @property null|string $first_name The person's first name. - * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). - * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). - * @property null|string $gender The person's gender (International regulations require either "male" or "female"). - * @property bool $id_number_provided Whether the person's id_number was provided. - * @property null|string $last_name The person's last name. - * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). - * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). - * @property null|string $maiden_name The person's maiden name. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $nationality The country where the person is a national. - * @property null|string $phone The person's phone number. - * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - * @property \Stripe\StripeObject $relationship - * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. - * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). - * @property \Stripe\StripeObject $verification - */ -class Person extends ApiResource -{ - const OBJECT_NAME = 'person'; - - use ApiOperations\Delete; - use ApiOperations\Update; - - const GENDER_FEMALE = 'female'; - const GENDER_MALE = 'male'; - - const POLITICAL_EXPOSURE_EXISTING = 'existing'; - const POLITICAL_EXPOSURE_NONE = 'none'; - - const VERIFICATION_STATUS_PENDING = 'pending'; - const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; - const VERIFICATION_STATUS_VERIFIED = 'verified'; - - /** - * @return string the API URL for this Stripe account reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $account = $this['account']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $account = Util\Util::utf8($account); - - $base = Account::classUrl(); - $accountExtn = \urlencode($account); - $extn = \urlencode($id); - - return "{$base}/{$accountExtn}/persons/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . - "a person using `Account::retrievePerson('account_id', " . - "'person_id')`."; - - throw new Exception\BadMethodCallException($msg); - } - - /** - * @param string $_id - * @param null|array $_params - * @param null|array|string $_options - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function update($_id, $_params = null, $_options = null) - { - $msg = 'Persons cannot be updated without an account ID. Update ' . - "a person using `Account::updatePerson('account_id', " . - "'person_id', \$updateParams)`."; - - throw new Exception\BadMethodCallException($msg); - } -} +Standard onboarding + * or Express onboarding + * documentation for information about platform pre-filling and account + * onboarding steps. + * + * Related guide: Handling + * Identity Verification with the API. + * + * @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 string $account The account the person is associated with. + * @property \Stripe\StripeObject $address + * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). + * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $dob + * @property null|string $email The person's email address. + * @property null|string $first_name The person's first name. + * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). + * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). + * @property string[] $full_name_aliases A list of alternate names or aliases that the person is known by. + * @property null|\Stripe\StripeObject $future_requirements Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. + * @property null|string $gender The person's gender (International regulations require either "male" or "female"). + * @property bool $id_number_provided Whether the person's id_number was provided. + * @property null|string $last_name The person's last name. + * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). + * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). + * @property null|string $maiden_name The person's maiden name. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $nationality The country where the person is a national. + * @property null|string $phone The person's phone number. + * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + * @property \Stripe\StripeObject $registered_address + * @property \Stripe\StripeObject $relationship + * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. + * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). + * @property \Stripe\StripeObject $verification + */ +class Person extends ApiResource +{ + const OBJECT_NAME = 'person'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + const GENDER_FEMALE = 'female'; + const GENDER_MALE = 'male'; + + const POLITICAL_EXPOSURE_EXISTING = 'existing'; + const POLITICAL_EXPOSURE_NONE = 'none'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/persons/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . + "a person using `Account::retrievePerson('account_id', " . + "'person_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Persons cannot be updated without an account ID. Update ' . + "a person using `Account::updatePerson('account_id', " . + "'person_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/Plan.php b/vendor/stripe/stripe-php/lib/Plan.php index 2a818e4..5022bbe 100644 --- a/vendor/stripe/stripe-php/lib/Plan.php +++ b/vendor/stripe/stripe-php/lib/Plan.php @@ -1,57 +1,57 @@ -Prices API. It replaces the Plans - * API and is backwards compatible to simplify your migration. - * - * Plans define the base price, currency, and billing cycle for recurring purchases - * of products. Products help - * you track inventory or provisioning, and plans help you track pricing. Different - * physical goods or levels of service should be represented by products, and - * pricing options should be represented by plans. This approach lets you change - * prices without having to change your provisioning scheme. - * - * For example, you might have a single "gold" product that has plans for - * $10/month, $100/year, €9/month, and €90/year. - * - * Related guides: Set up - * a subscription and more about products and prices. - * - * @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 plan can be used for new purchases. - * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. - * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. - * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. - * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. - * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $nickname A brief description of the plan, hidden from customers. - * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. - * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. - * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. - * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. - */ -class Plan extends ApiResource -{ - const OBJECT_NAME = 'plan'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +Prices API. It replaces the Plans + * API and is backwards compatible to simplify your migration. + * + * Plans define the base price, currency, and billing cycle for recurring purchases + * of products. Products help + * you track inventory or provisioning, and plans help you track pricing. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by plans. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has plans for + * $10/month, $100/year, €9/month, and €90/year. + * + * Related guides: Set up + * a subscription and more about products and prices. + * + * @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 plan can be used for new purchases. + * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. + * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. + * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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 $nickname A brief description of the plan, hidden from customers. + * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. + * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. + */ +class Plan extends ApiResource +{ + const OBJECT_NAME = 'plan'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Price.php b/vendor/stripe/stripe-php/lib/Price.php index 8f994d5..dea0655 100644 --- a/vendor/stripe/stripe-php/lib/Price.php +++ b/vendor/stripe/stripe-php/lib/Price.php @@ -1,67 +1,83 @@ -Products help you track - * inventory or provisioning, and prices help you track payment terms. Different - * physical goods or levels of service should be represented by products, and - * pricing options should be represented by prices. This approach lets you change - * prices without having to change your provisioning scheme. - * - * For example, you might have a single "gold" product that has prices - * for $10/month, $100/year, and €9 once. - * - * Related guides: Set up - * a subscription, create an invoice, - * and more about products - * and prices. - * - * @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 price can be used for new purchases. - * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $nickname A brief description of the price, hidden from customers. - * @property string|\Stripe\Product $product The ID of the product this price is associated with. - * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. - * @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. - * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. - * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. - * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. - * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. - */ -class Price extends ApiResource -{ - const OBJECT_NAME = 'price'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const BILLING_SCHEME_PER_UNIT = 'per_unit'; - const BILLING_SCHEME_TIERED = 'tiered'; - - const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; - const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; - const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; - - const TIERS_MODE_GRADUATED = 'graduated'; - const TIERS_MODE_VOLUME = 'volume'; - - const TYPE_ONE_TIME = 'one_time'; - const TYPE_RECURRING = 'recurring'; -} +Products help you track + * inventory or provisioning, and prices help you track payment terms. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by prices. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has prices + * for $10/month, $100/year, and €9 once. + * + * Related guides: Set up + * a subscription, create an invoice, + * and more about products and prices. + * + * @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 price can be used for new purchases. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $nickname A brief description of the price, hidden from customers. + * @property string|\Stripe\Product $product The ID of the product this price is associated with. + * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. + * @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + */ +class Price extends ApiResource +{ + const OBJECT_NAME = 'price'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const BILLING_SCHEME_PER_UNIT = 'per_unit'; + const BILLING_SCHEME_TIERED = 'tiered'; + + const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; + const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; + const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; + + const TIERS_MODE_GRADUATED = 'graduated'; + const TIERS_MODE_VOLUME = 'volume'; + + const TYPE_ONE_TIME = 'one_time'; + const TYPE_RECURRING = 'recurring'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the price search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/prices/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Product.php b/vendor/stripe/stripe-php/lib/Product.php index 3164096..5be5ad4 100644 --- a/vendor/stripe/stripe-php/lib/Product.php +++ b/vendor/stripe/stripe-php/lib/Product.php @@ -1,54 +1,73 @@ -Prices to - * configure pricing in Checkout and Subscriptions. - * - * Related guides: Set up - * a subscription or accept one-time - * payments with Checkout and more about Products and Prices - * - * @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 product is currently available for purchase. - * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). - * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. - * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. - * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). - * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. - * @property null|string|\Stripe\TaxCode $tax_code A 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 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. - */ -class Product extends ApiResource -{ - const OBJECT_NAME = 'product'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const TYPE_GOOD = 'good'; - const TYPE_SERVICE = 'service'; -} +Prices to + * configure pricing in Payment Links, Checkout, and Subscriptions. + * + * Related guides: Set up + * a subscription, share a Payment + * Link, accept + * payments with Checkout, and more about Products and Prices + * + * @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 product is currently available for purchase. + * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). + * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. + * @property null|string|\Stripe\Price $default_price The ID of the Price object that is the default price for this product. + * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The product's name, meant to be displayable to the customer. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. + * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). + * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. + * @property null|string|\Stripe\TaxCode $tax_code A 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 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. + */ +class Product extends ApiResource +{ + const OBJECT_NAME = 'product'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const TYPE_GOOD = 'good'; + const TYPE_SERVICE = 'service'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the product search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/products/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/PromotionCode.php b/vendor/stripe/stripe-php/lib/PromotionCode.php index f4bb0f4..a309108 100644 --- a/vendor/stripe/stripe-php/lib/PromotionCode.php +++ b/vendor/stripe/stripe-php/lib/PromotionCode.php @@ -1,33 +1,33 @@ -invoices or orders. Coupons do not work with conventional one-off charges. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. - * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $restrictions - * @property int $times_redeemed Number of times this promotion code has been used. - */ -class PromotionCode extends ApiResource -{ - const OBJECT_NAME = 'promotion_code'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +invoices or orders. Coupons do not work with conventional one-off charges. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. + * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $restrictions + * @property int $times_redeemed Number of times this promotion code has been used. + */ +class PromotionCode extends ApiResource +{ + const OBJECT_NAME = 'promotion_code'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Quote.php b/vendor/stripe/stripe-php/lib/Quote.php new file mode 100644 index 0000000..ebae6d1 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Quote.php @@ -0,0 +1,171 @@ +charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. Defaults to charge_automatically. + * @property \Stripe\StripeObject $computed + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + * @property (string|\Stripe\TaxRate)[] $default_tax_rates The tax rates applied to this quote. + * @property null|string $description A description that will be displayed on the quote PDF. + * @property (string|\Stripe\Discount)[] $discounts The discounts applied to this quote. + * @property int $expires_at The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch. + * @property null|string $footer A footer that will be displayed on the quote PDF. + * @property null|\Stripe\StripeObject $from_quote Details of the quote that was cloned. See the cloning documentation for more details. + * @property null|string $header A header that will be displayed on the quote PDF. + * @property null|string|\Stripe\Invoice $invoice The invoice that was created from this quote. + * @property null|\Stripe\StripeObject $invoice_settings All invoices will be billed using the specified settings. + * @property \Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $number A unique number that identifies this particular quote. This number is assigned once the quote is finalized. + * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property string $status The status of the quote. + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Subscription $subscription The subscription that was created or updated from this quote. + * @property \Stripe\StripeObject $subscription_data + * @property null|string|\Stripe\SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to. + * @property \Stripe\StripeObject $total_details + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + */ +class Quote extends ApiResource +{ + const OBJECT_NAME = 'quote'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; + + const STATUS_ACCEPTED = 'accepted'; + const STATUS_CANCELED = 'canceled'; + const STATUS_DRAFT = 'draft'; + const STATUS_OPEN = 'open'; + + /** + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function pdf($readBodyChunkCallable, $params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (null === $opts->apiBase) { + $opts->apiBase = Stripe::$apiUploadBase; + } + + $url = $this->instanceUrl() . '/pdf'; + $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the accepted quote + */ + public function accept($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/accept'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the canceled quote + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the finalized quote + */ + public function finalizeQuote($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * @param mixed $id + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> list of LineItems + */ + public static function allComputedUpfrontLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/computed_upfront_line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * @param mixed $id + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> list of LineItems + */ + public static function allLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php b/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php index 2dfd2ac..761db96 100644 --- a/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php +++ b/vendor/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php @@ -1,38 +1,38 @@ -Early - * Fraud Warnings. - * - * @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 $actionable An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. - * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. - */ -class EarlyFraudWarning extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.early_fraud_warning'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; - const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; - const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; - const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; - const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; - const FRAUD_TYPE_MISC = 'misc'; - const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; -} +Early + * Fraud Warnings. + * + * @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 $actionable An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. + */ +class EarlyFraudWarning extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.early_fraud_warning'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; + const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; + const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; + const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; + const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; + const FRAUD_TYPE_MISC = 'misc'; + const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueList.php b/vendor/stripe/stripe-php/lib/Radar/ValueList.php index bcbef74..54cdd07 100644 --- a/vendor/stripe/stripe-php/lib/Radar/ValueList.php +++ b/vendor/stripe/stripe-php/lib/Radar/ValueList.php @@ -1,35 +1,35 @@ -Default Stripe - * Lists. - * - * @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 string $alias The name of the value list for use in rules. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $created_by The name or email address of the user who created this value list. - * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, or case_sensitive_string. - * @property \Stripe\Collection $list_items List of items contained within this value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The name of the value list. - */ -class ValueList extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.value_list'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +Default Stripe + * Lists. + * + * @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 string $alias The name of the value list for use in rules. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $created_by The name or email address of the user who created this value list. + * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, case_sensitive_string, or customer_id. + * @property \Stripe\Collection<\Stripe\Radar\ValueListItem> $list_items List of items contained within this value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The name of the value list. + */ +class ValueList extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php index c4ab281..42c830d 100644 --- a/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php +++ b/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php @@ -1,31 +1,31 @@ -Managing List - * Items. - * - * @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 string $created_by The name or email address of the user who added this item to the value list. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $value The value of the item. - * @property string $value_list The identifier of the value list this item belongs to. - */ -class ValueListItem extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'radar.value_list_item'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; -} +Managing List + * Items. + * + * @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 string $created_by The name or email address of the user who added this item to the value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $value The value of the item. + * @property string $value_list The identifier of the value list this item belongs to. + */ +class ValueListItem extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list_item'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Recipient.php b/vendor/stripe/stripe-php/lib/Recipient.php index 8d5ad4c..0585599 100644 --- a/vendor/stripe/stripe-php/lib/Recipient.php +++ b/vendor/stripe/stripe-php/lib/Recipient.php @@ -1,44 +1,44 @@ -Recipient objects, you can transfer money from your Stripe - * account to a third-party bank account or debit card. The API allows you to - * create, delete, and update your recipients. You can retrieve individual - * recipients as well as a list of all your recipients. - * - * Recipient objects have been deprecated in favor of Connect, specifically Connect's much - * more powerful Account objects. - * Stripe accounts that don't already use recipients can no longer begin doing so. - * Please use Account objects instead. - * - * @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 null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. - * @property null|\Stripe\Collection $cards - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. - * @property null|string $name Full, legal name of the recipient. - * @property string|\Stripe\Account $rolled_back_from - * @property string $type Type of the recipient, one of individual or corporation. - * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future - */ -class Recipient extends ApiResource -{ - const OBJECT_NAME = 'recipient'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +Recipient objects, you can transfer money from your Stripe + * account to a third-party bank account or debit card. The API allows you to + * create, delete, and update your recipients. You can retrieve individual + * recipients as well as a list of all your recipients. + * + * Recipient objects have been deprecated in favor of Connect, specifically Connect's much + * more powerful Account objects. + * Stripe accounts that don't already use recipients can no longer begin doing so. + * Please use Account objects instead. + * + * @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 null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. + * @property null|\Stripe\Collection<\Stripe\Card> $cards + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. + * @property null|string $name Full, legal name of the recipient. + * @property string|\Stripe\Account $rolled_back_from + * @property string $type Type of the recipient, one of individual or corporation. + * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future + */ +class Recipient extends ApiResource +{ + const OBJECT_NAME = 'recipient'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/RecipientTransfer.php b/vendor/stripe/stripe-php/lib/RecipientTransfer.php index 5e2d436..c92c611 100644 --- a/vendor/stripe/stripe-php/lib/RecipientTransfer.php +++ b/vendor/stripe/stripe-php/lib/RecipientTransfer.php @@ -1,36 +1,36 @@ -Refund objects allow you to refund a charge that has previously - * been created but not yet refunded. Funds will be refunded to the credit or debit - * card that was originally charged. - * - * Related guide: Refunds. - * - * @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 $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) - * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. - * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. - * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). - * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. - * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. - * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. - */ -class Refund extends ApiResource -{ - const OBJECT_NAME = 'refund'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FAILURE_REASON_EXPIRED_OR_CANCELED_CARD = 'expired_or_canceled_card'; - const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; - const FAILURE_REASON_UNKNOWN = 'unknown'; - - const REASON_DUPLICATE = 'duplicate'; - const REASON_FRAUDULENT = 'fraudulent'; - const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead - */ - const FAILURE_REASON = 'expired_or_canceled_card'; -} +Refund objects allow you to refund a charge that has previously + * been created but not yet refunded. Funds will be refunded to the credit or debit + * card that was originally charged. + * + * Related guide: Refunds. + * + * @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 $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) + * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. + * @property string $instructions_email Email to which refund instructions, if required, are sent to. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $next_action + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. + * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. + * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. + * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. + */ +class Refund extends ApiResource +{ + const OBJECT_NAME = 'refund'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_REASON_EXPIRED_OR_CANCELED_CARD = 'expired_or_canceled_card'; + const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; + const FAILURE_REASON_UNKNOWN = 'unknown'; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_EXPIRED_UNCAPTURED_CHARGE = 'expired_uncaptured_charge'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead + */ + const FAILURE_REASON = 'expired_or_canceled_card'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund the canceled refund + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php b/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php index 7c3d2a9..2cf78fa 100644 --- a/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php +++ b/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php @@ -1,37 +1,37 @@ -API Access to - * Reports. - * - * Note that certain report types can only be run based on your live-mode data (not - * test-mode data), and will error when queried without a live-mode API key. - * - * @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|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). - * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. - * @property \Stripe\StripeObject $parameters - * @property string $report_type The ID of the report type to run, such as "balance.summary.1". - * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). - * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. - * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch. - */ -class ReportRun extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'reporting.report_run'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Retrieve; -} +API Access to + * Reports. + * + * Note that certain report types can only be run based on your live-mode data (not + * test-mode data), and will error when queried without a live-mode API key. + * + * @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|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). + * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. + * @property \Stripe\StripeObject $parameters + * @property string $report_type The ID of the report type to run, such as "balance.summary.1". + * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). + * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. + * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch. + */ +class ReportRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/Reporting/ReportType.php b/vendor/stripe/stripe-php/lib/Reporting/ReportType.php index 3bb1460..05a4395 100644 --- a/vendor/stripe/stripe-php/lib/Reporting/ReportType.php +++ b/vendor/stripe/stripe-php/lib/Reporting/ReportType.php @@ -1,34 +1,35 @@ -API Access to Reports - * documentation for those Report Type IDs, along with required and optional - * parameters. - * - * Note that certain report types can only be run based on your live-mode data (not - * test-mode data), and will error when queried without a live-mode API key. - * - * @property string $id The ID of the Report Type, such as balance.summary.1. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. - * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. - * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) - * @property string $name Human-readable name of the Report Type - * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. - * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. - */ -class ReportType extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'reporting.report_type'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; -} +API Access to Reports + * documentation for those Report Type IDs, along with required and optional + * parameters. + * + * Note that certain report types can only be run based on your live-mode data (not + * test-mode data), and will error when queried without a live-mode API key. + * + * @property string $id The ID of the Report Type, such as balance.summary.1. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $name Human-readable name of the Report Type + * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. + * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + */ +class ReportType extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_type'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/RequestTelemetry.php b/vendor/stripe/stripe-php/lib/RequestTelemetry.php index bf9074a..00832a7 100644 --- a/vendor/stripe/stripe-php/lib/RequestTelemetry.php +++ b/vendor/stripe/stripe-php/lib/RequestTelemetry.php @@ -1,26 +1,26 @@ -requestId = $requestId; - $this->requestDuration = $requestDuration; - } -} +requestId = $requestId; + $this->requestDuration = $requestDuration; + } +} diff --git a/vendor/stripe/stripe-php/lib/Review.php b/vendor/stripe/stripe-php/lib/Review.php index 7a79992..01dd67f 100644 --- a/vendor/stripe/stripe-php/lib/Review.php +++ b/vendor/stripe/stripe-php/lib/Review.php @@ -1,66 +1,66 @@ -Radar and reviewing payments here. - * - * @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 null|string $billing_zip The ZIP or postal code of the card used, if applicable. - * @property null|string|\Stripe\Charge $charge The charge associated with this review. - * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, or disputed. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $ip_address The IP address where the payment originated. - * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property bool $open If true, the review needs action. - * @property string $opened_reason The reason the review was opened. One of rule or manual. - * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. - * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, or disputed. - * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. - */ -class Review extends ApiResource -{ - const OBJECT_NAME = 'review'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * Possible string representations of the current, the opening or the closure reason of the review. - * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to - * determine where these are apply. - * - * @see https://stripe.com/docs/api/radar/reviews/object - */ - const REASON_APPROVED = 'approved'; - const REASON_DISPUTED = 'disputed'; - const REASON_MANUAL = 'manual'; - const REASON_REFUNDED = 'refunded'; - const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud'; - const REASON_RULE = 'rule'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review the approved review - */ - public function approve($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/approve'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Radar and reviewing payments here. + * + * @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 null|string $billing_zip The ZIP or postal code of the card used, if applicable. + * @property null|string|\Stripe\Charge $charge The charge associated with this review. + * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, disputed, or redacted. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $ip_address The IP address where the payment originated. + * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $open If true, the review needs action. + * @property string $opened_reason The reason the review was opened. One of rule or manual. + * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. + * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, disputed, or redacted. + * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. + */ +class Review extends ApiResource +{ + const OBJECT_NAME = 'review'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * Possible string representations of the current, the opening or the closure reason of the review. + * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to + * determine where these are apply. + * + * @see https://stripe.com/docs/api/radar/reviews/object + */ + const REASON_APPROVED = 'approved'; + const REASON_DISPUTED = 'disputed'; + const REASON_MANUAL = 'manual'; + const REASON_REFUNDED = 'refunded'; + const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud'; + const REASON_RULE = 'rule'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review the approved review + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/SKU.php b/vendor/stripe/stripe-php/lib/SKU.php index b418c6c..1c31d46 100644 --- a/vendor/stripe/stripe-php/lib/SKU.php +++ b/vendor/stripe/stripe-php/lib/SKU.php @@ -1,44 +1,41 @@ -stock keeping units. - * SKUs describe specific product variations, taking into account any combination - * of: attributes, currency, and cost. For example, a product may be a T-shirt, - * whereas a specific SKU represents the size: large, color: - * red version of that shirt. - * - * Can also be used to manage inventory. - * - * Related guide: 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. - * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. - * @property \Stripe\StripeObject $inventory - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. - * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ -class SKU extends ApiResource -{ - const OBJECT_NAME = 'sku'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +stock keeping units. + * SKUs describe specific product variations, taking into account any combination + * of: attributes, currency, and cost. For example, a product may be a T-shirt, + * whereas a specific SKU represents the size: large, color: + * red version of that shirt. + * + * Can also be used to manage 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. + * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. + * @property \Stripe\StripeObject $inventory + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. + * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). + * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class SKU extends ApiResource +{ + const OBJECT_NAME = 'sku'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/SearchResult.php b/vendor/stripe/stripe-php/lib/SearchResult.php new file mode 100644 index 0000000..85f1829 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/SearchResult.php @@ -0,0 +1,234 @@ +Collection in that they both wrap + * around a list of objects and provide pagination. However the + * SearchResult object paginates by relying on a + * next_page token included in the response rather than using + * object IDs and a starting_before/ending_after + * parameter. Thus, SearchResult only supports forwards pagination. + * + * The {@see $total_count} property is only available when + * the `expand` parameter contains `total_count`. + * + * @template TStripeObject of StripeObject + * @template-implements \IteratorAggregate + * + * @property string $object + * @property string $url + * @property string $next_page + * @property int $total_count + * @property bool $has_more + * @property TStripeObject[] $data + */ +class SearchResult extends StripeObject implements \Countable, \IteratorAggregate +{ + const OBJECT_NAME = 'search_result'; + + use ApiOperations\Request; + + /** @var array */ + protected $filters = []; + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * Returns the filters. + * + * @return array the filters + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Sets the filters, removing paging options. + * + * @param array $filters the filters + */ + public function setFilters($filters) + { + $this->filters = $filters; + } + + #[\ReturnTypeWillChange] + public function offsetGet($k) + { + if (\is_string($k)) { + return parent::offsetGet($k); + } + $msg = "You tried to access the {$k} index, but SearchResult " . + 'types only support string keys. (HINT: Search calls ' . + 'return an object with a `data` (which is the data ' . + "array). You likely want to call ->data[{$k}])"; + + throw new Exception\InvalidArgumentException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return SearchResult + */ + public function all($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @return int the number of objects in the current page + */ + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * across objects in the current page + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * @return \Generator|TStripeObject[] A generator that can be used to + * iterate across all objects across all pages. As page boundaries are + * encountered, the next page will be fetched automatically for + * continued iteration. + */ + public function autoPagingIterator() + { + $page = $this; + + while (true) { + foreach ($page as $item) { + yield $item; + } + $page = $page->nextPage(); + + if ($page->isEmpty()) { + break; + } + } + } + + /** + * Returns an empty set of search results. This is returned from + * {@see nextPage()} when we know that there isn't a next page in order to + * replicate the behavior of the API when it attempts to return a page + * beyond the last. + * + * @param null|array|string $opts + * + * @return SearchResult + */ + public static function emptySearchResult($opts = null) + { + return SearchResult::constructFrom(['data' => []], $opts); + } + + /** + * Returns true if the page object contains no element. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->data); + } + + /** + * Fetches the next page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return SearchResult + */ + public function nextPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptySearchResult($opts); + } + + $params = \array_merge( + $this->filters ?: [], + ['page' => $this->next_page], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Gets the first item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function first() + { + return \count($this->data) > 0 ? $this->data[0] : null; + } + + /** + * Gets the last item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function last() + { + return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; + } + + private function extractPathAndUpdateParams($params) + { + $url = \parse_url($this->url); + + if (!isset($url['path'])) { + throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = []; + \parse_str($url['query'], $query); + $params = \array_merge($params ?: [], $query); + } + + return [$url['path'], $params]; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AbstractService.php b/vendor/stripe/stripe-php/lib/Service/AbstractService.php index ed092c8..79cd9d9 100644 --- a/vendor/stripe/stripe-php/lib/Service/AbstractService.php +++ b/vendor/stripe/stripe-php/lib/Service/AbstractService.php @@ -1,79 +1,105 @@ -client = $client; - } - - /** - * Gets the client used by this service to send requests. - * - * @return \Stripe\StripeClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Translate null values to empty strings. For service methods, - * we interpret null as a request to unset the field, which - * corresponds to sending an empty string for the field to the - * API. - * - * @param null|array $params - */ - private static function formatParams($params) - { - if (null === $params) { - return null; - } - \array_walk_recursive($params, function (&$value, $key) { - if (null === $value) { - $value = ''; - } - }); - - return $params; - } - - protected function request($method, $path, $params, $opts) - { - return $this->getClient()->request($method, $path, static::formatParams($params), $opts); - } - - protected function requestCollection($method, $path, $params, $opts) - { - return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); - } - - protected function buildPath($basePath, ...$ids) - { - foreach ($ids as $id) { - if (null === $id || '' === \trim($id)) { - $msg = 'The resource ID cannot be null or whitespace.'; - - throw new \Stripe\Exception\InvalidArgumentException($msg); - } - } - - return \sprintf($basePath, ...\array_map('\urlencode', $ids)); - } -} +client = $client; + $this->streamingClient = $client; + } + + /** + * Gets the client used by this service to send requests. + * + * @return \Stripe\StripeClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Gets the client used by this service to send requests. + * + * @return \Stripe\StripeStreamingClientInterface + */ + public function getStreamingClient() + { + return $this->streamingClient; + } + + /** + * Translate null values to empty strings. For service methods, + * we interpret null as a request to unset the field, which + * corresponds to sending an empty string for the field to the + * API. + * + * @param null|array $params + */ + private static function formatParams($params) + { + if (null === $params) { + return null; + } + \array_walk_recursive($params, function (&$value, $key) { + if (null === $value) { + $value = ''; + } + }); + + return $params; + } + + protected function request($method, $path, $params, $opts) + { + return $this->getClient()->request($method, $path, static::formatParams($params), $opts); + } + + protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) + { + return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, static::formatParams($params), $opts); + } + + protected function requestCollection($method, $path, $params, $opts) + { + return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); + } + + protected function requestSearchResult($method, $path, $params, $opts) + { + return $this->getClient()->requestSearchResult($method, $path, static::formatParams($params), $opts); + } + + protected function buildPath($basePath, ...$ids) + { + foreach ($ids as $id) { + if (null === $id || '' === \trim($id)) { + $msg = 'The resource ID cannot be null or whitespace.'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + } + + return \sprintf($basePath, ...\array_map('\urlencode', $ids)); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php index 4aca686..f11f5f3 100644 --- a/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/AbstractServiceFactory.php @@ -1,59 +1,59 @@ - */ - private $services; - - /** - * @param \Stripe\StripeClientInterface $client - */ - public function __construct($client) - { - $this->client = $client; - $this->services = []; - } - - /** - * @param string $name - * - * @return null|string - */ - abstract protected function getServiceClass($name); - - /** - * @param string $name - * - * @return null|AbstractService|AbstractServiceFactory - */ - public function __get($name) - { - $serviceClass = $this->getServiceClass($name); - if (null !== $serviceClass) { - if (!\array_key_exists($name, $this->services)) { - $this->services[$name] = new $serviceClass($this->client); - } - - return $this->services[$name]; - } - - \trigger_error('Undefined property: ' . static::class . '::$' . $name); - - return null; - } -} + */ + private $services; + + /** + * @param \Stripe\StripeClientInterface $client + */ + public function __construct($client) + { + $this->client = $client; + $this->services = []; + } + + /** + * @param string $name + * + * @return null|string + */ + abstract protected function getServiceClass($name); + + /** + * @param string $name + * + * @return null|AbstractService|AbstractServiceFactory + */ + public function __get($name) + { + $serviceClass = $this->getServiceClass($name); + if (null !== $serviceClass) { + if (!\array_key_exists($name, $this->services)) { + $this->services[$name] = new $serviceClass($this->client); + } + + return $this->services[$name]; + } + + \trigger_error('Undefined property: ' . static::class . '::$' . $name); + + return null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php b/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php index 2e90492..46894b9 100644 --- a/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php +++ b/vendor/stripe/stripe-php/lib/Service/AccountLinkService.php @@ -1,25 +1,25 @@ -request('post', '/v1/account_links', $params, $opts); - } -} +request('post', '/v1/account_links', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/AccountService.php b/vendor/stripe/stripe-php/lib/Service/AccountService.php index 50432a0..bc1f853 100644 --- a/vendor/stripe/stripe-php/lib/Service/AccountService.php +++ b/vendor/stripe/stripe-php/lib/Service/AccountService.php @@ -1,381 +1,382 @@ -Connect. If you’re not a platform, the list is empty. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/accounts', $params, $opts); - } - - /** - * Returns a list of capabilities associated with the account. The capabilities are - * returned sorted by creation date, with the most recent capability appearing - * first. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allCapabilities($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/capabilities', $parentId), $params, $opts); - } - - /** - * List external accounts for an account. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allExternalAccounts($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); - } - - /** - * Returns a list of people associated with the account’s legal entity. The people - * are returned sorted by creation date, with the most recent people appearing - * first. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allPersons($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); - } - - /** - * With Connect, you can create Stripe accounts for - * your users. To do this, you’ll first need to register your - * platform. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/accounts', $params, $opts); - } - - /** - * Create an external account for a given account. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function createExternalAccount($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); - } - - /** - * Creates a single-use login link for an Express account to access their Stripe - * dashboard. - * - * You may only create login links for Express accounts connected to your - * platform. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\LoginLink - */ - public function createLoginLink($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/login_links', $parentId), $params, $opts); - } - - /** - * Creates a new person. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function createPerson($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); - } - - /** - * With Connect, you can delete accounts you manage. - * - * Accounts created using test-mode keys can be deleted at any time. Custom or - * Express accounts created using live-mode keys can only be deleted once all - * balances are zero. - * - * If you want to delete your own account, use the account information tab in your - * account settings instead. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } - - /** - * Delete a specified external account for a given account. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Deletes an existing person’s relationship to the account’s legal entity. Any - * person with a relationship for an account can be deleted through the API, except - * if the person is the account_opener. If your integration is using - * the executive parameter, you cannot delete the only verified - * executive on file. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function deletePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * With Connect, you may flag accounts as suspicious. - * - * Test-mode Custom and Express accounts can be rejected at any time. Accounts - * created using live-mode keys may only be rejected once all balances are zero. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function reject($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/reject', $id), $params, $opts); - } - - /** - * Retrieves information about the specified Account Capability. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public function retrieveCapability($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieve a specified external account for a given account. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves an existing person. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function retrievePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates a connected account by setting the - * values of the parameters passed. Any parameters not provided are left unchanged. - * Most parameters can be changed only for Custom accounts. (These are marked - * Custom Only below.) Parameters marked Custom and - * Express are not supported for Standard accounts. - * - * To update your own account, use the Dashboard. Refer to our Connect documentation to learn more - * about updating accounts. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } - - /** - * Updates an existing Account Capability. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Capability - */ - public function updateCapability($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the metadata, account holder name, and account holder type of a bank - * account belonging to a Custom - * account, and optionally sets it as the default for its currency. Other bank - * account details are not editable by design. - * - * You can re-enable a disabled bank account by performing an update call without - * providing any arguments or changes. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BankAccount|\Stripe\Card - */ - public function updateExternalAccount($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates an existing person. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Person - */ - public function updatePerson($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves the details of an account. - * - * @param null|string $id - * @param null|array $params - * @param null|array|StripeUtilRequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public function retrieve($id = null, $params = null, $opts = null) - { - if (null === $id) { - return $this->request('get', '/v1/account', $params, $opts); - } - - return $this->request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); - } -} +Connect. If you’re not a platform, the list is empty. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Account> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/accounts', $params, $opts); + } + + /** + * Returns a list of capabilities associated with the account. The capabilities are + * returned sorted by creation date, with the most recent capability appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Capability> + */ + public function allCapabilities($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/capabilities', $parentId), $params, $opts); + } + + /** + * List external accounts for an account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> + */ + public function allExternalAccounts($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Returns a list of people associated with the account’s legal entity. The people + * are returned sorted by creation date, with the most recent people appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Person> + */ + public function allPersons($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can create Stripe accounts for + * your users. To do this, you’ll first need to register your + * platform. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/accounts', $params, $opts); + } + + /** + * Create an external account for a given account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function createExternalAccount($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Creates a single-use login link for an Express account to access their Stripe + * dashboard. + * + * You may only create login links for Express accounts connected to your + * platform. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public function createLoginLink($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/login_links', $parentId), $params, $opts); + } + + /** + * Creates a new person. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function createPerson($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can delete accounts you manage. + * + * Accounts created using test-mode keys can be deleted at any time. Standard + * accounts created using live-mode keys cannot be deleted. Custom or Express + * accounts created using live-mode keys can only be deleted once all balances are + * zero. + * + * If you want to delete your own account, use the account information tab in your + * account settings instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Delete a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing person’s relationship to the account’s legal entity. Any + * person with a relationship for an account can be deleted through the API, except + * if the person is the account_opener. If your integration is using + * the executive parameter, you cannot delete the only verified + * executive on file. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function deletePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * With Connect, you may flag accounts as suspicious. + * + * Test-mode Custom and Express accounts can be rejected at any time. Accounts + * created using live-mode keys may only be rejected once all balances are zero. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function reject($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/reject', $id), $params, $opts); + } + + /** + * Retrieves information about the specified Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function retrieveCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieve a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function retrievePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates a connected account by setting the + * values of the parameters passed. Any parameters not provided are left unchanged. + * Most parameters can be changed only for Custom accounts. (These are marked + * Custom Only below.) Parameters marked Custom and + * Express are not supported for Standard accounts. + * + * To update your own account, use the Dashboard. Refer to our Connect documentation to learn more + * about updating accounts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Updates an existing Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function updateCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the metadata, account holder name, account holder type of a bank account + * belonging to a Custom account, and + * optionally sets it as the default for its currency. Other bank account details + * are not editable by design. + * + * You can re-enable a disabled bank account by performing an update call without + * providing any arguments or changes. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function updateExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function updatePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the details of an account. + * + * @param null|string $id + * @param null|array $params + * @param null|array|StripeUtilRequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function retrieve($id = null, $params = null, $opts = null) + { + if (null === $id) { + return $this->request('get', '/v1/account', $params, $opts); + } + + return $this->request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php b/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php index 6577b6b..686d5f0 100644 --- a/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php +++ b/vendor/stripe/stripe-php/lib/Service/ApplePayDomainService.php @@ -1,70 +1,70 @@ -requestCollection('get', '/v1/apple_pay/domains', $params, $opts); - } - - /** - * Create an apple pay domain. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/apple_pay/domains', $params, $opts); - } - - /** - * Delete an apple pay domain. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); - } - - /** - * Retrieve an apple pay domain. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplePayDomain - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Create an apple pay domain. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Delete an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } + + /** + * Retrieve an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php b/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php index c05c3cd..35f0b3e 100644 --- a/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php +++ b/vendor/stripe/stripe-php/lib/Service/ApplicationFeeService.php @@ -1,125 +1,125 @@ -requestCollection('get', '/v1/application_fees', $params, $opts); - } - - /** - * You can see a list of the refunds belonging to a specific application fee. Note - * that the 10 most recent refunds are always available by default on the - * application fee object. If you need more than those 10, you can use this API - * method and the limit and starting_after parameters to - * page through additional refunds. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allRefunds($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); - } - - /** - * Refunds an application fee that has previously been collected but not yet - * refunded. Funds will be refunded to the Stripe account from which the fee was - * originally collected. - * - * You can optionally refund only part of an application fee. You can do so - * multiple times, until the entire fee has been refunded. - * - * Once entirely refunded, an application fee can’t be refunded again. This method - * will raise an error when called on an already-refunded application fee, or when - * trying to refund more money than is left on an application fee. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function createRefund($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); - } - - /** - * Retrieves the details of an application fee that your account has collected. The - * same information is returned when refunding the application fee. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFee - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/application_fees/%s', $id), $params, $opts); - } - - /** - * By default, you can see the 10 most recent refunds stored directly on the - * application fee object, but you can also retrieve details about a specific - * refund stored on the application fee. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function retrieveRefund($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the specified application fee refund by setting the values of the - * parameters passed. Any parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ApplicationFeeRefund - */ - public function updateRefund($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/application_fees', $params, $opts); + } + + /** + * You can see a list of the refunds belonging to a specific application fee. Note + * that the 10 most recent refunds are always available by default on the + * application fee object. If you need more than those 10, you can use this API + * method and the limit and starting_after parameters to + * page through additional refunds. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> + */ + public function allRefunds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Refunds an application fee that has previously been collected but not yet + * refunded. Funds will be refunded to the Stripe account from which the fee was + * originally collected. + * + * You can optionally refund only part of an application fee. You can do so + * multiple times, until the entire fee has been refunded. + * + * Once entirely refunded, an application fee can’t be refunded again. This method + * will raise an error when called on an already-refunded application fee, or when + * trying to refund more money than is left on an application fee. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function createRefund($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an application fee that your account has collected. The + * same information is returned when refunding the application fee. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFee + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent refunds stored directly on the + * application fee object, but you can also retrieve details about a specific + * refund stored on the application fee. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function retrieveRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified application fee refund by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function updateRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BalanceService.php b/vendor/stripe/stripe-php/lib/Service/BalanceService.php index 0f55385..b76c455 100644 --- a/vendor/stripe/stripe-php/lib/Service/BalanceService.php +++ b/vendor/stripe/stripe-php/lib/Service/BalanceService.php @@ -1,26 +1,26 @@ -Accounting - * for negative balances. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Balance - */ - public function retrieve($params = null, $opts = null) - { - return $this->request('get', '/v1/balance', $params, $opts); - } -} +Accounting + * for negative balances. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public function retrieve($params = null, $opts = null) + { + return $this->request('get', '/v1/balance', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php b/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php index fb1da50..90fd9fa 100644 --- a/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php +++ b/vendor/stripe/stripe-php/lib/Service/BalanceTransactionService.php @@ -1,47 +1,47 @@ -/v1/balance/history. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); - } - - /** - * Retrieves the balance transaction with the given ID. - * - * Note that this endpoint previously used the path - * /v1/balance/history/:id. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BalanceTransaction - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); - } -} +/v1/balance/history. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\BalanceTransaction> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); + } + + /** + * Retrieves the balance transaction with the given ID. + * + * Note that this endpoint previously used the path + * /v1/balance/history/:id. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BalanceTransaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php index 23a4d30..9d1df0f 100644 --- a/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php @@ -1,27 +1,27 @@ - - */ - private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'sessions' => SessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php index 5a0d70d..8357eed 100644 --- a/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php @@ -1,73 +1,73 @@ -requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); - } - - /** - * Creates a configuration that describes the functionality and behavior of a - * PortalSession. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); - } - - /** - * Retrieves a configuration that describes the functionality of the customer - * portal. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); - } - - /** - * Updates a configuration that describes the functionality of the customer portal. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\BillingPortal\Configuration - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Creates a configuration that describes the functionality and behavior of a + * PortalSession. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Retrieves a configuration that describes the functionality of the customer + * portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } + + /** + * Updates a configuration that describes the functionality of the customer portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php b/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php index 6b3e602..e508c2a 100644 --- a/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php +++ b/vendor/stripe/stripe-php/lib/Service/BillingPortal/SessionService.php @@ -1,23 +1,23 @@ -request('post', '/v1/billing_portal/sessions', $params, $opts); - } -} +request('post', '/v1/billing_portal/sessions', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ChargeService.php b/vendor/stripe/stripe-php/lib/Service/ChargeService.php index f5321b8..e24c0f5 100644 --- a/vendor/stripe/stripe-php/lib/Service/ChargeService.php +++ b/vendor/stripe/stripe-php/lib/Service/ChargeService.php @@ -1,101 +1,122 @@ -requestCollection('get', '/v1/charges', $params, $opts); - } - - /** - * Capture the payment of an existing, uncaptured, charge. This is the second half - * of the two-step payment flow, where first you created a - * charge with the capture option set to false. - * - * Uncaptured payments expire exactly seven days after they are created. If they - * are not captured by that point in time, they will be marked as refunded and will - * no longer be capturable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function capture($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/charges/%s/capture', $id), $params, $opts); - } - - /** - * To charge a credit card or other payment source, you create a - * Charge object. If your API key is in test mode, the supplied - * payment source (e.g., card) won’t actually be charged, although everything else - * will occur as if in live mode. (Stripe assumes that the charge would have - * completed successfully). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/charges', $params, $opts); - } - - /** - * Retrieves the details of a charge that has previously been created. Supply the - * unique charge ID that was returned from your previous request, and Stripe will - * return the corresponding charge information. The same information is returned - * when creating or refunding the charge. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); - } - - /** - * Updates the specified charge by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Charge - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/charges', $params, $opts); + } + + /** + * Capture the payment of an existing, uncaptured, charge. This is the second half + * of the two-step payment flow, where first you created a + * charge with the capture option set to false. + * + * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not captured + * by that point in time, they will be marked as refunded and will no longer be + * capturable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s/capture', $id), $params, $opts); + } + + /** + * To charge a credit card or other payment source, you create a + * Charge object. If your API key is in test mode, the supplied + * payment source (e.g., card) won’t actually be charged, although everything else + * will occur as if in live mode. (Stripe assumes that the charge would have + * completed successfully). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/charges', $params, $opts); + } + + /** + * Retrieves the details of a charge that has previously been created. Supply the + * unique charge ID that was returned from your previous request, and Stripe will + * return the corresponding charge information. The same information is returned + * when creating or refunding the charge. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } + + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Charge> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/charges/search', $params, $opts); + } + + /** + * Updates the specified charge by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php index bb26a83..26a5ee8 100644 --- a/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Checkout/CheckoutServiceFactory.php @@ -1,25 +1,25 @@ - - */ - private static $classMap = [ - 'sessions' => SessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php b/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php index 9da3788..13c9fbf 100644 --- a/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php +++ b/vendor/stripe/stripe-php/lib/Service/Checkout/SessionService.php @@ -1,73 +1,92 @@ -requestCollection('get', '/v1/checkout/sessions', $params, $opts); - } - - /** - * When retrieving a Checkout Session, there is an includable - * line_items property containing the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allLineItems($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); - } - - /** - * Creates a Session object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/checkout/sessions', $params, $opts); - } - - /** - * Retrieves a Session object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Checkout\Session - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/checkout/sessions', $params, $opts); + } + + /** + * When retrieving a Checkout Session, there is an includable + * line_items property containing the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> + */ + public function allLineItems($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); + } + + /** + * Creates a Session object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/checkout/sessions', $params, $opts); + } + + /** + * 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. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/checkout/sessions/%s/expire', $id), $params, $opts); + } + + /** + * Retrieves a Session object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php index 41454bd..a78b989 100644 --- a/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php @@ -1,129 +1,139 @@ - - */ - 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, - 'paymentMethods' => PaymentMethodService::class, - 'payouts' => PayoutService::class, - 'plans' => PlanService::class, - 'prices' => PriceService::class, - 'products' => ProductService::class, - 'promotionCodes' => PromotionCodeService::class, - 'radar' => Radar\RadarServiceFactory::class, - 'refunds' => RefundService::class, - 'reporting' => Reporting\ReportingServiceFactory::class, - 'reviews' => ReviewService::class, - 'setupAttempts' => SetupAttemptService::class, - 'setupIntents' => SetupIntentService::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) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + 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, + 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::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) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php b/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php index 573444f..a5cf520 100644 --- a/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php +++ b/vendor/stripe/stripe-php/lib/Service/CountrySpecService.php @@ -1,39 +1,39 @@ -requestCollection('get', '/v1/country_specs', $params, $opts); - } - - /** - * Returns a Country Spec for a given Country code. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CountrySpec - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/country_specs', $params, $opts); + } + + /** + * Returns a Country Spec for a given Country code. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CountrySpec + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CouponService.php b/vendor/stripe/stripe-php/lib/Service/CouponService.php index 82a880f..d6090da 100644 --- a/vendor/stripe/stripe-php/lib/Service/CouponService.php +++ b/vendor/stripe/stripe-php/lib/Service/CouponService.php @@ -1,104 +1,104 @@ -requestCollection('get', '/v1/coupons', $params, $opts); - } - - /** - * You can create coupons easily via the coupon management page of the - * Stripe dashboard. Coupon creation is also accessible via the API if you need to - * create coupons on the fly. - * - * A coupon has either a percent_off or an amount_off and - * currency. If you set an amount_off, that amount will - * be subtracted from any invoice’s subtotal. For example, an invoice with a - * subtotal of 100 will have a final total of - * 0 if a coupon with an amount_off of - * 200 is applied to it and an invoice with a subtotal of - * 300 will have a final total of 100 if - * a coupon with an amount_off of 200 is applied to - * it. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/coupons', $params, $opts); - } - - /** - * You can delete coupons via the coupon management page of the - * Stripe dashboard. However, deleting a coupon does not affect any customers who - * have already applied the coupon; it means that new customers can’t redeem the - * coupon. You can also delete coupons via the API. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Retrieves the coupon with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } - - /** - * Updates the metadata of a coupon. Other coupon details (currency, duration, - * amount_off) are, by design, not editable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Coupon - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/coupons', $params, $opts); + } + + /** + * You can create coupons easily via the coupon management page of the + * Stripe dashboard. Coupon creation is also accessible via the API if you need to + * create coupons on the fly. + * + * A coupon has either a percent_off or an amount_off and + * currency. If you set an amount_off, that amount will + * be subtracted from any invoice’s subtotal. For example, an invoice with a + * subtotal of 100 will have a final total of + * 0 if a coupon with an amount_off of + * 200 is applied to it and an invoice with a subtotal of + * 300 will have a final total of 100 if + * a coupon with an amount_off of 200 is applied to + * it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/coupons', $params, $opts); + } + + /** + * You can delete coupons via the coupon management page of the + * Stripe dashboard. However, deleting a coupon does not affect any customers who + * have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Retrieves the coupon with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a coupon. Other coupon details (currency, duration, + * amount_off) are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php b/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php index 39807dc..ce6402a 100644 --- a/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php +++ b/vendor/stripe/stripe-php/lib/Service/CreditNoteService.php @@ -1,156 +1,156 @@ -requestCollection('get', '/v1/credit_notes', $params, $opts); - } - - /** - * When retrieving a credit note, you’ll get a lines property - * containing the the first handful of those items. There is also a URL where you - * can retrieve the full (paginated) list of line items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allLines($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts); - } - - /** - * Issue a credit note to adjust the amount of a finalized invoice. For a - * 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:. - * - *
  • Refund: create a new refund (using refund_amount) or link - * an existing refund (using refund).
  • Customer balance - * credit: credit the customer’s balance (using credit_amount) which - * will be automatically applied to their next invoice when it’s finalized.
  • - *
  • Outside of Stripe credit: record the amount that is or will be credited - * outside of Stripe (using out_of_band_amount).
- * - * For post-payment credit notes the sum of the refund, credit and outside of - * Stripe amounts must equal the credit note total. - * - * You may issue multiple credit notes for an invoice. Each credit note will - * increment the invoice’s pre_payment_credit_notes_amount or - * post_payment_credit_notes_amount depending on its - * status at the time of credit note creation. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/credit_notes', $params, $opts); - } - - /** - * Get a preview of a credit note without creating it. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function preview($params = null, $opts = null) - { - return $this->request('get', '/v1/credit_notes/preview', $params, $opts); - } - - /** - * When retrieving a credit note preview, you’ll get a lines - * property containing the first handful of those items. This URL you can retrieve - * the full (paginated) list of line items. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function previewLines($params = null, $opts = null) - { - return $this->request('get', '/v1/credit_notes/preview/lines', $params, $opts); - } - - /** - * Retrieves the credit note object with the given identifier. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); - } - - /** - * Updates an existing credit note. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); - } - - /** - * Marks a credit note as void. Learn more about voiding credit notes. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CreditNote - */ - public function voidCreditNote($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/credit_notes', $params, $opts); + } + + /** + * When retrieving a credit note, you’ll get a lines property + * containing the the first handful of those items. There is also a URL where you + * can retrieve the full (paginated) list of line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts); + } + + /** + * Issue a credit note to adjust the amount of a finalized invoice. For a + * 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:. + * + *
  • Refund: create a new refund (using refund_amount) or link + * an existing refund (using refund).
  • Customer balance + * credit: credit the customer’s balance (using credit_amount) which + * will be automatically applied to their next invoice when it’s finalized.
  • + *
  • Outside of Stripe credit: record the amount that is or will be credited + * outside of Stripe (using out_of_band_amount).
+ * + * For post-payment credit notes the sum of the refund, credit and outside of + * Stripe amounts must equal the credit note total. + * + * You may issue multiple credit notes for an invoice. Each credit note will + * increment the invoice’s pre_payment_credit_notes_amount or + * post_payment_credit_notes_amount depending on its + * status at the time of credit note creation. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/credit_notes', $params, $opts); + } + + /** + * Get a preview of a credit note without creating it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function preview($params = null, $opts = null) + { + return $this->request('get', '/v1/credit_notes/preview', $params, $opts); + } + + /** + * When retrieving a credit note preview, you’ll get a lines + * property containing the first handful of those items. This URL you can retrieve + * the full (paginated) list of line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CreditNote> + */ + public function previewLines($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/credit_notes/preview/lines', $params, $opts); + } + + /** + * Retrieves the credit note object with the given identifier. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Updates an existing credit note. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Marks a credit note as void. Learn more about voiding credit notes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function voidCreditNote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/CustomerService.php b/vendor/stripe/stripe-php/lib/Service/CustomerService.php index fdc6a59..0093873 100644 --- a/vendor/stripe/stripe-php/lib/Service/CustomerService.php +++ b/vendor/stripe/stripe-php/lib/Service/CustomerService.php @@ -1,353 +1,440 @@ -requestCollection('get', '/v1/customers', $params, $opts); - } - - /** - * Returns a list of transactions that updated the customer’s balances. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allBalanceTransactions($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); - } - - /** - * List sources for a specified customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allSources($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); - } - - /** - * Returns a list of tax IDs for a customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allTaxIds($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); - } - - /** - * Creates a new customer object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/customers', $params, $opts); - } - - /** - * Creates an immutable transaction that updates the customer’s credit balance. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function createBalanceTransaction($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); - } - - /** - * When you create a new credit card, you must specify a customer or recipient on - * which to create it. - * - * If the card’s owner has no default card, then the new card will become the - * default. However, if the owner already has a default, then it will not change. - * To change the default, you should update the - * customer to have a new default_source. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function createSource($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); - } - - /** - * Creates a new TaxID object for a customer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function createTaxId($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); - } - - /** - * Permanently deletes a customer. It cannot be undone. Also immediately cancels - * any active subscriptions on the customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Removes the currently applied discount on a customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function deleteDiscount($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/discount', $id), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function deleteSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Deletes an existing TaxID object. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function deleteTaxId($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves the details of an existing customer. You need only supply the unique - * customer identifier that was returned upon customer creation. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Retrieves a specific customer balance transaction that updated the customer’s balances. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieve a specified source for a given customer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function retrieveSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves the TaxID object with the given identifier. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxId - */ - public function retrieveTaxId($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the specified customer by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. For example, if you pass the - * source parameter, that becomes the customer’s active source - * (e.g., a card) to be used for all charges in the future. When you update a - * customer to a new valid card source by passing the source - * parameter: for each of the customer’s current subscriptions, if the subscription - * bills automatically and is in the past_due state, then the latest - * open invoice for the subscription with automatic collection enabled will be - * retried. This retry will not count as an automatic retry, and will not affect - * the next regularly scheduled payment for the invoice. Changing the - * default_source for a customer will not trigger this behavior. - * - * This request accepts mostly the same arguments as the customer creation call. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Customer - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s', $id), $params, $opts); - } - - /** - * Most credit balance transaction fields are immutable, but you may update its - * description and metadata. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\CustomerBalanceTransaction - */ - public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function updateSource($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source - */ - public function verifySource($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/customers', $params, $opts); + } + + /** + * Returns a list of transactions that updated the customer’s balances. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> + */ + public function allBalanceTransactions($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * Returns a list of PaymentMethods for a given Customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Customer> + */ + public function allPaymentMethods($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/payment_methods', $id), $params, $opts); + } + + /** + * List sources for a specified customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source> + */ + public function allSources($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Returns a list of tax IDs for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TaxId> + */ + public function allTaxIds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Creates a new customer object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/customers', $params, $opts); + } + + /** + * Creates an immutable transaction that updates the customer’s credit balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function createBalanceTransaction($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * Retrieve funding instructions for a customer cash balance. If funding + * instructions do not yet exist for the customer, new funding instructions will be + * created. If funding instructions have already been created for a given customer, + * the same funding instructions will be retrieved. In other words, we will return + * the same funding instructions each time. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function createFundingInstructions($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/funding_instructions', $id), $params, $opts); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on + * which to create it. + * + * If the card’s owner has no default card, then the new card will become the + * default. However, if the owner already has a default, then it will not change. + * To change the default, you should update the + * customer to have a new default_source. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function createSource($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Creates a new TaxID object for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function createTaxId($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Permanently deletes a customer. It cannot be undone. Also immediately cancels + * any active subscriptions on the customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Removes the currently applied discount on a customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/discount', $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function deleteSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing TaxID object. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function deleteTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves a Customer object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Retrieves a specific customer balance transaction that updated the customer’s balances. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves a customer’s cash balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\cash_balance + */ + public function retrieveCashBalance($parentId, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); + } + + /** + * Retrieve a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function retrieveSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the TaxID object with the given identifier. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function retrieveTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Customer> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/customers/search', $params, $opts); + } + + /** + * Updates the specified customer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. For example, if you pass the + * source parameter, that becomes the customer’s active source + * (e.g., a card) to be used for all charges in the future. When you update a + * customer to a new valid card source by passing the source + * parameter: for each of the customer’s current subscriptions, if the subscription + * bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be + * retried. This retry will not count as an automatic retry, and will not affect + * the next regularly scheduled payment for the invoice. Changing the + * default_source for a customer will not trigger this behavior. + * + * This request accepts mostly the same arguments as the customer creation call. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Most credit balance transaction fields are immutable, but you may update its + * description and metadata. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates a customer’s cash balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\cash_balance + */ + public function updateCashBalance($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function updateSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function verifySource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/DisputeService.php b/vendor/stripe/stripe-php/lib/Service/DisputeService.php index 4eb1542..807a497 100644 --- a/vendor/stripe/stripe-php/lib/Service/DisputeService.php +++ b/vendor/stripe/stripe-php/lib/Service/DisputeService.php @@ -1,83 +1,83 @@ -requestCollection('get', '/v1/disputes', $params, $opts); - } - - /** - * Closing the dispute for a charge indicates that you do not have any evidence to - * submit and are essentially dismissing the dispute, acknowledging it as lost. - * - * The status of the dispute will change from needs_response to - * lost. Closing a dispute is irreversible. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function close($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts); - } - - /** - * Retrieves the dispute with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); - } - - /** - * When you get a dispute, contacting your customer is always the best first step. - * If that doesn’t work, you can submit evidence to help us resolve the dispute in - * your favor. You can do this in your dashboard, but if you prefer, - * you can use the API to submit evidence programmatically. - * - * Depending on your dispute type, different evidence fields will give you a better - * chance of winning your dispute. To figure out which evidence fields to provide, - * see our guide to dispute types. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Dispute - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/disputes', $params, $opts); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to + * submit and are essentially dismissing the dispute, acknowledging it as lost. + * + * The status of the dispute will change from needs_response to + * lost. Closing a dispute is irreversible. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function close($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts); + } + + /** + * Retrieves the dispute with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } + + /** + * When you get a dispute, contacting your customer is always the best first step. + * If that doesn’t work, you can submit evidence to help us resolve the dispute in + * your favor. You can do this in your dashboard, but if you prefer, + * you can use the API to submit evidence programmatically. + * + * Depending on your dispute type, different evidence fields will give you a better + * chance of winning your dispute. To figure out which evidence fields to provide, + * see our guide to dispute types. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php b/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php index 3ca14c9..1305234 100644 --- a/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php +++ b/vendor/stripe/stripe-php/lib/Service/EphemeralKeyService.php @@ -1,43 +1,43 @@ -request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); - } - - /** - * Creates a short-lived API key for a given resource. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\EphemeralKey - */ - public function create($params = null, $opts = null) - { - if (!$opts || !isset($opts['stripe_version'])) { - throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); - } - - return $this->request('post', '/v1/ephemeral_keys', $params, $opts); - } -} +request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); + } + + /** + * Creates a short-lived API key for a given resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey + */ + public function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return $this->request('post', '/v1/ephemeral_keys', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/EventService.php b/vendor/stripe/stripe-php/lib/Service/EventService.php index 430b35a..fde4429 100644 --- a/vendor/stripe/stripe-php/lib/Service/EventService.php +++ b/vendor/stripe/stripe-php/lib/Service/EventService.php @@ -1,44 +1,44 @@ -event object api_version - * attribute (not according to your current Stripe API version or - * Stripe-Version header). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/events', $params, $opts); - } - - /** - * Retrieves the details of an event. Supply the unique identifier of the event, - * which you might have received in a webhook. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Event - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); - } -} +event object api_version + * attribute (not according to your current Stripe API version or + * Stripe-Version header). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Event> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/events', $params, $opts); + } + + /** + * Retrieves the details of an event. Supply the unique identifier of the event, + * which you might have received in a webhook. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Event + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php b/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php index fc78410..ae15e75 100644 --- a/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php +++ b/vendor/stripe/stripe-php/lib/Service/ExchangeRateService.php @@ -1,41 +1,41 @@ -requestCollection('get', '/v1/exchange_rates', $params, $opts); - } - - /** - * Retrieves the exchange rates from the given currency to every supported - * currency. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\ExchangeRate - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/exchange_rates', $params, $opts); + } + + /** + * Retrieves the exchange rates from the given currency to every supported + * currency. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ExchangeRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FileLinkService.php b/vendor/stripe/stripe-php/lib/Service/FileLinkService.php index 7a3a435..72cf34e 100644 --- a/vendor/stripe/stripe-php/lib/Service/FileLinkService.php +++ b/vendor/stripe/stripe-php/lib/Service/FileLinkService.php @@ -1,70 +1,70 @@ -requestCollection('get', '/v1/file_links', $params, $opts); - } - - /** - * Creates a new file link object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/file_links', $params, $opts); - } - - /** - * Retrieves the file link with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); - } - - /** - * Updates an existing file link object. Expired links can no longer be updated. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\FileLink - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/file_links', $params, $opts); + } + + /** + * Creates a new file link object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/file_links', $params, $opts); + } + + /** + * Retrieves the file link with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } + + /** + * Updates an existing file link object. Expired links can no longer be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FileService.php b/vendor/stripe/stripe-php/lib/Service/FileService.php index 1484288..578ceb2 100644 --- a/vendor/stripe/stripe-php/lib/Service/FileService.php +++ b/vendor/stripe/stripe-php/lib/Service/FileService.php @@ -1,66 +1,66 @@ -requestCollection('get', '/v1/files', $params, $opts); - } - - /** - * Retrieves the details of an existing file object. Supply the unique file ID from - * a file, and Stripe will return the corresponding file object. To access file - * contents, see the File Upload - * Guide. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\File - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); - } - - /** - * Create a file. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @return \Stripe\File - */ - public function create($params = null, $opts = null) - { - $opts = \Stripe\Util\RequestOptions::parse($opts); - if (!isset($opts->apiBase)) { - $opts->apiBase = $this->getClient()->getFilesBase(); - } - - // Manually flatten params, otherwise curl's multipart encoder will - // choke on nested null|arrays. - $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); - - return $this->request('post', '/v1/files', $flatParams, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/files', $params, $opts); + } + + /** + * Retrieves the details of an existing file object. Supply the unique file ID from + * a file, and Stripe will return the corresponding file object. To access file + * contents, see the File Upload + * Guide. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); + } + + /** + * Create a file. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @return \Stripe\File + */ + public function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = $this->getClient()->getFilesBase(); + } + + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested null|arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return $this->request('post', '/v1/files', $flatParams, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php new file mode 100644 index 0000000..d50429c --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php @@ -0,0 +1,58 @@ +Account. You will + * no longer be able to access data associated with the account (e.g. balances, + * transactions). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function disconnect($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/disconnect', $id), $params, $opts); + } + + /** + * Refreshes the data associated with a Financial Connections Account. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function refresh($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/refresh', $id), $params, $opts); + } + + /** + * Retrieves the details of an Financial Connections Account. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/financial_connections/accounts/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php new file mode 100644 index 0000000..c923c02 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'accounts' => AccountService::class, + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php new file mode 100644 index 0000000..fd109f6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php @@ -0,0 +1,41 @@ +Session. The session’s client_secret can be used to + * launch the flow using Stripe.js. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Session + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/financial_connections/sessions', $params, $opts); + } + + /** + * Retrieves the details of a Financial Connections Session. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Session + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/financial_connections/sessions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php index cf63146..744d61d 100644 --- a/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php @@ -1,27 +1,27 @@ - - */ - private static $classMap = [ - 'verificationReports' => VerificationReportService::class, - 'verificationSessions' => VerificationSessionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php index 0393cd5..5b251f5 100644 --- a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php @@ -1,39 +1,39 @@ -requestCollection('get', '/v1/identity/verification_reports', $params, $opts); - } - - /** - * Retrieves an existing VerificationReport. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationReport - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/identity/verification_reports', $params, $opts); + } + + /** + * Retrieves an existing VerificationReport. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationReport + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php index 1a763be..4efb30f 100644 --- a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php @@ -1,146 +1,146 @@ -requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); - } - - /** - * A VerificationSession object can be canceled when it is in - * requires_input status. - * - * Once canceled, future submission attempts are disabled. This cannot be undone. - * Learn more. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); - } - - /** - * Creates a VerificationSession object. - * - * After the VerificationSession is created, display a verification modal using the - * session client_secret or send your users to the session’s - * url. - * - * If your API key is in test mode, verification checks won’t actually process, - * though everything else will occur as if in live mode. - * - * Related guide: Verify your - * users’ identity documents. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); - } - - /** - * Redact a VerificationSession to remove all collected information from Stripe. - * This will redact the VerificationSession and all objects related to it, - * including VerificationReports, Events, request logs, etc. - * - * A VerificationSession object can be redacted when it is in - * requires_input or verified status. Redacting a - * VerificationSession in requires_action state will automatically - * cancel it. - * - * The redaction process may take up to four days. When the redaction process is in - * progress, the VerificationSession’s redaction.status field will be - * set to processing; when the process is finished, it will change to - * redacted and an identity.verification_session.redacted - * event will be emitted. - * - * Redaction is irreversible. Redacted objects are still accessible in the Stripe - * API, but all the fields that contain personal data will be replaced by the - * string [redacted] or a similar placeholder. The - * metadata field will also be erased. Redacted objects cannot be - * updated or used for any purpose. - * - * Learn more. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function redact($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); - } - - /** - * Retrieves the details of a VerificationSession that was previously created. - * - * When the session status is requires_input, you can use this method - * to retrieve a valid client_secret or url to allow - * re-submission. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); - } - - /** - * Updates a VerificationSession object. - * - * When the session status is requires_input, you can use this method - * to update the verification check and options. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Identity\VerificationSession - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * A VerificationSession object can be canceled when it is in + * requires_input status. + * + * Once canceled, future submission attempts are disabled. This cannot be undone. + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a VerificationSession object. + * + * After the VerificationSession is created, display a verification modal using the + * session client_secret or send your users to the session’s + * url. + * + * If your API key is in test mode, verification checks won’t actually process, + * though everything else will occur as if in live mode. + * + * Related guide: Verify your + * users’ identity documents. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * Redact a VerificationSession to remove all collected information from Stripe. + * This will redact the VerificationSession and all objects related to it, + * including VerificationReports, Events, request logs, etc. + * + * A VerificationSession object can be redacted when it is in + * requires_input or verified status. Redacting a + * VerificationSession in requires_action state will automatically + * cancel it. + * + * The redaction process may take up to four days. When the redaction process is in + * progress, the VerificationSession’s redaction.status field will be + * set to processing; when the process is finished, it will change to + * redacted and an identity.verification_session.redacted + * event will be emitted. + * + * Redaction is irreversible. Redacted objects are still accessible in the Stripe + * API, but all the fields that contain personal data will be replaced by the + * string [redacted] or a similar placeholder. The + * metadata field will also be erased. Redacted objects cannot be + * updated or used for any purpose. + * + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function redact($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + * When the session status is requires_input, you can use this method + * to retrieve a valid client_secret or url to allow + * re-submission. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } + + /** + * Updates a VerificationSession object. + * + * When the session status is requires_input, you can use this method + * to update the verification check and options. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php b/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php index 0f0b9e9..c839bab 100644 --- a/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php +++ b/vendor/stripe/stripe-php/lib/Service/InvoiceItemService.php @@ -1,93 +1,93 @@ -requestCollection('get', '/v1/invoiceitems', $params, $opts); - } - - /** - * Creates an item to be added to a draft invoice (up to 250 items per invoice). If - * no invoice is specified, the item will be on the next invoice created for the - * customer specified. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/invoiceitems', $params, $opts); - } - - /** - * Deletes an invoice item, removing it from an invoice. Deleting invoice items is - * only possible when they’re not attached to invoices, or if it’s attached to a - * draft invoice. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } - - /** - * Retrieves the invoice item with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } - - /** - * Updates the amount or description of an invoice item on an upcoming invoice. - * Updating an invoice item is only possible before the invoice it’s attached to is - * closed. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\InvoiceItem - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/invoiceitems', $params, $opts); + } + + /** + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If + * no invoice is specified, the item will be on the next invoice created for the + * customer specified. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoiceitems', $params, $opts); + } + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is + * only possible when they’re not attached to invoices, or if it’s attached to a + * draft invoice. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Retrieves the invoice item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Updates the amount or description of an invoice item on an upcoming invoice. + * Updating an invoice item is only possible before the invoice it’s attached to is + * closed. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/InvoiceService.php b/vendor/stripe/stripe-php/lib/Service/InvoiceService.php index f647b28..11f188f 100644 --- a/vendor/stripe/stripe-php/lib/Service/InvoiceService.php +++ b/vendor/stripe/stripe-php/lib/Service/InvoiceService.php @@ -1,272 +1,292 @@ -requestCollection('get', '/v1/invoices', $params, $opts); - } - - /** - * When retrieving an invoice, you’ll get a lines property - * containing the total count of line items and the first handful of those items. - * There is also a URL where you can retrieve the full (paginated) list of line - * items. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allLines($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts); - } - - /** - * This endpoint creates a draft invoice for a given customer. The draft invoice - * created pulls in all pending invoice items on that customer, including - * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to - * your customers. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/invoices', $params, $opts); - } - - /** - * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to - * delete invoices that are no longer in a draft state will fail; once an invoice - * has been finalized or if an invoice is for a subscription, it must be voided. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Stripe automatically finalizes drafts before sending and attempting payment on - * invoices. However, if you’d like to finalize a draft invoice manually, you can - * do so using this method. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function finalizeInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts); - } - - /** - * Marking an invoice as uncollectible is useful for keeping track of bad debts - * that can be written off for accounting purposes. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function markUncollectible($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts); - } - - /** - * Stripe automatically creates and then attempts to collect payment on invoices - * for customers on subscriptions according to your subscriptions - * settings. However, if you’d like to attempt payment on an invoice out of the - * normal collection schedule or for some other reason, you can do so. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function pay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); - } - - /** - * Retrieves the invoice with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Stripe will automatically send invoices to customers according to your subscriptions - * settings. However, if you’d like to manually send an invoice to your - * customer out of the normal schedule, you can do so. When sending invoices that - * have already been paid, there will be no reference to the payment in the email. - * - * Requests made in test-mode result in no emails being sent, despite sending an - * invoice.sent event. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function sendInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); - } - - /** - * At any time, you can preview the upcoming invoice for a customer. This will show - * you all the charges that are pending, including subscription renewal charges, - * invoice item charges, etc. It will also show you any discounts that are - * applicable to the invoice. - * - * Note that when you are viewing an upcoming invoice, you are simply viewing a - * preview – the invoice has not yet been created. As such, the upcoming invoice - * will not show up in invoice listing calls, and you cannot use the API to pay or - * edit the invoice. If you want to change the amount that your customer will be - * billed, you can add, remove, or update pending invoice items, or update the - * customer’s discount. - * - * You can preview the effects of updating a subscription, including a preview of - * what proration will take place. To ensure that the actual proration is - * calculated exactly the same as the previewed proration, you should pass a - * proration_date parameter when doing the actual subscription update. - * The value passed in should be the same as the - * subscription_proration_date returned on the upcoming invoice - * resource. The recommended way to get only the prorations being previewed is to - * consider only proration line items where period[start] is equal to - * the subscription_proration_date on the upcoming invoice resource. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function upcoming($params = null, $opts = null) - { - return $this->request('get', '/v1/invoices/upcoming', $params, $opts); - } - - /** - * When retrieving an upcoming invoice, you’ll get a lines - * property containing the total count of line items and the first handful of those - * items. There is also a URL where you can retrieve the full (paginated) list of - * line items. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function upcomingLines($params = null, $opts = null) - { - return $this->request('get', '/v1/invoices/upcoming/lines', $params, $opts); - } - - /** - * Draft invoices are fully editable. Once an invoice is finalized, monetary values, - * as well as collection_method, become uneditable. - * - * If you would like to stop the Stripe Billing engine from automatically - * finalizing, reattempting payments on, sending reminders for, or automatically reconciling - * invoices, pass auto_advance=false. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); - } - - /** - * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is - * similar to deletion, however it only applies to - * finalized invoices and maintains a papertrail where the invoice can still be - * found. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Invoice - */ - public function voidInvoice($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/invoices', $params, $opts); + } + + /** + * When retrieving an invoice, you’ll get a lines property + * containing the total count of line items and the first handful of those items. + * There is also a URL where you can retrieve the full (paginated) list of line + * items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts); + } + + /** + * This endpoint creates a draft invoice for a given customer. The draft invoice + * created pulls in all pending invoice items on that customer, including + * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to + * your customers. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoices', $params, $opts); + } + + /** + * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to + * delete invoices that are no longer in a draft state will fail; once an invoice + * has been finalized or if an invoice is for a subscription, it must be voided. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on + * invoices. However, if you’d like to finalize a draft invoice manually, you can + * do so using this method. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function finalizeInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts); + } + + /** + * Marking an invoice as uncollectible is useful for keeping track of bad debts + * that can be written off for accounting purposes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function markUncollectible($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts); + } + + /** + * Stripe automatically creates and then attempts to collect payment on invoices + * for customers on subscriptions according to your subscriptions + * settings. However, if you’d like to attempt payment on an invoice out of the + * normal collection schedule or for some other reason, you can do so. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the invoice with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Invoice> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/invoices/search', $params, $opts); + } + + /** + * Stripe will automatically send invoices to customers according to your subscriptions + * settings. However, if you’d like to manually send an invoice to your + * customer out of the normal schedule, you can do so. When sending invoices that + * have already been paid, there will be no reference to the payment in the email. + * + * Requests made in test-mode result in no emails being sent, despite sending an + * invoice.sent event. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function sendInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); + } + + /** + * At any time, you can preview the upcoming invoice for a customer. This will show + * you all the charges that are pending, including subscription renewal charges, + * invoice item charges, etc. It will also show you any discounts that are + * applicable to the invoice. + * + * Note that when you are viewing an upcoming invoice, you are simply viewing a + * preview – the invoice has not yet been created. As such, the upcoming invoice + * will not show up in invoice listing calls, and you cannot use the API to pay or + * edit the invoice. If you want to change the amount that your customer will be + * billed, you can add, remove, or update pending invoice items, or update the + * customer’s discount. + * + * You can preview the effects of updating a subscription, including a preview of + * what proration will take place. To ensure that the actual proration is + * calculated exactly the same as the previewed proration, you should pass a + * proration_date parameter when doing the actual subscription update. + * The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice + * resource. The recommended way to get only the prorations being previewed is to + * consider only proration line items where period[start] is equal to + * the subscription_proration_date on the upcoming invoice resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function upcoming($params = null, $opts = null) + { + return $this->request('get', '/v1/invoices/upcoming', $params, $opts); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines + * property containing the total count of line items and the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Invoice> + */ + public function upcomingLines($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/invoices/upcoming/lines', $params, $opts); + } + + /** + * Draft invoices are fully editable. Once an invoice is finalized, monetary values, + * as well as collection_method, become uneditable. + * + * If you would like to stop the Stripe Billing engine from automatically + * finalizing, reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is + * similar to deletion, however it only applies to + * finalized invoices and maintains a papertrail where the invoice can still be + * found. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function voidInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php index 6fff70e..f28b282 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php @@ -1,97 +1,97 @@ -Authorization objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts); - } - - /** - * Approves a pending Issuing Authorization object. This request - * should be made within the timeout window of the real-time - * authorization flow. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function approve($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts); - } - - /** - * Declines a pending Issuing Authorization object. This request - * should be made within the timeout window of the real time - * authorization flow. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function decline($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts); - } - - /** - * Retrieves an Issuing Authorization object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Authorization object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Authorization - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); - } -} +Authorization objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Authorization> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts); + } + + /** + * Approves a pending Issuing Authorization object. This request + * should be made within the timeout window of the real-time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts); + } + + /** + * Declines a pending Issuing Authorization object. This request + * should be made within the timeout window of the real time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function decline($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts); + } + + /** + * Retrieves an Issuing Authorization object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Authorization object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php index 346d54a..4dde0fd 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/CardService.php @@ -1,73 +1,73 @@ -Card objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts); - } - - /** - * Creates an Issuing Card object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/cards', $params, $opts); - } - - /** - * Retrieves an Issuing Card object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Card object by setting the values of - * the parameters passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Card - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); - } -} +Card objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Card> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts); + } + + /** + * Creates an Issuing Card object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cards', $params, $opts); + } + + /** + * Retrieves an Issuing Card object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Card object by setting the values of + * the parameters passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php index 5731b1b..97776c0 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/CardholderService.php @@ -1,74 +1,74 @@ -Cardholder objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts); - } - - /** - * Creates a new Issuing Cardholder object that can be issued cards. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/cardholders', $params, $opts); - } - - /** - * Retrieves an Issuing Cardholder object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Cardholder object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Cardholder - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); - } -} +Cardholder objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Cardholder> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Creates a new Issuing Cardholder object that can be issued cards. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Retrieves an Issuing Cardholder object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Cardholder object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php index ab5df5f..f3d0a6c 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php @@ -1,99 +1,99 @@ -Dispute objects. The objects are sorted - * in descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts); - } - - /** - * Creates an Issuing Dispute object. Individual pieces of evidence - * within the evidence object are optional at this point. Stripe only - * validates that required evidence is present during submission. Refer to Dispute - * reasons and evidence for more details about evidence requirements. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/issuing/disputes', $params, $opts); - } - - /** - * Retrieves an Issuing Dispute object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); - } - - /** - * Submits an Issuing Dispute to the card network. Stripe validates - * that all evidence fields required for the dispute’s reason are present. For more - * details, see Dispute - * reasons and evidence. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function submit($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Dispute object by setting the values - * of the parameters passed. Any parameters not provided will be left unchanged. - * Properties on the evidence object can be unset by passing in an - * empty string. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Dispute - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); - } -} +Dispute objects. The objects are sorted + * in descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Dispute> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Creates an Issuing Dispute object. Individual pieces of evidence + * within the evidence object are optional at this point. Stripe only + * validates that required evidence is present during submission. Refer to Dispute + * reasons and evidence for more details about evidence requirements. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Retrieves an Issuing Dispute object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } + + /** + * Submits an Issuing Dispute to the card network. Stripe validates + * that all evidence fields required for the dispute’s reason are present. For more + * details, see Dispute + * reasons and evidence. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function submit($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Dispute object by setting the values + * of the parameters passed. Any parameters not provided will be left unchanged. + * Properties on the evidence object can be unset by passing in an + * empty string. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php index a8d5d0f..89f2c8c 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/IssuingServiceFactory.php @@ -1,33 +1,33 @@ - - */ - private static $classMap = [ - 'authorizations' => AuthorizationService::class, - 'cardholders' => CardholderService::class, - 'cards' => CardService::class, - 'disputes' => DisputeService::class, - 'transactions' => TransactionService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'authorizations' => AuthorizationService::class, + 'cardholders' => CardholderService::class, + 'cards' => CardService::class, + 'disputes' => DisputeService::class, + 'transactions' => TransactionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php b/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php index 8fb0ee2..04b7a01 100644 --- a/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php +++ b/vendor/stripe/stripe-php/lib/Service/Issuing/TransactionService.php @@ -1,59 +1,59 @@ -Transaction objects. The objects are - * sorted in descending order by creation date, with the most recently created - * object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); - } - - /** - * Retrieves an Issuing Transaction object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Transaction - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); - } - - /** - * Updates the specified Issuing Transaction object by setting the - * values of the parameters passed. Any parameters not provided will be left - * unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\Transaction - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); - } -} +Transaction objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Issuing\Transaction> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); + } + + /** + * Retrieves an Issuing Transaction object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Transaction object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/MandateService.php b/vendor/stripe/stripe-php/lib/Service/MandateService.php index 156bff0..21f6e02 100644 --- a/vendor/stripe/stripe-php/lib/Service/MandateService.php +++ b/vendor/stripe/stripe-php/lib/Service/MandateService.php @@ -1,24 +1,24 @@ -request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); - } -} +request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OAuthService.php b/vendor/stripe/stripe-php/lib/Service/OAuthService.php index b745ad9..9ad4383 100644 --- a/vendor/stripe/stripe-php/lib/Service/OAuthService.php +++ b/vendor/stripe/stripe-php/lib/Service/OAuthService.php @@ -1,150 +1,150 @@ -_parseOpts($opts); - $opts->apiBase = $this->_getBase($opts); - - return $this->request($method, $path, $params, $opts); - } - - /** - * Generates a URL to Stripe's OAuth form. - * - * @param null|array $params - * @param null|array $opts - * - * @return string the URL to Stripe's OAuth form - */ - public function authorizeUrl($params = null, $opts = null) - { - $params = $params ?: []; - - $opts = $this->_parseOpts($opts); - $base = $this->_getBase($opts); - - $params['client_id'] = $this->_getClientId($params); - if (!\array_key_exists('response_type', $params)) { - $params['response_type'] = 'code'; - } - $query = \Stripe\Util\Util::encodeParameters($params); - - return $base . '/oauth/authorize?' . $query; - } - - /** - * Use an authoriztion code to connect an account to your platform and - * fetch the user's credentials. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function token($params = null, $opts = null) - { - $params = $params ?: []; - $params['client_secret'] = $this->_getClientSecret($params); - - return $this->requestConnect('post', '/oauth/token', $params, $opts); - } - - /** - * Disconnects an account from your platform. - * - * @param null|array $params - * @param null|array $opts - * - * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails - * - * @return \Stripe\StripeObject object containing the response from the API - */ - public function deauthorize($params = null, $opts = null) - { - $params = $params ?: []; - $params['client_id'] = $this->_getClientId($params); - - return $this->requestConnect('post', '/oauth/deauthorize', $params, $opts); - } - - private function _getClientId($params = null) - { - $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; - - if (null === $clientId) { - $clientId = $this->client->getClientId(); - } - if (null === $clientId) { - $msg = 'No client_id provided. (HINT: set your client_id using ' - . '`new \Stripe\StripeClient([clientId => - ])`)". You can find your client_ids ' - . 'in your Stripe dashboard at ' - . 'https://dashboard.stripe.com/account/applications/settings, ' - . 'after registering your account as a platform. See ' - . 'https://stripe.com/docs/connect/standard-accounts for details, ' - . 'or email support@stripe.com if you have any questions.'; - - throw new \Stripe\Exception\AuthenticationException($msg); - } - - return $clientId; - } - - private function _getClientSecret($params = null) - { - if (\array_key_exists('client_secret', $params)) { - return $params['client_secret']; - } - - return $this->client->getApiKey(); - } - - /** - * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request - * - * @throws \Stripe\Exception\InvalidArgumentException - * - * @return \Stripe\Util\RequestOptions - */ - private function _parseOpts($opts) - { - if (\is_array($opts)) { - if (\array_key_exists('connect_base', $opts)) { - // Throw an exception for the convenience of anybody migrating to - // \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` - // was the name of the parameter that behaves as `api_base` does here. - throw new \Stripe\Exception\InvalidArgumentException('Use `api_base`, not `connect_base`'); - } - } - - return \Stripe\Util\RequestOptions::parse($opts); - } - - /** - * @param \Stripe\Util\RequestOptions $opts - * - * @return string - */ - private function _getBase($opts) - { - return isset($opts->apiBase) ? - $opts->apiBase : - $this->client->getConnectBase(); - } -} +_parseOpts($opts); + $opts->apiBase = $this->_getBase($opts); + + return $this->request($method, $path, $params, $opts); + } + + /** + * Generates a URL to Stripe's OAuth form. + * + * @param null|array $params + * @param null|array $opts + * + * @return string the URL to Stripe's OAuth form + */ + public function authorizeUrl($params = null, $opts = null) + { + $params = $params ?: []; + + $opts = $this->_parseOpts($opts); + $base = $this->_getBase($opts); + + $params['client_id'] = $this->_getClientId($params); + if (!\array_key_exists('response_type', $params)) { + $params['response_type'] = 'code'; + } + $query = \Stripe\Util\Util::encodeParameters($params); + + return $base . '/oauth/authorize?' . $query; + } + + /** + * Use an authoriztion code to connect an account to your platform and + * fetch the user's credentials. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function token($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_secret'] = $this->_getClientSecret($params); + + return $this->requestConnect('post', '/oauth/token', $params, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_id'] = $this->_getClientId($params); + + return $this->requestConnect('post', '/oauth/deauthorize', $params, $opts); + } + + private function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + + if (null === $clientId) { + $clientId = $this->client->getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '`new \Stripe\StripeClient([clientId => + ])`)". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $clientId; + } + + private function _getClientSecret($params = null) + { + if (\array_key_exists('client_secret', $params)) { + return $params['client_secret']; + } + + return $this->client->getApiKey(); + } + + /** + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return \Stripe\Util\RequestOptions + */ + private function _parseOpts($opts) + { + if (\is_array($opts)) { + if (\array_key_exists('connect_base', $opts)) { + // Throw an exception for the convenience of anybody migrating to + // \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` + // was the name of the parameter that behaves as `api_base` does here. + throw new \Stripe\Exception\InvalidArgumentException('Use `api_base`, not `connect_base`'); + } + } + + return \Stripe\Util\RequestOptions::parse($opts); + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @return string + */ + private function _getBase($opts) + { + return isset($opts->apiBase) ? + $opts->apiBase : + $this->client->getConnectBase(); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php b/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php index 6183166..8f26e20 100644 --- a/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php +++ b/vendor/stripe/stripe-php/lib/Service/OrderReturnService.php @@ -1,42 +1,42 @@ -requestCollection('get', '/v1/order_returns', $params, $opts); - } - - /** - * Retrieves the details of an existing order return. Supply the unique order ID - * from either an order return creation request or the order return list, and - * Stripe will return the corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/order_returns', $params, $opts); + } + + /** + * Retrieves the details of an existing order return. Supply the unique order ID + * from either an order return creation request or the order return list, and + * Stripe will return the corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/OrderService.php b/vendor/stripe/stripe-php/lib/Service/OrderService.php index fa658fa..0823109 100644 --- a/vendor/stripe/stripe-php/lib/Service/OrderService.php +++ b/vendor/stripe/stripe-php/lib/Service/OrderService.php @@ -1,109 +1,109 @@ -requestCollection('get', '/v1/orders', $params, $opts); - } - - /** - * Creates a new order object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/orders', $params, $opts); - } - - /** - * Pay an order by providing a source to create a payment. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function pay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing order. Supply the unique order ID from - * either an order creation request or the order list, and Stripe will return the - * corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } - - /** - * Return all or part of an order. The order must have a status of - * paid or fulfilled before it can be returned. Once all - * items have been returned, the order will become canceled or - * returned depending on which status the order started in. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function returnOrder($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); - } - - /** - * Updates the specific order by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/orders', $params, $opts); + } + + /** + * Creates a new order object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/orders', $params, $opts); + } + + /** + * Pay an order by providing a source to create a payment. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing order. Supply the unique order ID from + * either an order creation request or the order list, and Stripe will return the + * corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } + + /** + * Return all or part of an order. The order must have a status of + * paid or fulfilled before it can be returned. Once all + * items have been returned, the order will become canceled or + * returned depending on which status the order started in. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function returnOrder($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); + } + + /** + * Updates the specific order by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php b/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php index 43aba46..d197ab6 100644 --- a/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php +++ b/vendor/stripe/stripe-php/lib/Service/PaymentIntentService.php @@ -1,181 +1,283 @@ -requestCollection('get', '/v1/payment_intents', $params, $opts); - } - - /** - * A PaymentIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_capture, - * requires_confirmation, or requires_action. - * - * Once canceled, no additional charges will be made by the PaymentIntent and any - * operations on the PaymentIntent will fail with an error. For PaymentIntents with - * status=’requires_capture’, the remaining - * amount_capturable will automatically be refunded. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/cancel', $id), $params, $opts); - } - - /** - * Capture the funds of an existing uncaptured PaymentIntent when its status is - * requires_capture. - * - * Uncaptured PaymentIntents will be canceled exactly seven days after they are - * created. - * - * Learn more about separate authorization - * and capture. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function capture($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/capture', $id), $params, $opts); - } - - /** - * Confirm that your customer intends to pay with current or provided payment - * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - * - * If the selected payment method requires additional authentication steps, the - * PaymentIntent will transition to the requires_action status and - * suggest additional actions via next_action. If payment fails, the - * PaymentIntent will transition to the requires_payment_method - * status. If payment succeeds, the PaymentIntent will transition to the - * succeeded status (or requires_capture, if - * capture_method is set to manual). - * - * If the confirmation_method is automatic, payment may - * be attempted using our client SDKs and - * the PaymentIntent’s client_secret. After - * next_actions are handled by the client, no additional confirmation - * is required to complete the payment. - * - * If the confirmation_method is manual, all payment - * attempts must be initiated using a secret key. If any actions are required for - * the payment, the PaymentIntent will return to the - * requires_confirmation state after those actions are completed. Your - * server needs to then explicitly re-confirm the PaymentIntent to initiate the - * next payment attempt. Read the expanded documentation to - * learn more about manual confirmation. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function confirm($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s/confirm', $id), $params, $opts); - } - - /** - * Creates a PaymentIntent object. - * - * After the PaymentIntent is created, attach a payment method and confirm to continue the payment. - * You can read more about the different payment flows available via the Payment - * Intents API here. - * - * When confirm=true is used during creation, it is equivalent to - * creating and confirming the PaymentIntent in the same call. You may use any - * parameters available in the confirm - * API when confirm=true is supplied. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payment_intents', $params, $opts); - } - - /** - * Retrieves the details of a PaymentIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the - * client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be - * returned. Please refer to the payment - * intent object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); - } - - /** - * Updates properties on a PaymentIntent object without confirming. - * - * Depending on which properties you update, you may need to confirm the - * PaymentIntent again. For example, updating the payment_method will - * always require you to confirm the PaymentIntent again. If you prefer to update - * and confirm at the same time, we recommend updating properties via the confirm API instead. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentIntent - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/payment_intents', $params, $opts); + } + + /** + * Manually reconcile the remaining amount for a customer_balance PaymentIntent. + * + * This can be used when the cash balance for a + * customer in manual reconciliation mode received funds. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function applyCustomerBalance($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/apply_customer_balance', $id), $params, $opts); + } + + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, + * requires_confirmation, requires_action, or + * processing. + * + * Once canceled, no additional charges will be made by the PaymentIntent and any + * operations on the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining + * amount_capturable will automatically be refunded. + * + * You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. + * + * Uncaptured PaymentIntents will be canceled a set number of days after they are + * created (7 by default). + * + * Learn more about separate authorization + * and capture. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/capture', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to pay with current or provided payment + * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. + * + * If the selected payment method requires additional authentication steps, the + * PaymentIntent will transition to the requires_action status and + * suggest additional actions via next_action. If payment fails, the + * PaymentIntent will transition to the requires_payment_method + * status. If payment succeeds, the PaymentIntent will transition to the + * succeeded status (or requires_capture, if + * capture_method is set to manual). + * + * If the confirmation_method is automatic, payment may + * be attempted using our client SDKs and + * the PaymentIntent’s client_secret. After + * next_actions are handled by the client, no additional confirmation + * is required to complete the payment. + * + * If the confirmation_method is manual, all payment + * attempts must be initiated using a secret key. If any actions are required for + * the payment, the PaymentIntent will return to the + * requires_confirmation state after those actions are completed. Your + * server needs to then explicitly re-confirm the PaymentIntent to initiate the + * next payment attempt. Read the expanded documentation to + * learn more about manual confirmation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a PaymentIntent object. + * + * After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment + * Intents API here. + * + * When confirm=true is used during creation, it is equivalent to + * creating and confirming the PaymentIntent in the same call. You may use any + * parameters available in the confirm + * API when confirm=true is supplied. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_intents', $params, $opts); + } + + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, the + * PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. + * + * Incremental authorizations attempt to increase the authorized amount on your + * customer’s card to the new, higher amount provided. As with the + * initial authorization, incremental authorizations may be declined. A single + * PaymentIntent can call this endpoint multiple times to further increase the + * authorized amount. + * + * If the incremental authorization succeeds, the PaymentIntent object is returned + * with the updated amount. + * If the incremental authorization fails, a card_declined error is returned, and + * no fields on the PaymentIntent or Charge are updated. The PaymentIntent object + * remains capturable for the previously authorized amount. + * + * Each PaymentIntent can have a maximum of 10 incremental authorization attempts, + * including declines. Once captured, a PaymentIntent can no longer be incremented. + * + * Learn more about incremental + * authorizations. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function incrementAuthorization($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/increment_authorization', $id), $params, $opts); + } + + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the payment + * intent object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } + + /** + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\PaymentIntent> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/payment_intents/search', $params, $opts); + } + + /** + * Updates properties on a PaymentIntent object without confirming. + * + * Depending on which properties you update, you may need to confirm the + * PaymentIntent again. For example, updating the payment_method will + * always require you to confirm the PaymentIntent again. If you prefer to update + * and confirm at the same time, we recommend updating properties via the confirm API instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } + + /** + * Verifies microdeposits on a PaymentIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function verifyMicrodeposits($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/verify_microdeposits', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php b/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php new file mode 100644 index 0000000..afd3152 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/PaymentLinkService.php @@ -0,0 +1,89 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/payment_links', $params, $opts); + } + + /** + * When retrieving a payment link, there is an includable + * line_items property containing the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\PaymentLink> + */ + public function allLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/payment_links/%s/line_items', $id), $params, $opts); + } + + /** + * Creates a payment link. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_links', $params, $opts); + } + + /** + * Retrieve a payment link. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); + } + + /** + * Updates a payment link. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php b/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php index 7111b9e..3ab1d24 100644 --- a/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php +++ b/vendor/stripe/stripe-php/lib/Service/PaymentMethodService.php @@ -1,121 +1,130 @@ -requestCollection('get', '/v1/payment_methods', $params, $opts); - } - - /** - * Attaches a PaymentMethod object to a Customer. - * - * To attach a new PaymentMethod to a customer for future payments, we recommend - * you use a SetupIntent or a PaymentIntent - * with setup_future_usage. - * These approaches will perform any necessary steps to ensure that the - * PaymentMethod can be used in a future payment. Using the - * /v1/payment_methods/:id/attach endpoint does not ensure that future - * payments can be made with the attached PaymentMethod. See Optimizing cards for future - * payments for more information about setting up future payments. - * - * To use this PaymentMethod as the default for invoice or subscription payments, - * set invoice_settings.default_payment_method, - * on the Customer to the PaymentMethod’s ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function attach($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts); - } - - /** - * Creates a PaymentMethod object. Read the Stripe.js - * reference to learn how to create PaymentMethods via Stripe.js. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payment_methods', $params, $opts); - } - - /** - * Detaches a PaymentMethod object from a Customer. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function detach($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts); - } - - /** - * Retrieves a PaymentMethod object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); - } - - /** - * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to - * be updated. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PaymentMethod - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); - } -} +List a Customer’s + * PaymentMethods. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\PaymentMethod> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/payment_methods', $params, $opts); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + * To attach a new PaymentMethod to a customer for future payments, we recommend + * you use a SetupIntent or a PaymentIntent + * with setup_future_usage. + * These approaches will perform any necessary steps to ensure that the + * PaymentMethod can be used in a future payment. Using the + * /v1/payment_methods/:id/attach endpoint does not ensure that future + * payments can be made with the attached PaymentMethod. See Optimizing cards for future + * payments for more information about setting up future payments. + * + * To use this PaymentMethod as the default for invoice or subscription payments, + * set invoice_settings.default_payment_method, + * on the Customer to the PaymentMethod’s ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function attach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts); + } + + /** + * Creates a PaymentMethod object. Read the Stripe.js + * reference to learn how to create PaymentMethods via Stripe.js. + * + * Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a + * payment immediately or the SetupIntent API to collect payment + * method details ahead of a future payment. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_methods', $params, $opts); + } + + /** + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is + * detached, it can no longer be used for a payment or re-attached to a Customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function detach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts); + } + + /** + * Retrieves a PaymentMethod object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } + + /** + * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to + * be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PayoutService.php b/vendor/stripe/stripe-php/lib/Service/PayoutService.php index 547e22d..702e051 100644 --- a/vendor/stripe/stripe-php/lib/Service/PayoutService.php +++ b/vendor/stripe/stripe-php/lib/Service/PayoutService.php @@ -1,127 +1,127 @@ -requestCollection('get', '/v1/payouts', $params, $opts); - } - - /** - * A previously created payout can be canceled if it has not yet been paid out. - * Funds will be refunded to your available balance. You may not cancel automatic - * Stripe payouts. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s/cancel', $id), $params, $opts); - } - - /** - * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or - * you’ll receive an “Insufficient Funds” error. - * - * If your API key is in test mode, money won’t actually be sent, though everything - * else will occur as if in live mode. - * - * If you are creating a manual payout on a Stripe account that uses multiple - * payment source types, you’ll need to specify the source type balance that the - * payout should draw from. The balance object - * details available and pending amounts by source type. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/payouts', $params, $opts); - } - - /** - * Retrieves the details of an existing payout. Supply the unique payout ID from - * either a payout creation request or the payout list, and Stripe will return the - * corresponding payout information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); - } - - /** - * Reverses a payout by debiting the destination bank account. Only payouts for - * connected accounts to US bank accounts may be reversed at this time. If the - * payout is in the pending status, - * /v1/payouts/:id/cancel should be used instead. - * - * By requesting a reversal via /v1/payouts/:id/reverse, you confirm - * that the authorized signatory of the selected bank account has authorized the - * debit on the bank account and that no other authorization is required. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function reverse($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts); - } - - /** - * Updates the specified payout by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. This request accepts only the - * metadata as arguments. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Payout - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/payouts', $params, $opts); + } + + /** + * A previously created payout can be canceled if it has not yet been paid out. + * Funds will be refunded to your available balance. You may not cancel automatic + * Stripe payouts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or + * you’ll receive an “Insufficient Funds” error. + * + * If your API key is in test mode, money won’t actually be sent, though everything + * else will occur as if in live mode. + * + * If you are creating a manual payout on a Stripe account that uses multiple + * payment source types, you’ll need to specify the source type balance that the + * payout should draw from. The balance object + * details available and pending amounts by source type. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payouts', $params, $opts); + } + + /** + * Retrieves the details of an existing payout. Supply the unique payout ID from + * either a payout creation request or the payout list, and Stripe will return the + * corresponding payout information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } + + /** + * Reverses a payout by debiting the destination bank account. Only payouts for + * connected accounts to US bank accounts may be reversed at this time. If the + * payout is in the pending status, + * /v1/payouts/:id/cancel should be used instead. + * + * By requesting a reversal via /v1/payouts/:id/reverse, you confirm + * that the authorized signatory of the selected bank account has authorized the + * debit on the bank account and that no other authorization is required. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function reverse($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. This request accepts only the + * metadata as arguments. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PlanService.php b/vendor/stripe/stripe-php/lib/Service/PlanService.php index 16625d2..c71394a 100644 --- a/vendor/stripe/stripe-php/lib/Service/PlanService.php +++ b/vendor/stripe/stripe-php/lib/Service/PlanService.php @@ -1,91 +1,91 @@ -requestCollection('get', '/v1/plans', $params, $opts); - } - - /** - * You can now model subscriptions more flexibly using the Prices - * API. It replaces the Plans API and is backwards compatible to simplify your - * migration. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/plans', $params, $opts); - } - - /** - * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t - * affected. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } - - /** - * Retrieves the plan with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } - - /** - * Updates the specified plan by setting the values of the parameters passed. Any - * parameters not provided are left unchanged. By design, you cannot change a - * plan’s ID, amount, currency, or billing cycle. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Plan - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/plans', $params, $opts); + } + + /** + * You can now model subscriptions more flexibly using the Prices + * API. It replaces the Plans API and is backwards compatible to simplify your + * migration. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/plans', $params, $opts); + } + + /** + * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t + * affected. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Retrieves the plan with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Updates the specified plan by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. By design, you cannot change a + * plan’s ID, amount, currency, or billing cycle. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PriceService.php b/vendor/stripe/stripe-php/lib/Service/PriceService.php index cc44f69..33c62db 100644 --- a/vendor/stripe/stripe-php/lib/Service/PriceService.php +++ b/vendor/stripe/stripe-php/lib/Service/PriceService.php @@ -1,72 +1,92 @@ -requestCollection('get', '/v1/prices', $params, $opts); - } - - /** - * Creates a new price for an existing product. The price can be recurring or - * one-time. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/prices', $params, $opts); - } - - /** - * Retrieves the price with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); - } - - /** - * Updates the specified price by setting the values of the parameters passed. Any - * parameters not provided are left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Price - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/prices', $params, $opts); + } + + /** + * Creates a new price for an existing product. The price can be recurring or + * one-time. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/prices', $params, $opts); + } + + /** + * Retrieves the price with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } + + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Price> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/prices/search', $params, $opts); + } + + /** + * Updates the specified price by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ProductService.php b/vendor/stripe/stripe-php/lib/Service/ProductService.php index 850cea5..32f8ba1 100644 --- a/vendor/stripe/stripe-php/lib/Service/ProductService.php +++ b/vendor/stripe/stripe-php/lib/Service/ProductService.php @@ -1,92 +1,112 @@ -requestCollection('get', '/v1/products', $params, $opts); - } - - /** - * Creates a new product object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/products', $params, $opts); - } - - /** - * Delete a product. Deleting a product is only possible if it has no prices - * associated with it. Additionally, deleting a product with type=good - * is only possible if it has no SKUs associated with it. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing product. Supply the unique product ID from - * either a product creation request or the product list, and Stripe will return - * the corresponding product information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } - - /** - * Updates the specific product by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Product - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/products', $params, $opts); + } + + /** + * Creates a new product object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/products', $params, $opts); + } + + /** + * Delete a product. Deleting a product is only possible if it has no prices + * associated with it. Additionally, deleting a product with type=good + * is only possible if it has no SKUs associated with it. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing product. Supply the unique product ID from + * either a product creation request or the product list, and Stripe will return + * the corresponding product information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Product> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/products/search', $params, $opts); + } + + /** + * Updates the specific product by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php b/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php index 1de5696..7f8d4dc 100644 --- a/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php +++ b/vendor/stripe/stripe-php/lib/Service/PromotionCodeService.php @@ -1,72 +1,75 @@ -requestCollection('get', '/v1/promotion_codes', $params, $opts); - } - - /** - * A promotion code points to a coupon. You can optionally restrict the code to a - * specific customer, redemption limit, and expiration date. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/promotion_codes', $params, $opts); - } - - /** - * Retrieves the promotion code with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); - } - - /** - * Updates the specified promotion code by setting the values of the parameters - * passed. Most fields are, by design, not editable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\PromotionCode - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/promotion_codes', $params, $opts); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a + * specific customer, redemption limit, and expiration date. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/promotion_codes', $params, $opts); + } + + /** + * Retrieves the promotion code with the given ID. In order to retrieve a promotion + * code by the customer-facing code use list with the desired + * code. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } + + /** + * Updates the specified promotion code by setting the values of the parameters + * passed. Most fields are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/QuoteService.php b/vendor/stripe/stripe-php/lib/Service/QuoteService.php new file mode 100644 index 0000000..721a5e1 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/QuoteService.php @@ -0,0 +1,177 @@ +request('post', $this->buildPath('/v1/quotes/%s/accept', $id), $params, $opts); + } + + /** + * Returns a list of your quotes. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/quotes', $params, $opts); + } + + /** + * When retrieving a quote, there is an includable computed.upfront.line_items + * property containing the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of upfront line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> + */ + public function allComputedUpfrontLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/computed_upfront_line_items', $id), $params, $opts); + } + + /** + * When retrieving a quote, there is an includable line_items + * property containing the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> + */ + public function allLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts); + } + + /** + * Cancels the quote. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts); + } + + /** + * A quote models prices and services for a customer. Default options for + * header, description, footer, and + * expires_at can be set in the dashboard via the quote template. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/quotes', $params, $opts); + } + + /** + * Finalizes the quote. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function finalizeQuote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); + } + + /** + * Retrieves the quote with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); + } + + /** + * A quote models prices and services for a customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); + } + + /** + * Download the PDF for a finalized quote. + * + * @param string $id + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = $this->getClient()->getFilesBase(); + } + $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php b/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php index 7b09734..1d358f5 100644 --- a/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php +++ b/vendor/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php @@ -1,43 +1,43 @@ -requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); - } - - /** - * Retrieves the details of an early fraud warning that has previously been - * created. - * - * Please refer to the early fraud - * warning object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\EarlyFraudWarning - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); + } + + /** + * Retrieves the details of an early fraud warning that has previously been + * created. + * + * Please refer to the early fraud + * warning object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\EarlyFraudWarning + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php index b093c67..157a767 100644 --- a/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Radar/RadarServiceFactory.php @@ -1,29 +1,29 @@ - - */ - private static $classMap = [ - 'earlyFraudWarnings' => EarlyFraudWarningService::class, - 'valueListItems' => ValueListItemService::class, - 'valueLists' => ValueListService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'earlyFraudWarnings' => EarlyFraudWarningService::class, + 'valueListItems' => ValueListItemService::class, + 'valueLists' => ValueListService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php index 89eba2a..7177e28 100644 --- a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php +++ b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php @@ -1,74 +1,74 @@ -ValueListItem objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts); - } - - /** - * Creates a new ValueListItem object, which is added to the specified - * parent value list. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/radar/value_list_items', $params, $opts); - } - - /** - * Deletes a ValueListItem object, removing it from its parent value - * list. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); - } - - /** - * Retrieves a ValueListItem object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueListItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); - } -} +ValueListItem objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Radar\ValueListItem> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Creates a new ValueListItem object, which is added to the specified + * parent value list. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Deletes a ValueListItem object, removing it from its parent value + * list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueListItem object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php index 64ac2ee..a6f0e12 100644 --- a/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php +++ b/vendor/stripe/stripe-php/lib/Service/Radar/ValueListService.php @@ -1,93 +1,93 @@ -ValueList objects. The objects are sorted in - * descending order by creation date, with the most recently created object - * appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/radar/value_lists', $params, $opts); - } - - /** - * Creates a new ValueList object, which can then be referenced in - * rules. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/radar/value_lists', $params, $opts); - } - - /** - * Deletes a ValueList object, also deleting any items contained - * within the value list. To be deleted, a value list must not be referenced in any - * rules. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } - - /** - * Retrieves a ValueList object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } - - /** - * Updates a ValueList object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. Note that - * item_type is immutable. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Radar\ValueList - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); - } -} +ValueList objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Radar\ValueList> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Creates a new ValueList object, which can then be referenced in + * rules. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Deletes a ValueList object, also deleting any items contained + * within the value list. To be deleted, a value list must not be referenced in any + * rules. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueList object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Updates a ValueList object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. Note that + * item_type is immutable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/RefundService.php b/vendor/stripe/stripe-php/lib/Service/RefundService.php index 49b4267..8744b8b 100644 --- a/vendor/stripe/stripe-php/lib/Service/RefundService.php +++ b/vendor/stripe/stripe-php/lib/Service/RefundService.php @@ -1,76 +1,95 @@ -requestCollection('get', '/v1/refunds', $params, $opts); - } - - /** - * Create a refund. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/refunds', $params, $opts); - } - - /** - * Retrieves the details of an existing refund. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); - } - - /** - * Updates the specified refund by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * This request only accepts metadata as an argument. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Refund - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/refunds', $params, $opts); + } + + /** + * Cancels a refund with a status of requires_action. + * + * Refunds in other states cannot be canceled, and only refunds for payment methods + * that require customer action will enter the requires_action state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts); + } + + /** + * Create a refund. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/refunds', $params, $opts); + } + + /** + * Retrieves the details of an existing refund. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } + + /** + * Updates the specified refund by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php index 692420c..da01985 100644 --- a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php @@ -1,55 +1,55 @@ -requestCollection('get', '/v1/reporting/report_runs', $params, $opts); - } - - /** - * Creates a new object and begin running the report. (Certain report types require - * a live-mode API key.). - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportRun - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/reporting/report_runs', $params, $opts); - } - - /** - * Retrieves the details of an existing Report Run. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportRun - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Creates a new object and begin running the report. (Certain report types require + * a live-mode API key.). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Retrieves the details of an existing Report Run. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php index e1b4ea5..bb8c24c 100644 --- a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php @@ -1,40 +1,40 @@ -requestCollection('get', '/v1/reporting/report_types', $params, $opts); - } - - /** - * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.). - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Reporting\ReportType - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reporting/report_types', $params, $opts); + } + + /** + * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportType + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php index 7832e91..72a6278 100644 --- a/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Reporting/ReportingServiceFactory.php @@ -1,27 +1,27 @@ - - */ - private static $classMap = [ - 'reportRuns' => ReportRunService::class, - 'reportTypes' => ReportTypeService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'reportRuns' => ReportRunService::class, + 'reportTypes' => ReportTypeService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ReviewService.php b/vendor/stripe/stripe-php/lib/Service/ReviewService.php index ea152f2..6762ec6 100644 --- a/vendor/stripe/stripe-php/lib/Service/ReviewService.php +++ b/vendor/stripe/stripe-php/lib/Service/ReviewService.php @@ -1,58 +1,58 @@ -Review objects that have open set to - * true. The objects are sorted in descending order by creation date, - * with the most recently created object appearing first. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/reviews', $params, $opts); - } - - /** - * Approves a Review object, closing it and removing it from the list - * of reviews. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review - */ - public function approve($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); - } - - /** - * Retrieves a Review object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Review - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); - } -} +Review objects that have open set to + * true. The objects are sorted in descending order by creation date, + * with the most recently created object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Review> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reviews', $params, $opts); + } + + /** + * Approves a Review object, closing it and removing it from the list + * of reviews. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); + } + + /** + * Retrieves a Review object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php b/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php index 7376ea1..77484c5 100644 --- a/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php +++ b/vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php @@ -1,23 +1,23 @@ -requestCollection('get', '/v1/setup_attempts', $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/setup_attempts', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php b/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php index 3cbec50..9127c02 100644 --- a/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php +++ b/vendor/stripe/stripe-php/lib/Service/SetupIntentService.php @@ -1,127 +1,143 @@ -requestCollection('get', '/v1/setup_intents', $params, $opts); - } - - /** - * A SetupIntent object can be canceled when it is in one of these statuses: - * requires_payment_method, requires_confirmation, or - * requires_action. - * - * Once canceled, setup is abandoned and any operations on the SetupIntent will - * fail with an error. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts); - } - - /** - * Confirm that your customer intends to set up the current or provided payment - * method. For example, you would confirm a SetupIntent when a customer hits the - * “Save” button on a payment method management page on your website. - * - * If the selected payment method does not require any additional steps from the - * customer, the SetupIntent will transition to the succeeded status. - * - * Otherwise, it will transition to the requires_action status and - * suggest additional actions via next_action. If setup fails, the - * SetupIntent will transition to the requires_payment_method status. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function confirm($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts); - } - - /** - * Creates a SetupIntent object. - * - * After the SetupIntent is created, attach a payment method and confirm to collect any required - * permissions to charge the payment method later. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/setup_intents', $params, $opts); - } - - /** - * Retrieves the details of a SetupIntent that has previously been created. - * - * Client-side retrieval using a publishable key is allowed when the - * client_secret is provided in the query string. - * - * When retrieved with a publishable key, only a subset of properties will be - * returned. Please refer to the SetupIntent - * object reference for more details. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); - } - - /** - * Updates a SetupIntent object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/setup_intents', $params, $opts); + } + + /** + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or + * requires_action. + * + * Once canceled, setup is abandoned and any operations on the SetupIntent will + * fail with an error. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to set up the current or provided payment + * method. For example, you would confirm a SetupIntent when a customer hits the + * “Save” button on a payment method management page on your website. + * + * If the selected payment method does not require any additional steps from the + * customer, the SetupIntent will transition to the succeeded status. + * + * Otherwise, it will transition to the requires_action status and + * suggest additional actions via next_action. If setup fails, the + * SetupIntent will transition to the requires_payment_method status. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a SetupIntent object. + * + * After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/setup_intents', $params, $opts); + } + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the SetupIntent + * object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } + + /** + * Updates a SetupIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } + + /** + * Verifies microdeposits on a SetupIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function verifyMicrodeposits($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/verify_microdeposits', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php b/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php new file mode 100644 index 0000000..e6b371b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/ShippingRateService.php @@ -0,0 +1,70 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/shipping_rates', $params, $opts); + } + + /** + * Creates a new shipping rate object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/shipping_rates', $params, $opts); + } + + /** + * Returns the shipping rate object with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); + } + + /** + * Updates an existing shipping rate object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php b/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php index 9264175..f59b1e3 100644 --- a/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php +++ b/vendor/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php @@ -1,39 +1,39 @@ -requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); - } - - /** - * Retrieves the details of an scheduled query run. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Sigma\ScheduledQueryRun - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); + } + + /** + * Retrieves the details of an scheduled query run. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Sigma\ScheduledQueryRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php index 356750f..c9d83c3 100644 --- a/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Sigma/SigmaServiceFactory.php @@ -1,25 +1,25 @@ - - */ - private static $classMap = [ - 'scheduledQueryRuns' => ScheduledQueryRunService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'scheduledQueryRuns' => ScheduledQueryRunService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SkuService.php b/vendor/stripe/stripe-php/lib/Service/SkuService.php index 8934f20..feedcb1 100644 --- a/vendor/stripe/stripe-php/lib/Service/SkuService.php +++ b/vendor/stripe/stripe-php/lib/Service/SkuService.php @@ -1,95 +1,95 @@ -requestCollection('get', '/v1/skus', $params, $opts); - } - - /** - * Creates a new SKU associated with a product. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/skus', $params, $opts); - } - - /** - * Delete a SKU. Deleting a SKU is only possible until it has been used in an - * order. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from - * either a SKU creation request or from the product, and Stripe will return the - * corresponding SKU information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } - - /** - * Updates the specific SKU by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * Note that a SKU’s attributes are not editable. Instead, you would - * need to deactivate the existing SKU and create a new one with the new attribute - * values. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SKU - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/skus', $params, $opts); + } + + /** + * Creates a new SKU associated with a product. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/skus', $params, $opts); + } + + /** + * Delete a SKU. Deleting a SKU is only possible until it has been used in an + * order. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from + * either a SKU creation request or from the product, and Stripe will return the + * corresponding SKU information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Updates the specific SKU by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * Note that a SKU’s attributes are not editable. Instead, you would + * need to deactivate the existing SKU and create a new one with the new attribute + * values. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SourceService.php b/vendor/stripe/stripe-php/lib/Service/SourceService.php index c6cc059..dcf7788 100644 --- a/vendor/stripe/stripe-php/lib/Service/SourceService.php +++ b/vendor/stripe/stripe-php/lib/Service/SourceService.php @@ -1,110 +1,110 @@ -request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); - } - - /** - * Creates a new source object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/sources', $params, $opts); - } - - /** - * Delete a specified source for a given customer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function detach($parentId, $id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); - } - - /** - * Retrieves an existing source object. Supply the unique source ID from a source - * creation request and Stripe will return the corresponding up-to-date source - * object information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts); - } - - /** - * Updates the specified source by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * This request accepts the metadata and owner as - * arguments. It is also possible to update type specific information for selected - * payment methods. Please refer to our payment method - * guides for more detail. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts); - } - - /** - * Verify a given source. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source - */ - public function verify($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts); - } -} +request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); + } + + /** + * Creates a new source object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/sources', $params, $opts); + } + + /** + * Delete a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function detach($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing source object. Supply the unique source ID from a source + * creation request and Stripe will return the corresponding up-to-date source + * object information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Updates the specified source by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request accepts the metadata and owner as + * arguments. It is also possible to update type specific information for selected + * payment methods. Please refer to our payment method + * guides for more detail. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Verify a given source. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function verify($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php index 3b2aa2b..d0a76e3 100644 --- a/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionItemService.php @@ -1,151 +1,151 @@ -requestCollection('get', '/v1/subscription_items', $params, $opts); - } - - /** - * For the specified subscription item, returns a list of summary objects. Each - * object in the list provides usage information that’s been summarized from - * multiple usage records and over a subscription billing period (e.g., 15 usage - * records in the month of September). - * - * The list is sorted in reverse-chronological order (newest first). The first list - * item represents the most current usage period that hasn’t ended yet. Since new - * usage records can still be added, the returned summary information for the - * subscription item’s ID should be seen as unstable until the subscription billing - * period ends. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allUsageRecordSummaries($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); - } - - /** - * Adds a new item to an existing subscription. No existing items will be changed - * or replaced. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscription_items', $params, $opts); - } - - /** - * Creates a usage record for a specified subscription item and date, and fills it - * with a quantity. - * - * Usage records provide quantity information that Stripe uses to - * track how much a customer is using your service. With usage information and the - * pricing model set up by the metered - * billing plan, Stripe helps you send accurate invoices to your customers. - * - * The default calculation for usage is to add up all the quantity - * values of the usage records within a billing period. You can change this default - * behavior with the billing plan’s aggregate_usage parameter. When - * there is more than one usage record with the same timestamp, Stripe adds the - * quantity values together. In most cases, this is the desired - * resolution, however, you can change this behavior with the action - * parameter. - * - * The default pricing model for metered billing is per-unit pricing. - * For finer granularity, you can configure metered billing to have a tiered pricing - * model. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public function createUsageRecord($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); - } - - /** - * Deletes an item from the subscription. Removing a subscription item from a - * subscription will not cancel the subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } - - /** - * Retrieves the subscription item with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } - - /** - * Updates the plan or quantity of an item on a current subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionItem - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/subscription_items', $params, $opts); + } + + /** + * For the specified subscription item, returns a list of summary objects. Each + * object in the list provides usage information that’s been summarized from + * multiple usage records and over a subscription billing period (e.g., 15 usage + * records in the month of September). + * + * The list is sorted in reverse-chronological order (newest first). The first list + * item represents the most current usage period that hasn’t ended yet. Since new + * usage records can still be added, the returned summary information for the + * subscription item’s ID should be seen as unstable until the subscription billing + * period ends. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\UsageRecordSummary> + */ + public function allUsageRecordSummaries($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); + } + + /** + * Adds a new item to an existing subscription. No existing items will be changed + * or replaced. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_items', $params, $opts); + } + + /** + * Creates a usage record for a specified subscription item and date, and fills it + * with a quantity. + * + * Usage records provide quantity information that Stripe uses to + * track how much a customer is using your service. With usage information and the + * pricing model set up by the metered + * billing plan, Stripe helps you send accurate invoices to your customers. + * + * The default calculation for usage is to add up all the quantity + * values of the usage records within a billing period. You can change this default + * behavior with the billing plan’s aggregate_usage parameter. When + * there is more than one usage record with the same timestamp, Stripe adds the + * quantity values together. In most cases, this is the desired + * resolution, however, you can change this behavior with the action + * parameter. + * + * The default pricing model for metered billing is per-unit pricing. + * For finer granularity, you can configure metered billing to have a tiered pricing + * model. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public function createUsageRecord($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a + * subscription will not cancel the subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Retrieves the subscription item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Updates the plan or quantity of an item on a current subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php index 9eed460..5a3ad6e 100644 --- a/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php @@ -1,113 +1,113 @@ -requestCollection('get', '/v1/subscription_schedules', $params, $opts); - } - - /** - * Cancels a subscription schedule and its associated subscription immediately (if - * the subscription schedule has an active subscription). A subscription schedule - * can only be canceled if its status is not_started or - * active. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/cancel', $id), $params, $opts); - } - - /** - * Creates a new subscription schedule object. Each customer can have up to 500 - * active or scheduled subscriptions. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscription_schedules', $params, $opts); - } - - /** - * Releases the subscription schedule immediately, which will stop scheduling of - * its phases, but leave any existing subscription in place. A schedule can only be - * released if its status is not_started or active. If - * the subscription schedule is currently associated with a subscription, releasing - * it will remove its subscription property and set the subscription’s - * ID to the released_subscription property. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function release($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/release', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing subscription schedule. You only need to - * supply the unique subscription schedule identifier that was returned upon - * subscription schedule creation. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); - } - - /** - * Updates an existing subscription schedule. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Cancels a subscription schedule and its associated subscription immediately (if + * the subscription schedule has an active subscription). A subscription schedule + * can only be canceled if its status is not_started or + * active. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 + * active or scheduled subscriptions. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Releases the subscription schedule immediately, which will stop scheduling of + * its phases, but leave any existing subscription in place. A schedule can only be + * released if its status is not_started or active. If + * the subscription schedule is currently associated with a subscription, releasing + * it will remove its subscription property and set the subscription’s + * ID to the released_subscription property. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function release($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/release', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to + * supply the unique subscription schedule identifier that was returned upon + * subscription schedule creation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } + + /** + * Updates an existing subscription schedule. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php b/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php index f3ac768..dd7f266 100644 --- a/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php +++ b/vendor/stripe/stripe-php/lib/Service/SubscriptionService.php @@ -1,124 +1,155 @@ -status=canceled. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/subscriptions', $params, $opts); - } - - /** - * Cancels a customer’s subscription immediately. The customer will not be charged - * again for the subscription. - * - * Note, however, that any pending invoice items that you’ve created will still be - * charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel - * at the end of the period, any pending prorations will also be left in place and - * collected at the end of the period. But if the subscription is set to cancel - * immediately, pending prorations will be removed. - * - * By default, upon subscription cancellation, Stripe will stop automatic - * collection of all finalized invoices for the customer. This is intended to - * prevent unexpected payment attempts after the customer has canceled a - * subscription. However, you can resume automatic collection of the invoices - * manually after subscription cancellation to have us proceed. Or, you could check - * for unpaid invoices before allowing the customer to cancel the subscription at - * all. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } - - /** - * Creates a new subscription on an existing customer. Each customer can have up to - * 500 active or scheduled subscriptions. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/subscriptions', $params, $opts); - } - - /** - * Removes the currently applied discount on a subscription. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function deleteDiscount($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); - } - - /** - * Retrieves the subscription with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } - - /** - * Updates an existing subscription on a customer to match the specified - * parameters. When changing plans or quantities, we will optionally prorate the - * price we charge next month to make up for any price changes. To preview how the - * proration will be calculated, use the upcoming - * invoice endpoint. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); - } -} +status=canceled. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Subscription> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/subscriptions', $params, $opts); + } + + /** + * Cancels a customer’s subscription immediately. The customer will not be charged + * again for the subscription. + * + * Note, however, that any pending invoice items that you’ve created will still be + * charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel + * at the end of the period, any pending prorations will also be left in place and + * collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic + * collection of all finalized invoices for the customer. This is intended to + * prevent unexpected payment attempts after the customer has canceled a + * subscription. However, you can resume automatic collection of the invoices + * manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at + * all. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Creates a new subscription on an existing customer. Each customer can have up to + * 500 active or scheduled subscriptions. + * + * When you create a subscription with + * collection_method=charge_automatically, the first invoice is + * finalized as part of the request. The payment_behavior parameter + * determines the exact behavior of the initial payment. + * + * To start subscriptions where the first invoice always begins in a + * draft status, use subscription + * schedules instead. Schedules provide the flexibility to model more complex + * billing configurations that change over time. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscriptions', $params, $opts); + } + + /** + * Removes the currently applied discount on a subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); + } + + /** + * Retrieves the subscription with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Subscription> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/subscriptions/search', $params, $opts); + } + + /** + * Updates an existing subscription on a customer to match the specified + * parameters. When changing plans or quantities, we will optionally prorate the + * price we charge next month to make up for any price changes. To preview how the + * proration will be calculated, use the upcoming + * invoice endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php b/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php index 007b771..e892b4e 100644 --- a/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php +++ b/vendor/stripe/stripe-php/lib/Service/TaxCodeService.php @@ -1,41 +1,41 @@ -all tax codes - * available to add to Products in order to allow specific tax calculations. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); - } - - /** - * Retrieves the details of an existing tax code. Supply the unique tax code ID and - * Stripe will return the corresponding tax code information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxCode - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); - } -} +all tax codes + * available to add to Products in order to allow specific tax calculations. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TaxCode> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); + } + + /** + * Retrieves the details of an existing tax code. Supply the unique tax code ID and + * Stripe will return the corresponding tax code information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TaxRateService.php b/vendor/stripe/stripe-php/lib/Service/TaxRateService.php index 7cee1fe..0978e77 100644 --- a/vendor/stripe/stripe-php/lib/Service/TaxRateService.php +++ b/vendor/stripe/stripe-php/lib/Service/TaxRateService.php @@ -1,71 +1,71 @@ -requestCollection('get', '/v1/tax_rates', $params, $opts); - } - - /** - * Creates a new tax rate. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/tax_rates', $params, $opts); - } - - /** - * Retrieves a tax rate with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); - } - - /** - * Updates an existing tax rate. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TaxRate - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax_rates', $params, $opts); + } + + /** + * Creates a new tax rate. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tax_rates', $params, $opts); + } + + /** + * Retrieves a tax rate with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } + + /** + * Updates an existing tax rate. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php new file mode 100644 index 0000000..733d3cc --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php @@ -0,0 +1,86 @@ +Configuration objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Terminal\Configuration> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/configurations', $params, $opts); + } + + /** + * Creates a new Configuration object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Configuration + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/configurations', $params, $opts); + } + + /** + * Deletes a Configuration object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Configuration + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); + } + + /** + * Retrieves a Configuration object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Configuration + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); + } + + /** + * Updates a new Configuration object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Configuration + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php index 7b25b23..db2ef9a 100644 --- a/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/ConnectionTokenService.php @@ -1,25 +1,25 @@ -request('post', '/v1/terminal/connection_tokens', $params, $opts); - } -} +request('post', '/v1/terminal/connection_tokens', $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php index 8adc7a5..456a5a7 100644 --- a/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/LocationService.php @@ -1,87 +1,89 @@ -Location objects. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts); - } - - /** - * Creates a new Location object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/terminal/locations', $params, $opts); - } - - /** - * Deletes a Location object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } - - /** - * Retrieves a Location object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } - - /** - * Updates a Location object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Location - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); - } -} +Location objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Terminal\Location> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts); + } + + /** + * Creates a new Location object. For further details, including which + * address fields are required in each country, see the Manage locations guide. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/locations', $params, $opts); + } + + /** + * Deletes a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Retrieves a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Updates a Location object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php b/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php index 765015c..2f228f2 100644 --- a/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/ReaderService.php @@ -1,87 +1,151 @@ -Reader objects. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function all($params = null, $opts = null) - { - return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); - } - - /** - * Creates a new Reader object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/terminal/readers', $params, $opts); - } - - /** - * Deletes a Reader object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } - - /** - * Retrieves a Reader object. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } - - /** - * Updates a Reader object by setting the values of the parameters - * passed. Any parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Terminal\Reader - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); - } -} +Reader objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Terminal\Reader> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); + } + + /** + * Cancels the current reader action. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function cancelAction($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/cancel_action', $id), $params, $opts); + } + + /** + * Creates a new Reader object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/readers', $params, $opts); + } + + /** + * Deletes a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Initiates a payment flow on a Reader. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function processPaymentIntent($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_payment_intent', $id), $params, $opts); + } + + /** + * Initiates a setup intent flow on a Reader. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function processSetupIntent($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_setup_intent', $id), $params, $opts); + } + + /** + * Retrieves a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Sets reader display to show cart details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function setReaderDisplay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/set_reader_display', $id), $params, $opts); + } + + /** + * Updates a Reader object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php index c70ac87..13ab144 100644 --- a/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php +++ b/vendor/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php @@ -1,29 +1,31 @@ - - */ - private static $classMap = [ - 'connectionTokens' => ConnectionTokenService::class, - 'locations' => LocationService::class, - 'readers' => ReaderService::class, - ]; - - protected function getServiceClass($name) - { - return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; - } -} + + */ + private static $classMap = [ + 'configurations' => ConfigurationService::class, + 'connectionTokens' => ConnectionTokenService::class, + 'locations' => LocationService::class, + 'readers' => ReaderService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php b/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php new file mode 100644 index 0000000..4b558c6 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php @@ -0,0 +1,24 @@ +requires_action. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/refunds/%s/expire', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php b/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php new file mode 100644 index 0000000..b04ed23 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php @@ -0,0 +1,25 @@ +request('post', $this->buildPath('/v1/test_helpers/terminal/readers/%s/present_payment_method', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php new file mode 100644 index 0000000..fb6a772 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'readers' => ReaderService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php b/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php new file mode 100644 index 0000000..f65eee9 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php @@ -0,0 +1,87 @@ +Ready. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function advance($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/test_clocks/%s/advance', $id), $params, $opts); + } + + /** + * Returns a list of your test clocks. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/test_helpers/test_clocks', $params, $opts); + } + + /** + * Creates a new test clock that can be attached to new customers and quotes. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/test_clocks', $params, $opts); + } + + /** + * Deletes a test clock. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); + } + + /** + * Retrieves a test clock. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php new file mode 100644 index 0000000..27438a7 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php @@ -0,0 +1,29 @@ + + */ + private static $classMap = [ + 'refunds' => RefundService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'testClocks' => TestClockService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TokenService.php b/vendor/stripe/stripe-php/lib/Service/TokenService.php index 1c72759..be8adfd 100644 --- a/vendor/stripe/stripe-php/lib/Service/TokenService.php +++ b/vendor/stripe/stripe-php/lib/Service/TokenService.php @@ -1,42 +1,42 @@ -Custom - * account. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Token - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/tokens', $params, $opts); - } - - /** - * Retrieves the token with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Token - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts); - } -} +Custom + * account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tokens', $params, $opts); + } + + /** + * Retrieves the token with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TopupService.php b/vendor/stripe/stripe-php/lib/Service/TopupService.php index 059dc20..038abdc 100644 --- a/vendor/stripe/stripe-php/lib/Service/TopupService.php +++ b/vendor/stripe/stripe-php/lib/Service/TopupService.php @@ -1,89 +1,89 @@ -requestCollection('get', '/v1/topups', $params, $opts); - } - - /** - * Cancels a top-up. Only pending top-ups can be canceled. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/topups/%s/cancel', $id), $params, $opts); - } - - /** - * Top up the balance of an account. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/topups', $params, $opts); - } - - /** - * Retrieves the details of a top-up that has previously been created. Supply the - * unique top-up ID that was returned from your previous request, and Stripe will - * return the corresponding top-up information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/topups/%s', $id), $params, $opts); - } - - /** - * Updates the metadata of a top-up. Other top-up details are not editable by - * design. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/topups', $params, $opts); + } + + /** + * Cancels a top-up. Only pending top-ups can be canceled. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s/cancel', $id), $params, $opts); + } + + /** + * Top up the balance of an account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/topups', $params, $opts); + } + + /** + * Retrieves the details of a top-up that has previously been created. Supply the + * unique top-up ID that was returned from your previous request, and Stripe will + * return the corresponding top-up information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a top-up. Other top-up details are not editable by + * design. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/TransferService.php b/vendor/stripe/stripe-php/lib/Service/TransferService.php index 150bbf7..85664db 100644 --- a/vendor/stripe/stripe-php/lib/Service/TransferService.php +++ b/vendor/stripe/stripe-php/lib/Service/TransferService.php @@ -1,175 +1,175 @@ -requestCollection('get', '/v1/transfers', $params, $opts); - } - - /** - * You can see a list of the reversals belonging to a specific transfer. Note that - * the 10 most recent reversals are always available by default on the transfer - * object. If you need more than those 10, you can use this API method and the - * limit and starting_after parameters to page through - * additional reversals. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection - */ - public function allReversals($parentId, $params = null, $opts = null) - { - return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); - } - - /** - * To send funds from your Stripe account to a connected account, you create a new - * transfer object. Your Stripe balance must be able to - * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/transfers', $params, $opts); - } - - /** - * When you create a new reversal, you must specify a transfer to create it on. - * - * When reversing transfers, you can optionally reverse part of the transfer. You - * can do so as many times as you wish until the entire transfer has been reversed. - * - * Once entirely reversed, a transfer can’t be reversed again. This method will - * return an error when called on an already-reversed transfer, or when trying to - * reverse more money than is left on a transfer. - * - * @param string $parentId - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function createReversal($parentId, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); - } - - /** - * Retrieves the details of an existing transfer. Supply the unique transfer ID - * from either a transfer creation request or the transfer list, and Stripe will - * return the corresponding transfer information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); - } - - /** - * By default, you can see the 10 most recent reversals stored directly on the - * transfer object, but you can also retrieve details about a specific reversal - * stored on the transfer. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function retrieveReversal($parentId, $id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); - } - - /** - * Updates the specified transfer by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. - * - * This request accepts only metadata as an argument. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); - } - - /** - * Updates the specified reversal by setting the values of the parameters passed. - * Any parameters not provided will be left unchanged. - * - * This request only accepts metadata and description as arguments. - * - * @param string $parentId - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public function updateReversal($parentId, $id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/transfers', $params, $opts); + } + + /** + * You can see a list of the reversals belonging to a specific transfer. Note that + * the 10 most recent reversals are always available by default on the transfer + * object. If you need more than those 10, you can use this API method and the + * limit and starting_after parameters to page through + * additional reversals. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TransferReversal> + */ + public function allReversals($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds from your Stripe account to a connected account, you create a new + * transfer object. Your Stripe balance must be able to + * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/transfers', $params, $opts); + } + + /** + * When you create a new reversal, you must specify a transfer to create it on. + * + * When reversing transfers, you can optionally reverse part of the transfer. You + * can do so as many times as you wish until the entire transfer has been reversed. + * + * Once entirely reversed, a transfer can’t be reversed again. This method will + * return an error when called on an already-reversed transfer, or when trying to + * reverse more money than is left on a transfer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function createReversal($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an existing transfer. Supply the unique transfer ID + * from either a transfer creation request or the transfer list, and Stripe will + * return the corresponding transfer information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent reversals stored directly on the + * transfer object, but you can also retrieve details about a specific reversal + * stored on the transfer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function retrieveReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified transfer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request accepts only metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * Updates the specified reversal by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request only accepts metadata and description as arguments. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function updateReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php b/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php index 01e6422..e3ad21d 100644 --- a/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php +++ b/vendor/stripe/stripe-php/lib/Service/WebhookEndpointService.php @@ -1,97 +1,97 @@ -requestCollection('get', '/v1/webhook_endpoints', $params, $opts); - } - - /** - * A webhook endpoint must have a url and a list of - * enabled_events. You may optionally specify the Boolean - * connect parameter. If set to true, then a Connect webhook endpoint - * that notifies the specified url about events from all connected - * accounts is created; otherwise an account webhook endpoint that notifies the - * specified url only about events from your account is created. You - * can also create webhook endpoints in the webhooks settings - * section of the Dashboard. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/webhook_endpoints', $params, $opts); - } - - /** - * You can also delete webhook endpoints via the webhook endpoint - * management page of the Stripe dashboard. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function delete($id, $params = null, $opts = null) - { - return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } - - /** - * Retrieves the webhook endpoint with the given ID. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } - - /** - * Updates the webhook endpoint. You may edit the url, the list of - * enabled_events, and the status of your endpoint. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\WebhookEndpoint - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); - } -} + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * A webhook endpoint must have a url and a list of + * enabled_events. You may optionally specify the Boolean + * connect parameter. If set to true, then a Connect webhook endpoint + * that notifies the specified url about events from all connected + * accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You + * can also create webhook endpoints in the webhooks settings + * section of the Dashboard. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint + * management page of the Stripe dashboard. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Retrieves the webhook endpoint with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Updates the webhook endpoint. You may edit the url, the list of + * enabled_events, and the status of your endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SetupAttempt.php b/vendor/stripe/stripe-php/lib/SetupAttempt.php index 6c83b68..9280237 100644 --- a/vendor/stripe/stripe-php/lib/SetupAttempt.php +++ b/vendor/stripe/stripe-php/lib/SetupAttempt.php @@ -1,32 +1,32 @@ -application on the SetupIntent at the time of this confirmation. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. - * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. - * @property \Stripe\StripeObject $payment_method_details - * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. - * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. - * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. - * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. - */ -class SetupAttempt extends ApiResource -{ - const OBJECT_NAME = 'setup_attempt'; - - use ApiOperations\All; -} +application on the SetupIntent at the time of this confirmation. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. + * @property \Stripe\StripeObject $payment_method_details + * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. + * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. + * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. + * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. + */ +class SetupAttempt extends ApiResource +{ + const OBJECT_NAME = 'setup_attempt'; + + use ApiOperations\All; +} diff --git a/vendor/stripe/stripe-php/lib/SetupIntent.php b/vendor/stripe/stripe-php/lib/SetupIntent.php index 081bb2d..0047ef5 100644 --- a/vendor/stripe/stripe-php/lib/SetupIntent.php +++ b/vendor/stripe/stripe-php/lib/SetupIntent.php @@ -1,114 +1,131 @@ -PaymentIntents to drive - * the payment flow. - * - * Create a SetupIntent as soon as you're ready to collect your customer's payment - * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no - * longer be valid. The SetupIntent then transitions through multiple statuses as - * it guides you through the setup process. - * - * Successful SetupIntents result in payment credentials that are optimized for - * future payments. For example, cardholders in certain regions may need to be - * run through Strong Customer - * Authentication at the time of payment method collection in order to - * streamline later off-session payments. - * If the SetupIntent is used with a Customer, - * upon success, it will automatically attach the resulting payment method to that - * Customer. We recommend using SetupIntents or setup_future_usage - * on PaymentIntents to save payment methods in order to prevent saving invalid or - * unoptimized payment methods. - * - * By using SetupIntents, you ensure that your customers experience the minimum set - * of required friction, even as regulations change over time. - * - * Related guide: Setup - * Intents API. - * - * @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 null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. - * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. - * @property null|string $client_secret

The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

- * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

- * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. - * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. - * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. - * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. - * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. - * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. - * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. - * @property string $usage

Indicates how the payment method is intended to be used in the future.

Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

- */ -class SetupIntent extends ApiResource -{ - const OBJECT_NAME = 'setup_intent'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_PROCESSING = 'processing'; - const STATUS_REQUIRES_ACTION = 'requires_action'; - const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; - const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent the canceled setup intent - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SetupIntent the confirmed setup intent - */ - public function confirm($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/confirm'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +PaymentIntents to drive + * the payment flow. + * + * Create a SetupIntent as soon as you're ready to collect your customer's payment + * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no + * longer be valid. The SetupIntent then transitions through multiple statuses as + * it guides you through the setup process. + * + * Successful SetupIntents result in payment credentials that are optimized for + * future payments. For example, cardholders in certain regions may need to be + * run through Strong Customer + * Authentication at the time of payment method collection in order to + * streamline later off-session payments. + * If the SetupIntent is used with a Customer, + * upon success, it will automatically attach the resulting payment method to that + * Customer. We recommend using SetupIntents or setup_future_usage + * on PaymentIntents to save payment methods in order to prevent saving invalid or + * unoptimized payment methods. + * + * By using SetupIntents, you ensure that your customers experience the minimum set + * of required friction, even as regulations change over time. + * + * Related guide: Setup + * Intents API. + * + * @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 null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. + * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. + * @property null|string $client_secret

The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. + * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. + * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. + * @property string $usage

Indicates how the payment method is intended to be used in the future.

Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

+ */ +class SetupIntent extends ApiResource +{ + const OBJECT_NAME = 'setup_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the canceled setup intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the confirmed setup intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the verified setup intent + */ + public function verifyMicrodeposits($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify_microdeposits'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ShippingRate.php b/vendor/stripe/stripe-php/lib/ShippingRate.php new file mode 100644 index 0000000..3c09d64 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/ShippingRate.php @@ -0,0 +1,40 @@ +Checkout Sessions + * to collect shipping costs. + * + * @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 shipping rate can be used for new purchases. Defaults to true. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + * @property null|string $display_name The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + * @property \Stripe\StripeObject $fixed_amount + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs 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 $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. + * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. + * @property string $type The type of calculation to use on the shipping rate. Can only be fixed_amount for now. + */ +class ShippingRate extends ApiResource +{ + const OBJECT_NAME = 'shipping_rate'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; + const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; + const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; + + const TYPE_FIXED_AMOUNT = 'fixed_amount'; +} diff --git a/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php b/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php index b109dde..60ad038 100644 --- a/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php +++ b/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php @@ -1,37 +1,37 @@ -scheduled - * a Sigma query, you'll receive a - * sigma.scheduled_query_run.created webhook each time the query runs. - * The webhook contains a ScheduledQueryRun object, which you can use - * to retrieve the query results. - * - * @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 int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. - * @property \Stripe\StripeObject $error - * @property null|\Stripe\File $file The file object representing the results of the query. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $result_available_until Time at which the result expires and is no longer available for download. - * @property string $sql SQL for the query. - * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. - * @property string $title Title of the query. - */ -class ScheduledQueryRun extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'scheduled_query_run'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Retrieve; - - public static function classUrl() - { - return '/v1/sigma/scheduled_query_runs'; - } -} +scheduled + * a Sigma query, you'll receive a + * sigma.scheduled_query_run.created webhook each time the query runs. + * The webhook contains a ScheduledQueryRun object, which you can use + * to retrieve the query results. + * + * @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 int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. + * @property \Stripe\StripeObject $error + * @property null|\Stripe\File $file The file object representing the results of the query. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $result_available_until Time at which the result expires and is no longer available for download. + * @property string $sql SQL for the query. + * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. + * @property string $title Title of the query. + */ +class ScheduledQueryRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'scheduled_query_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + public static function classUrl() + { + return '/v1/sigma/scheduled_query_runs'; + } +} diff --git a/vendor/stripe/stripe-php/lib/SingletonApiResource.php b/vendor/stripe/stripe-php/lib/SingletonApiResource.php index 704cff8..47c0c6f 100644 --- a/vendor/stripe/stripe-php/lib/SingletonApiResource.php +++ b/vendor/stripe/stripe-php/lib/SingletonApiResource.php @@ -1,38 +1,40 @@ -refresh(); - - return $instance; - } - - /** - * @return string the endpoint associated with this singleton class - */ - public static function classUrl() - { - // Replace dots with slashes for namespaced resources, e.g. if the object's name is - // "foo.bar", then its URL will be "/v1/foo/bar". - $base = \str_replace('.', '/', static::OBJECT_NAME); - - return "/v1/{$base}"; - } - - /** - * @return string the endpoint associated with this singleton API resource - */ - public function instanceUrl() - { - return static::classUrl(); - } -} +refresh(); + + return $instance; + } + + /** + * @return string the endpoint associated with this singleton class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bar". + + /** @phpstan-ignore-next-line */ + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}"; + } + + /** + * @return string the endpoint associated with this singleton API resource + */ + public function instanceUrl() + { + return static::classUrl(); + } +} diff --git a/vendor/stripe/stripe-php/lib/Source.php b/vendor/stripe/stripe-php/lib/Source.php index 75e7594..bfd2a8d 100644 --- a/vendor/stripe/stripe-php/lib/Source.php +++ b/vendor/stripe/stripe-php/lib/Source.php @@ -1,168 +1,168 @@ -Source objects allow you to accept a variety of payment methods. - * They represent a customer's payment instrument, and can be used with the Stripe - * API just like a Card object: once chargeable, they can be charged, - * or can be attached to customers. - * - * Related guides: Sources API and Sources & Customers. - * - * @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 \Stripe\StripeObject $ach_credit_transfer - * @property \Stripe\StripeObject $ach_debit - * @property \Stripe\StripeObject $acss_debit - * @property \Stripe\StripeObject $alipay - * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present - * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. - * @property \Stripe\StripeObject $code_verification - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. - * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. - * @property \Stripe\StripeObject $eps - * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $klarna - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $multibanco - * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $receiver - * @property \Stripe\StripeObject $redirect - * @property \Stripe\StripeObject $sepa_credit_transfer - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort - * @property \Stripe\StripeObject $source_order - * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. - * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. - * @property \Stripe\StripeObject $three_d_secure - * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. - * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. - * @property \Stripe\StripeObject $wechat - */ -class Source extends ApiResource -{ - const OBJECT_NAME = 'source'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const FLOW_CODE_VERIFICATION = 'code_verification'; - const FLOW_NONE = 'none'; - const FLOW_RECEIVER = 'receiver'; - const FLOW_REDIRECT = 'redirect'; - - const STATUS_CANCELED = 'canceled'; - const STATUS_CHARGEABLE = 'chargeable'; - const STATUS_CONSUMED = 'consumed'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - - const USAGE_REUSABLE = 'reusable'; - const USAGE_SINGLE_USE = 'single_use'; - - use ApiOperations\NestedResource; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source the detached source - */ - public function detach($params = null, $opts = null) - { - self::_validateParams($params); - - $id = $this['id']; - if (!$id) { - $class = static::class; - $msg = "Could not determine which URL to request: {$class} instance " - . "has invalid ID: {$id}"; - - throw new Exception\UnexpectedValueException($msg, null); - } - - if ($this['customer']) { - $base = Customer::classUrl(); - $parentExtn = \urlencode(Util\Util::utf8($this['customer'])); - $extn = \urlencode(Util\Util::utf8($id)); - $url = "{$base}/{$parentExtn}/sources/{$extn}"; - - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - $message = 'This source object does not appear to be currently attached ' - . 'to a customer object.'; - - throw new Exception\UnexpectedValueException($message); - } - - /** - * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of source transactions - */ - public function sourceTransactions($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/source_transactions'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param string $id - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of source transactions - */ - public static function allSourceTransactions($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, '/source_transactions', $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Source the verified source - */ - public function verify($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/verify'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Source objects allow you to accept a variety of payment methods. + * They represent a customer's payment instrument, and can be used with the Stripe + * API just like a Card object: once chargeable, they can be charged, + * or can be attached to customers. + * + * Related guides: Sources API and Sources & Customers. + * + * @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 \Stripe\StripeObject $ach_credit_transfer + * @property \Stripe\StripeObject $ach_debit + * @property \Stripe\StripeObject $acss_debit + * @property \Stripe\StripeObject $alipay + * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. + * @property \Stripe\StripeObject $code_verification + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. + * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + * @property \Stripe\StripeObject $eps + * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $klarna + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $multibanco + * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $receiver + * @property \Stripe\StripeObject $redirect + * @property \Stripe\StripeObject $sepa_credit_transfer + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property \Stripe\StripeObject $source_order + * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. + * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. + * @property \Stripe\StripeObject $three_d_secure + * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. + * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + * @property \Stripe\StripeObject $wechat + */ +class Source extends ApiResource +{ + const OBJECT_NAME = 'source'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FLOW_CODE_VERIFICATION = 'code_verification'; + const FLOW_NONE = 'none'; + const FLOW_RECEIVER = 'receiver'; + const FLOW_REDIRECT = 'redirect'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_CHARGEABLE = 'chargeable'; + const STATUS_CONSUMED = 'consumed'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + + const USAGE_REUSABLE = 'reusable'; + const USAGE_SINGLE_USE = 'single_use'; + + use ApiOperations\NestedResource; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source the detached source + */ + public function detach($params = null, $opts = null) + { + self::_validateParams($params); + + $id = $this['id']; + if (!$id) { + $class = static::class; + $msg = "Could not determine which URL to request: {$class} instance " + . "has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($msg, null); + } + + if ($this['customer']) { + $base = Customer::classUrl(); + $parentExtn = \urlencode(Util\Util::utf8($this['customer'])); + $extn = \urlencode(Util\Util::utf8($id)); + $url = "{$base}/{$parentExtn}/sources/{$extn}"; + + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + $message = 'This source object does not appear to be currently attached ' + . 'to a customer object.'; + + throw new Exception\UnexpectedValueException($message); + } + + /** + * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public function sourceTransactions($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/source_transactions'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public static function allSourceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, '/source_transactions', $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source the verified source + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/SourceTransaction.php b/vendor/stripe/stripe-php/lib/SourceTransaction.php index 281f2a7..6fb2aa1 100644 --- a/vendor/stripe/stripe-php/lib/SourceTransaction.php +++ b/vendor/stripe/stripe-php/lib/SourceTransaction.php @@ -1,20 +1,20 @@ -coreServiceFactory) { - $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); - } - - return $this->coreServiceFactory->__get($name); - } -} +coreServiceFactory) { + $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); + } + + return $this->coreServiceFactory->__get($name); + } +} diff --git a/vendor/stripe/stripe-php/lib/StripeClientInterface.php b/vendor/stripe/stripe-php/lib/StripeClientInterface.php index adcef3f..eec8c3f 100644 --- a/vendor/stripe/stripe-php/lib/StripeClientInterface.php +++ b/vendor/stripe/stripe-php/lib/StripeClientInterface.php @@ -1,56 +1,21 @@ - "old_value"] - * - * If we update the object with `metadata[new]=new_value`, the server side - * object now has *both* fields: - * - * metadata = ["old" => "old_value", "new" => "new_value"] - * - * This is okay in itself because usually users will want to treat it as - * additive: - * - * $obj->metadata["new"] = "new_value"; - * $obj->save(); - * - * However, in other cases, they may want to replace the entire existing - * contents: - * - * $obj->metadata = ["new" => "new_value"]; - * $obj->save(); - * - * This is where things get a little bit tricky because in order to clear - * any old keys that may have existed, we actually have to send an explicit - * empty string to the server. So the operation above would have to send - * this form to get the intended behavior: - * - * metadata[old]=&metadata[new]=new_value - * - * This method allows us to track which parameters are considered additive, - * and lets us behave correctly where appropriate when serializing - * parameters to be sent. - * - * @return Util\Set Set of additive parameters - */ - public static function getAdditiveParams() - { - static $additiveParams = null; - if (null === $additiveParams) { - // Set `metadata` as additive so that when it's set directly we remember - // to clear keys that may have been previously set by sending empty - // values for them. - // - // It's possible that not every object has `metadata`, but having this - // option set when there is no `metadata` field is not harmful. - $additiveParams = new Util\Set([ - 'metadata', - ]); - } - - return $additiveParams; - } - - public function __construct($id = null, $opts = null) - { - list($id, $this->_retrieveOptions) = Util\Util::normalizeId($id); - $this->_opts = Util\RequestOptions::parse($opts); - $this->_originalValues = []; - $this->_values = []; - $this->_unsavedValues = new Util\Set(); - $this->_transientValues = new Util\Set(); - if (null !== $id) { - $this->_values['id'] = $id; - } - } - - // Standard accessor magic methods - public function __set($k, $v) - { - if (static::getPermanentAttributes()->includes($k)) { - throw new Exception\InvalidArgumentException( - "Cannot set {$k} on this object. HINT: you can't set: " . - \implode(', ', static::getPermanentAttributes()->toArray()) - ); - } - - if ('' === $v) { - throw new Exception\InvalidArgumentException( - 'You cannot set \'' . $k . '\'to an empty string. ' - . 'We interpret empty strings as NULL in requests. ' - . 'You may set obj->' . $k . ' = NULL to delete the property' - ); - } - - $this->_values[$k] = Util\Util::convertToStripeObject($v, $this->_opts); - $this->dirtyValue($this->_values[$k]); - $this->_unsavedValues->add($k); - } - - public function __isset($k) - { - return isset($this->_values[$k]); - } - - public function __unset($k) - { - unset($this->_values[$k]); - $this->_transientValues->add($k); - $this->_unsavedValues->discard($k); - } - - public function &__get($k) - { - // function should return a reference, using $nullval to return a reference to null - $nullval = null; - if (!empty($this->_values) && \array_key_exists($k, $this->_values)) { - return $this->_values[$k]; - } - if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { - $class = static::class; - $attrs = \implode(', ', \array_keys($this->_values)); - $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. " - . "HINT: The {$k} attribute was set in the past, however. " - . 'It was then wiped when refreshing the object ' - . "with the result returned by Stripe's API, " - . 'probably as a result of a save(). The attributes currently ' - . "available on this object are: {$attrs}"; - Stripe::getLogger()->error($message); - - return $nullval; - } - $class = static::class; - Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}"); - - return $nullval; - } - - // Magic method for var_dump output. Only works with PHP >= 5.6 - public function __debugInfo() - { - return $this->_values; - } - - // ArrayAccess methods - public function offsetSet($k, $v) - { - $this->{$k} = $v; - } - - public function offsetExists($k) - { - return \array_key_exists($k, $this->_values); - } - - public function offsetUnset($k) - { - unset($this->{$k}); - } - - public function offsetGet($k) - { - return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; - } - - // Countable method - public function count() - { - return \count($this->_values); - } - - public function keys() - { - return \array_keys($this->_values); - } - - public function values() - { - return \array_values($this->_values); - } - - /** - * This unfortunately needs to be public to be used in Util\Util. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * - * @return static the object constructed from the given values - */ - public static function constructFrom($values, $opts = null) - { - $obj = new static(isset($values['id']) ? $values['id'] : null); - $obj->refreshFrom($values, $opts); - - return $obj; - } - - /** - * Refreshes this object using the provided values. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * @param bool $partial defaults to false - */ - public function refreshFrom($values, $opts, $partial = false) - { - $this->_opts = Util\RequestOptions::parse($opts); - - $this->_originalValues = self::deepCopy($values); - - if ($values instanceof StripeObject) { - $values = $values->toArray(); - } - - // Wipe old state before setting new. This is useful for e.g. updating a - // customer, where there is no persistent card parameter. Mark those values - // which don't persist as transient - if ($partial) { - $removed = new Util\Set(); - } else { - $removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values))); - } - - foreach ($removed->toArray() as $k) { - unset($this->{$k}); - } - - $this->updateAttributes($values, $opts, false); - foreach ($values as $k => $v) { - $this->_transientValues->discard($k); - $this->_unsavedValues->discard($k); - } - } - - /** - * Mass assigns attributes on the model. - * - * @param array $values - * @param null|array|string|Util\RequestOptions $opts - * @param bool $dirty defaults to true - */ - public function updateAttributes($values, $opts = null, $dirty = true) - { - foreach ($values as $k => $v) { - // Special-case metadata to always be cast as a StripeObject - // This is necessary in case metadata is empty, as PHP arrays do - // not differentiate between lists and hashes, and we consider - // empty arrays to be lists. - if (('metadata' === $k) && (\is_array($v))) { - $this->_values[$k] = StripeObject::constructFrom($v, $opts); - } else { - $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts); - } - if ($dirty) { - $this->dirtyValue($this->_values[$k]); - } - $this->_unsavedValues->add($k); - } - } - - /** - * @param bool $force defaults to false - * - * @return array a recursive mapping of attributes to values for this object, - * including the proper value for deleted attributes - */ - public function serializeParameters($force = false) - { - $updateParams = []; - - foreach ($this->_values as $k => $v) { - // There are a few reasons that we may want to add in a parameter for - // update: - // - // 1. The `$force` option has been set. - // 2. We know that it was modified. - // 3. Its value is a StripeObject. A StripeObject may contain modified - // values within in that its parent StripeObject doesn't know about. - // - $original = \array_key_exists($k, $this->_originalValues) ? $this->_originalValues[$k] : null; - $unsaved = $this->_unsavedValues->includes($k); - if ($force || $unsaved || $v instanceof StripeObject) { - $updateParams[$k] = $this->serializeParamsValue( - $this->_values[$k], - $original, - $unsaved, - $force, - $k - ); - } - } - - // a `null` that makes it out of `serializeParamsValue` signals an empty - // value that we shouldn't appear in the serialized form of the object - return \array_filter( - $updateParams, - function ($v) { - return null !== $v; - } - ); - } - - public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) - { - // The logic here is that essentially any object embedded in another - // object that had a `type` is actually an API resource of a different - // type that's been included in the response. These other resources must - // be updated from their proper endpoints, and therefore they are not - // included when serializing even if they've been modified. - // - // There are _some_ known exceptions though. - // - // For example, if the value is unsaved (meaning the user has set it), and - // it looks like the API resource is persisted with an ID, then we include - // the object so that parameters are serialized with a reference to its - // ID. - // - // Another example is that on save API calls it's sometimes desirable to - // update a customer's default source by setting a new card (or other) - // object with `->source=` and then saving the customer. The - // `saveWithParent` flag to override the default behavior allows us to - // handle these exceptions. - // - // We throw an error if a property was set explicitly but we can't do - // anything with it because the integration is probably not working as the - // user intended it to. - if (null === $value) { - return ''; - } - if (($value instanceof ApiResource) && (!$value->saveWithParent)) { - if (!$unsaved) { - return null; - } - if (isset($value->id)) { - return $value; - } - - throw new Exception\InvalidArgumentException( - "Cannot save property `{$key}` containing an API resource of type " . - \get_class($value) . ". It doesn't appear to be persisted and is " . - 'not marked as `saveWithParent`.' - ); - } - if (\is_array($value)) { - if (Util\Util::isList($value)) { - // Sequential array, i.e. a list - $update = []; - foreach ($value as $v) { - $update[] = $this->serializeParamsValue($v, null, true, $force); - } - // This prevents an array that's unchanged from being resent. - if ($update !== $this->serializeParamsValue($original, null, true, $force, $key)) { - return $update; - } - } else { - // Associative array, i.e. a map - return Util\Util::convertToStripeObject($value, $this->_opts)->serializeParameters(); - } - } elseif ($value instanceof StripeObject) { - $update = $value->serializeParameters($force); - if ($original && $unsaved && $key && static::getAdditiveParams()->includes($key)) { - $update = \array_merge(self::emptyValues($original), $update); - } - - return $update; - } else { - return $value; - } - } - - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Returns an associative array with the key and values composing the - * Stripe object. - * - * @return array the associative array - */ - public function toArray() - { - $maybeToArray = function ($value) { - if (null === $value) { - return null; - } - - return \is_object($value) && \method_exists($value, 'toArray') ? $value->toArray() : $value; - }; - - return \array_reduce(\array_keys($this->_values), function ($acc, $k) use ($maybeToArray) { - if ('_' === \substr((string) $k, 0, 1)) { - return $acc; - } - $v = $this->_values[$k]; - if (Util\Util::isList($v)) { - $acc[$k] = \array_map($maybeToArray, $v); - } else { - $acc[$k] = $maybeToArray($v); - } - - return $acc; - }, []); - } - - /** - * Returns a pretty JSON representation of the Stripe object. - * - * @return string the JSON representation of the Stripe object - */ - public function toJSON() - { - return \json_encode($this->toArray(), \JSON_PRETTY_PRINT); - } - - public function __toString() - { - $class = static::class; - - return $class . ' JSON: ' . $this->toJSON(); - } - - /** - * Sets all keys within the StripeObject as unsaved so that they will be - * included with an update when `serializeParameters` is called. This - * method is also recursive, so any StripeObjects contained as values or - * which are values in a tenant array are also marked as dirty. - */ - public function dirty() - { - $this->_unsavedValues = new Util\Set(\array_keys($this->_values)); - foreach ($this->_values as $k => $v) { - $this->dirtyValue($v); - } - } - - protected function dirtyValue($value) - { - if (\is_array($value)) { - foreach ($value as $v) { - $this->dirtyValue($v); - } - } elseif ($value instanceof StripeObject) { - $value->dirty(); - } - } - - /** - * Produces a deep copy of the given object including support for arrays - * and StripeObjects. - * - * @param mixed $obj - */ - protected static function deepCopy($obj) - { - if (\is_array($obj)) { - $copy = []; - foreach ($obj as $k => $v) { - $copy[$k] = self::deepCopy($v); - } - - return $copy; - } - if ($obj instanceof StripeObject) { - return $obj::constructFrom( - self::deepCopy($obj->_values), - clone $obj->_opts - ); - } - - return $obj; - } - - /** - * Returns a hash of empty values for all the values that are in the given - * StripeObject. - * - * @param mixed $obj - */ - public static function emptyValues($obj) - { - if (\is_array($obj)) { - $values = $obj; - } elseif ($obj instanceof StripeObject) { - $values = $obj->_values; - } else { - throw new Exception\InvalidArgumentException( - 'empty_values got unexpected object type: ' . \get_class($obj) - ); - } - - return \array_fill_keys(\array_keys($values), ''); - } - - /** - * @return null|ApiResponse The last response from the Stripe API - */ - public function getLastResponse() - { - return $this->_lastResponse; - } - - /** - * Sets the last response from the Stripe API. - * - * @param ApiResponse $resp - */ - public function setLastResponse($resp) - { - $this->_lastResponse = $resp; - } - - /** - * Indicates whether or not the resource has been deleted on the server. - * Note that some, but not all, resources can indicate whether they have - * been deleted. - * - * @return bool whether the resource is deleted - */ - public function isDeleted() - { - return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; - } -} + "old_value"] + * + * If we update the object with `metadata[new]=new_value`, the server side + * object now has *both* fields: + * + * metadata = ["old" => "old_value", "new" => "new_value"] + * + * This is okay in itself because usually users will want to treat it as + * additive: + * + * $obj->metadata["new"] = "new_value"; + * $obj->save(); + * + * However, in other cases, they may want to replace the entire existing + * contents: + * + * $obj->metadata = ["new" => "new_value"]; + * $obj->save(); + * + * This is where things get a little bit tricky because in order to clear + * any old keys that may have existed, we actually have to send an explicit + * empty string to the server. So the operation above would have to send + * this form to get the intended behavior: + * + * metadata[old]=&metadata[new]=new_value + * + * This method allows us to track which parameters are considered additive, + * and lets us behave correctly where appropriate when serializing + * parameters to be sent. + * + * @return Util\Set Set of additive parameters + */ + public static function getAdditiveParams() + { + static $additiveParams = null; + if (null === $additiveParams) { + // Set `metadata` as additive so that when it's set directly we remember + // to clear keys that may have been previously set by sending empty + // values for them. + // + // It's possible that not every object has `metadata`, but having this + // option set when there is no `metadata` field is not harmful. + $additiveParams = new Util\Set([ + 'metadata', + ]); + } + + return $additiveParams; + } + + public function __construct($id = null, $opts = null) + { + list($id, $this->_retrieveOptions) = Util\Util::normalizeId($id); + $this->_opts = Util\RequestOptions::parse($opts); + $this->_originalValues = []; + $this->_values = []; + $this->_unsavedValues = new Util\Set(); + $this->_transientValues = new Util\Set(); + if (null !== $id) { + $this->_values['id'] = $id; + } + } + + // Standard accessor magic methods + public function __set($k, $v) + { + if (static::getPermanentAttributes()->includes($k)) { + throw new Exception\InvalidArgumentException( + "Cannot set {$k} on this object. HINT: you can't set: " . + \implode(', ', static::getPermanentAttributes()->toArray()) + ); + } + + if ('' === $v) { + throw new Exception\InvalidArgumentException( + 'You cannot set \'' . $k . '\'to an empty string. ' + . 'We interpret empty strings as NULL in requests. ' + . 'You may set obj->' . $k . ' = NULL to delete the property' + ); + } + + $this->_values[$k] = Util\Util::convertToStripeObject($v, $this->_opts); + $this->dirtyValue($this->_values[$k]); + $this->_unsavedValues->add($k); + } + + public function __isset($k) + { + return isset($this->_values[$k]); + } + + public function __unset($k) + { + unset($this->_values[$k]); + $this->_transientValues->add($k); + $this->_unsavedValues->discard($k); + } + + public function &__get($k) + { + // function should return a reference, using $nullval to return a reference to null + $nullval = null; + if (!empty($this->_values) && \array_key_exists($k, $this->_values)) { + return $this->_values[$k]; + } + if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { + $class = static::class; + $attrs = \implode(', ', \array_keys($this->_values)); + $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. " + . "HINT: The {$k} attribute was set in the past, however. " + . 'It was then wiped when refreshing the object ' + . "with the result returned by Stripe's API, " + . 'probably as a result of a save(). The attributes currently ' + . "available on this object are: {$attrs}"; + Stripe::getLogger()->error($message); + + return $nullval; + } + $class = static::class; + Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}"); + + return $nullval; + } + + // Magic method for var_dump output. Only works with PHP >= 5.6 + public function __debugInfo() + { + return $this->_values; + } + + // ArrayAccess methods + #[\ReturnTypeWillChange] + public function offsetSet($k, $v) + { + $this->{$k} = $v; + } + + #[\ReturnTypeWillChange] + public function offsetExists($k) + { + return \array_key_exists($k, $this->_values); + } + + #[\ReturnTypeWillChange] + public function offsetUnset($k) + { + unset($this->{$k}); + } + + #[\ReturnTypeWillChange] + public function offsetGet($k) + { + return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; + } + + /** + * @return int + */ + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->_values); + } + + public function keys() + { + return \array_keys($this->_values); + } + + public function values() + { + return \array_values($this->_values); + } + + /** + * This unfortunately needs to be public to be used in Util\Util. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * + * @return static the object constructed from the given values + */ + public static function constructFrom($values, $opts = null) + { + $obj = new static(isset($values['id']) ? $values['id'] : null); + $obj->refreshFrom($values, $opts); + + return $obj; + } + + /** + * Refreshes this object using the provided values. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $partial defaults to false + */ + public function refreshFrom($values, $opts, $partial = false) + { + $this->_opts = Util\RequestOptions::parse($opts); + + $this->_originalValues = self::deepCopy($values); + + if ($values instanceof StripeObject) { + $values = $values->toArray(); + } + + // Wipe old state before setting new. This is useful for e.g. updating a + // customer, where there is no persistent card parameter. Mark those values + // which don't persist as transient + if ($partial) { + $removed = new Util\Set(); + } else { + $removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values))); + } + + foreach ($removed->toArray() as $k) { + unset($this->{$k}); + } + + $this->updateAttributes($values, $opts, false); + foreach ($values as $k => $v) { + $this->_transientValues->discard($k); + $this->_unsavedValues->discard($k); + } + } + + /** + * Mass assigns attributes on the model. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $dirty defaults to true + */ + public function updateAttributes($values, $opts = null, $dirty = true) + { + foreach ($values as $k => $v) { + // Special-case metadata to always be cast as a StripeObject + // This is necessary in case metadata is empty, as PHP arrays do + // not differentiate between lists and hashes, and we consider + // empty arrays to be lists. + if (('metadata' === $k) && (\is_array($v))) { + $this->_values[$k] = StripeObject::constructFrom($v, $opts); + } else { + $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts); + } + if ($dirty) { + $this->dirtyValue($this->_values[$k]); + } + $this->_unsavedValues->add($k); + } + } + + /** + * @param bool $force defaults to false + * + * @return array a recursive mapping of attributes to values for this object, + * including the proper value for deleted attributes + */ + public function serializeParameters($force = false) + { + $updateParams = []; + + foreach ($this->_values as $k => $v) { + // There are a few reasons that we may want to add in a parameter for + // update: + // + // 1. The `$force` option has been set. + // 2. We know that it was modified. + // 3. Its value is a StripeObject. A StripeObject may contain modified + // values within in that its parent StripeObject doesn't know about. + // + $original = \array_key_exists($k, $this->_originalValues) ? $this->_originalValues[$k] : null; + $unsaved = $this->_unsavedValues->includes($k); + if ($force || $unsaved || $v instanceof StripeObject) { + $updateParams[$k] = $this->serializeParamsValue( + $this->_values[$k], + $original, + $unsaved, + $force, + $k + ); + } + } + + // a `null` that makes it out of `serializeParamsValue` signals an empty + // value that we shouldn't appear in the serialized form of the object + return \array_filter( + $updateParams, + function ($v) { + return null !== $v; + } + ); + } + + public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) + { + // The logic here is that essentially any object embedded in another + // object that had a `type` is actually an API resource of a different + // type that's been included in the response. These other resources must + // be updated from their proper endpoints, and therefore they are not + // included when serializing even if they've been modified. + // + // There are _some_ known exceptions though. + // + // For example, if the value is unsaved (meaning the user has set it), and + // it looks like the API resource is persisted with an ID, then we include + // the object so that parameters are serialized with a reference to its + // ID. + // + // Another example is that on save API calls it's sometimes desirable to + // update a customer's default source by setting a new card (or other) + // object with `->source=` and then saving the customer. The + // `saveWithParent` flag to override the default behavior allows us to + // handle these exceptions. + // + // We throw an error if a property was set explicitly but we can't do + // anything with it because the integration is probably not working as the + // user intended it to. + if (null === $value) { + return ''; + } + if (($value instanceof ApiResource) && (!$value->saveWithParent)) { + if (!$unsaved) { + return null; + } + if (isset($value->id)) { + return $value; + } + + throw new Exception\InvalidArgumentException( + "Cannot save property `{$key}` containing an API resource of type " . + \get_class($value) . ". It doesn't appear to be persisted and is " . + 'not marked as `saveWithParent`.' + ); + } + if (\is_array($value)) { + if (Util\Util::isList($value)) { + // Sequential array, i.e. a list + $update = []; + foreach ($value as $v) { + $update[] = $this->serializeParamsValue($v, null, true, $force); + } + // This prevents an array that's unchanged from being resent. + if ($update !== $this->serializeParamsValue($original, null, true, $force, $key)) { + return $update; + } + } else { + // Associative array, i.e. a map + return Util\Util::convertToStripeObject($value, $this->_opts)->serializeParameters(); + } + } elseif ($value instanceof StripeObject) { + $update = $value->serializeParameters($force); + if ($original && $unsaved && $key && static::getAdditiveParams()->includes($key)) { + $update = \array_merge(self::emptyValues($original), $update); + } + + return $update; + } else { + return $value; + } + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toArray(); + } + + /** + * Returns an associative array with the key and values composing the + * Stripe object. + * + * @return array the associative array + */ + public function toArray() + { + $maybeToArray = function ($value) { + if (null === $value) { + return null; + } + + return \is_object($value) && \method_exists($value, 'toArray') ? $value->toArray() : $value; + }; + + return \array_reduce(\array_keys($this->_values), function ($acc, $k) use ($maybeToArray) { + if ('_' === \substr((string) $k, 0, 1)) { + return $acc; + } + $v = $this->_values[$k]; + if (Util\Util::isList($v)) { + $acc[$k] = \array_map($maybeToArray, $v); + } else { + $acc[$k] = $maybeToArray($v); + } + + return $acc; + }, []); + } + + /** + * Returns a pretty JSON representation of the Stripe object. + * + * @return string the JSON representation of the Stripe object + */ + public function toJSON() + { + return \json_encode($this->toArray(), \JSON_PRETTY_PRINT); + } + + public function __toString() + { + $class = static::class; + + return $class . ' JSON: ' . $this->toJSON(); + } + + /** + * Sets all keys within the StripeObject as unsaved so that they will be + * included with an update when `serializeParameters` is called. This + * method is also recursive, so any StripeObjects contained as values or + * which are values in a tenant array are also marked as dirty. + */ + public function dirty() + { + $this->_unsavedValues = new Util\Set(\array_keys($this->_values)); + foreach ($this->_values as $k => $v) { + $this->dirtyValue($v); + } + } + + protected function dirtyValue($value) + { + if (\is_array($value)) { + foreach ($value as $v) { + $this->dirtyValue($v); + } + } elseif ($value instanceof StripeObject) { + $value->dirty(); + } + } + + /** + * Produces a deep copy of the given object including support for arrays + * and StripeObjects. + * + * @param mixed $obj + */ + protected static function deepCopy($obj) + { + if (\is_array($obj)) { + $copy = []; + foreach ($obj as $k => $v) { + $copy[$k] = self::deepCopy($v); + } + + return $copy; + } + if ($obj instanceof StripeObject) { + return $obj::constructFrom( + self::deepCopy($obj->_values), + clone $obj->_opts + ); + } + + return $obj; + } + + /** + * Returns a hash of empty values for all the values that are in the given + * StripeObject. + * + * @param mixed $obj + */ + public static function emptyValues($obj) + { + if (\is_array($obj)) { + $values = $obj; + } elseif ($obj instanceof StripeObject) { + $values = $obj->_values; + } else { + throw new Exception\InvalidArgumentException( + 'empty_values got unexpected object type: ' . \get_class($obj) + ); + } + + return \array_fill_keys(\array_keys($values), ''); + } + + /** + * @return null|ApiResponse The last response from the Stripe API + */ + public function getLastResponse() + { + return $this->_lastResponse; + } + + /** + * Sets the last response from the Stripe API. + * + * @param ApiResponse $resp + */ + public function setLastResponse($resp) + { + $this->_lastResponse = $resp; + } + + /** + * Indicates whether or not the resource has been deleted on the server. + * Note that some, but not all, resources can indicate whether they have + * been deleted. + * + * @return bool whether the resource is deleted + */ + public function isDeleted() + { + return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; + } +} diff --git a/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php b/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php new file mode 100644 index 0000000..8eff07b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/StripeStreamingClientInterface.php @@ -0,0 +1,11 @@ +Creating - * Subscriptions. - * - * @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 null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. - * @property \Stripe\StripeObject $automatic_tax - * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. - * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period - * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled - * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. - * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. - * @property int $current_period_start Start of the current period that the subscription has been invoiced for. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. - * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. - * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. - * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. - * @property null|int $ended_at If the subscription has ended, the date the subscription ended. - * @property \Stripe\Collection $items List of subscription items, each with an attached price. - * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. - * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. - * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. - * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. - * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. - * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription - * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. - * @property string $status

Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.

For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

- * @property null|int $trial_end If the subscription has a trial, the end of that trial. - * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. - */ -class Subscription extends ApiResource -{ - const OBJECT_NAME = 'subscription'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; - const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; - const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; - - const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice'; - const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations'; - const PRORATION_BEHAVIOR_NONE = 'none'; - - const STATUS_ACTIVE = 'active'; - const STATUS_CANCELED = 'canceled'; - const STATUS_INCOMPLETE = 'incomplete'; - const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; - const STATUS_PAST_DUE = 'past_due'; - const STATUS_TRIALING = 'trialing'; - const STATUS_UNPAID = 'unpaid'; - - use ApiOperations\Delete { - delete as protected _delete; - } - - public static function getSavedNestedResources() - { - static $savedNestedResources = null; - if (null === $savedNestedResources) { - $savedNestedResources = new Util\Set([ - 'source', - ]); - } - - return $savedNestedResources; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription the deleted subscription - */ - public function cancel($params = null, $opts = null) - { - return $this->_delete($params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Subscription the updated subscription - */ - public function deleteDiscount($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/discount'; - list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom(['discount' => null], $opts, true); - } -} +Creating + * Subscriptions. + * + * @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 null|string|\Stripe\StripeObject $application ID of the Connect Application that created the subscription. + * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + * @property \Stripe\StripeObject $automatic_tax + * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. + * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled + * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. + * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + * @property int $current_period_start Start of the current period that the subscription has been invoiced for. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. + * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + * @property null|int $ended_at If the subscription has ended, the date the subscription ended. + * @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price. + * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. + * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. + * @property null|\Stripe\StripeObject $payment_settings Payment settings passed on to invoices created by the subscription. + * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. + * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. + * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. + * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription + * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. + * @property string $status

Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.

For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

+ * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to. + * @property null|int $trial_end If the subscription has a trial, the end of that trial. + * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. + */ +class Subscription extends ApiResource +{ + const OBJECT_NAME = 'subscription'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Search; + use ApiOperations\Update; + + const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; + const PAYMENT_BEHAVIOR_DEFAULT_INCOMPLETE = 'default_incomplete'; + const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; + const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; + + const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice'; + const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations'; + const PRORATION_BEHAVIOR_NONE = 'none'; + + const STATUS_ACTIVE = 'active'; + const STATUS_CANCELED = 'canceled'; + const STATUS_INCOMPLETE = 'incomplete'; + const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; + const STATUS_PAST_DUE = 'past_due'; + const STATUS_TRIALING = 'trialing'; + const STATUS_UNPAID = 'unpaid'; + + use ApiOperations\Delete { + delete as protected _delete; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the deleted subscription + */ + public function cancel($params = null, $opts = null) + { + return $this->_delete($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the updated subscription + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->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 + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the subscription search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/subscriptions/search'; + + return self::_searchResource($url, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SubscriptionItem.php b/vendor/stripe/stripe-php/lib/SubscriptionItem.php index 5bd25b2..16aff84 100644 --- a/vendor/stripe/stripe-php/lib/SubscriptionItem.php +++ b/vendor/stripe/stripe-php/lib/SubscriptionItem.php @@ -1,84 +1,84 @@ -key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Plan $plan

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

Related guides: Set up a subscription and more about products and prices.

- * @property \Stripe\Price $price

Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

Related guides: Set up a subscription, create an invoice, and more about products and prices.

- * @property int $quantity The quantity of the plan to which the customer should be subscribed. - * @property string $subscription The subscription this subscription_item belongs to. - * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. - */ -class SubscriptionItem extends ApiResource -{ - const OBJECT_NAME = 'subscription_item'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const PATH_USAGE_RECORDS = '/usage_records'; - - /** - * @param null|string $id the ID of the subscription item on which to create the usage record - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\UsageRecord - */ - public static function createUsageRecord($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); - } - - /** - * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of usage record summaries - */ - public function usageRecordSummaries($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/usage_record_summaries'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; - - /** - * @param string $id the ID of the subscription item on which to retrieve the usage record summaries - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of usage record summaries - */ - public static function allUsageRecordSummaries($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); - } -} +key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Plan $plan

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

Related guides: Set up a subscription and more about products and prices.

+ * @property \Stripe\Price $price

Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

Related guides: Set up a subscription, create an invoice, and more about products and prices.

+ * @property int $quantity The quantity of the plan to which the customer should be subscribed. + * @property string $subscription The subscription this subscription_item belongs to. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. + */ +class SubscriptionItem extends ApiResource +{ + const OBJECT_NAME = 'subscription_item'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const PATH_USAGE_RECORDS = '/usage_records'; + + /** + * @param null|string $id the ID of the subscription item on which to create the usage record + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public static function createUsageRecord($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); + } + + /** + * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of usage record summaries + */ + public function usageRecordSummaries($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/usage_record_summaries'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; + + /** + * @param string $id the ID of the subscription item on which to retrieve the usage record summaries + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\UsageRecordSummary> the list of usage record summaries + */ + public static function allUsageRecordSummaries($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php index d10ea12..ef91cd3 100644 --- a/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php +++ b/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php @@ -1,74 +1,76 @@ -Subscription - * Schedules. - * - * @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 null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. - * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. - * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. - * @property \Stripe\StripeObject $default_settings - * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. - * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. - * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). - * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. - * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. - */ -class SubscriptionSchedule extends ApiResource -{ - const OBJECT_NAME = 'subscription_schedule'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule the canceled subscription schedule - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\SubscriptionSchedule the released subscription schedule - */ - public function release($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/release'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Subscription + * Schedules. + * + * @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 null|string|\Stripe\StripeObject $application ID of the Connect Application that created the schedule. + * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. + * @property \Stripe\StripeObject $default_settings + * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. + * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). + * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. + * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. + */ +class SubscriptionSchedule extends ApiResource +{ + const OBJECT_NAME = 'subscription_schedule'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule the canceled subscription schedule + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule the released subscription schedule + */ + public function release($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/release'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/TaxCode.php b/vendor/stripe/stripe-php/lib/TaxCode.php index bfdbf03..9d0d9e8 100644 --- a/vendor/stripe/stripe-php/lib/TaxCode.php +++ b/vendor/stripe/stripe-php/lib/TaxCode.php @@ -1,22 +1,22 @@ -Tax codes classify goods and - * services for tax purposes. - * - * @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 string $description A detailed description of which types of products the tax code represents. - * @property string $name A short name for the tax code. - */ -class TaxCode extends ApiResource -{ - const OBJECT_NAME = 'tax_code'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} +Tax codes classify + * goods and services for tax purposes. + * + * @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 string $description A detailed description of which types of products the tax code represents. + * @property string $name A short name for the tax code. + */ +class TaxCode extends ApiResource +{ + const OBJECT_NAME = 'tax_code'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/vendor/stripe/stripe-php/lib/TaxId.php b/vendor/stripe/stripe-php/lib/TaxId.php index 2a78577..0d5bdf9 100644 --- a/vendor/stripe/stripe-php/lib/TaxId.php +++ b/vendor/stripe/stripe-php/lib/TaxId.php @@ -1,112 +1,120 @@ -customer. A customer's tax IDs - * are displayed on invoices and credit notes issued for the customer. - * - * Related guide: Customer - * Tax Identification Numbers. - * - * @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 null|string $country Two-letter ISO code representing the country of the tax ID. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Customer $customer ID of the customer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $type Type of the tax ID, one of ae_trn, au_abn, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, gb_vat, hk_br, id_npwp, il_vat, in_gst, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, th_vat, tw_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown - * @property string $value Value of the tax ID. - * @property null|\Stripe\StripeObject $verification Tax ID verification information. - */ -class TaxId extends ApiResource -{ - const OBJECT_NAME = 'tax_id'; - - use ApiOperations\Delete; - - const TYPE_AE_TRN = 'ae_trn'; - const TYPE_AU_ABN = 'au_abn'; - const TYPE_BR_CNPJ = 'br_cnpj'; - const TYPE_BR_CPF = 'br_cpf'; - const TYPE_CA_BN = 'ca_bn'; - const TYPE_CA_GST_HST = 'ca_gst_hst'; - const TYPE_CA_PST_BC = 'ca_pst_bc'; - const TYPE_CA_PST_MB = 'ca_pst_mb'; - const TYPE_CA_PST_SK = 'ca_pst_sk'; - const TYPE_CA_QST = 'ca_qst'; - const TYPE_CH_VAT = 'ch_vat'; - const TYPE_CL_TIN = 'cl_tin'; - const TYPE_ES_CIF = 'es_cif'; - const TYPE_EU_VAT = 'eu_vat'; - const TYPE_GB_VAT = 'gb_vat'; - const TYPE_HK_BR = 'hk_br'; - const TYPE_ID_NPWP = 'id_npwp'; - const TYPE_IL_VAT = 'il_vat'; - const TYPE_IN_GST = 'in_gst'; - const TYPE_JP_CN = 'jp_cn'; - const TYPE_JP_RN = 'jp_rn'; - const TYPE_KR_BRN = 'kr_brn'; - const TYPE_LI_UID = 'li_uid'; - const TYPE_MX_RFC = 'mx_rfc'; - const TYPE_MY_FRP = 'my_frp'; - const TYPE_MY_ITN = 'my_itn'; - const TYPE_MY_SST = 'my_sst'; - const TYPE_NO_VAT = 'no_vat'; - const TYPE_NZ_GST = 'nz_gst'; - const TYPE_RU_INN = 'ru_inn'; - const TYPE_RU_KPP = 'ru_kpp'; - const TYPE_SA_VAT = 'sa_vat'; - const TYPE_SG_GST = 'sg_gst'; - const TYPE_SG_UEN = 'sg_uen'; - const TYPE_TH_VAT = 'th_vat'; - const TYPE_TW_VAT = 'tw_vat'; - const TYPE_UNKNOWN = 'unknown'; - const TYPE_US_EIN = 'us_ein'; - const TYPE_ZA_VAT = 'za_vat'; - - const VERIFICATION_STATUS_PENDING = 'pending'; - const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; - const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; - const VERIFICATION_STATUS_VERIFIED = 'verified'; - - /** - * @return string the API URL for this tax id - */ - public function instanceUrl() - { - $id = $this['id']; - $customer = $this['customer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - "Could not determine which URL to request: class instance has invalid ID: {$id}" - ); - } - $id = Util\Util::utf8($id); - $customer = Util\Util::utf8($customer); - - $base = Customer::classUrl(); - $customerExtn = \urlencode($customer); - $extn = \urlencode($id); - - return "{$base}/{$customerExtn}/tax_ids/{$extn}"; - } - - /** - * @param array|string $_id - * @param null|array|string $_opts - * - * @throws \Stripe\Exception\BadMethodCallException - */ - public static function retrieve($_id, $_opts = null) - { - $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . - "a tax ID using `Customer::retrieveTaxId('customer_id', " . - "'tax_id_id')`."; - - throw new Exception\BadMethodCallException($msg); - } -} +customer. A customer's tax IDs + * are displayed on invoices and credit notes issued for the customer. + * + * Related guide: Customer + * Tax Identification Numbers. + * + * @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 null|string $country Two-letter ISO code representing the country of the tax ID. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer ID of the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the tax ID, one of ae_trn, au_abn, au_arn, bg_uic, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, th_vat, tw_vat, ua_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $value Value of the tax ID. + * @property null|\Stripe\StripeObject $verification Tax ID verification information. + */ +class TaxId extends ApiResource +{ + const OBJECT_NAME = 'tax_id'; + + use ApiOperations\Delete; + + const TYPE_AE_TRN = 'ae_trn'; + const TYPE_AU_ABN = 'au_abn'; + const TYPE_AU_ARN = 'au_arn'; + const TYPE_BG_UIC = 'bg_uic'; + const TYPE_BR_CNPJ = 'br_cnpj'; + const TYPE_BR_CPF = 'br_cpf'; + const TYPE_CA_BN = 'ca_bn'; + const TYPE_CA_GST_HST = 'ca_gst_hst'; + const TYPE_CA_PST_BC = 'ca_pst_bc'; + const TYPE_CA_PST_MB = 'ca_pst_mb'; + const TYPE_CA_PST_SK = 'ca_pst_sk'; + const TYPE_CA_QST = 'ca_qst'; + const TYPE_CH_VAT = 'ch_vat'; + const TYPE_CL_TIN = 'cl_tin'; + const TYPE_ES_CIF = 'es_cif'; + const TYPE_EU_OSS_VAT = 'eu_oss_vat'; + const TYPE_EU_VAT = 'eu_vat'; + const TYPE_GB_VAT = 'gb_vat'; + const TYPE_GE_VAT = 'ge_vat'; + const TYPE_HK_BR = 'hk_br'; + const TYPE_HU_TIN = 'hu_tin'; + const TYPE_ID_NPWP = 'id_npwp'; + const TYPE_IL_VAT = 'il_vat'; + const TYPE_IN_GST = 'in_gst'; + const TYPE_IS_VAT = 'is_vat'; + const TYPE_JP_CN = 'jp_cn'; + const TYPE_JP_RN = 'jp_rn'; + const TYPE_KR_BRN = 'kr_brn'; + const TYPE_LI_UID = 'li_uid'; + const TYPE_MX_RFC = 'mx_rfc'; + const TYPE_MY_FRP = 'my_frp'; + const TYPE_MY_ITN = 'my_itn'; + const TYPE_MY_SST = 'my_sst'; + const TYPE_NO_VAT = 'no_vat'; + const TYPE_NZ_GST = 'nz_gst'; + const TYPE_RU_INN = 'ru_inn'; + const TYPE_RU_KPP = 'ru_kpp'; + const TYPE_SA_VAT = 'sa_vat'; + const TYPE_SG_GST = 'sg_gst'; + const TYPE_SG_UEN = 'sg_uen'; + const TYPE_SI_TIN = 'si_tin'; + const TYPE_TH_VAT = 'th_vat'; + const TYPE_TW_VAT = 'tw_vat'; + const TYPE_UA_VAT = 'ua_vat'; + const TYPE_UNKNOWN = 'unknown'; + const TYPE_US_EIN = 'us_ein'; + const TYPE_ZA_VAT = 'za_vat'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this tax id + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}" + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/tax_ids/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . + "a tax ID using `Customer::retrieveTaxId('customer_id', " . + "'tax_id_id')`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/vendor/stripe/stripe-php/lib/TaxRate.php b/vendor/stripe/stripe-php/lib/TaxRate.php index 9033638..4af7976 100644 --- a/vendor/stripe/stripe-php/lib/TaxRate.php +++ b/vendor/stripe/stripe-php/lib/TaxRate.php @@ -1,48 +1,50 @@ -invoices, subscriptions and - * Checkout - * Sessions to collect tax. - * - * Related guide: Tax - * Rates. - * - * @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 Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. - * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. - * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. - * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property float $percentage This represents the tax rate percent out of 100. - * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. - * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. - */ -class TaxRate extends ApiResource -{ - const OBJECT_NAME = 'tax_rate'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const TAX_TYPE_GST = 'gst'; - const TAX_TYPE_HST = 'hst'; - const TAX_TYPE_PST = 'pst'; - const TAX_TYPE_QST = 'qst'; - const TAX_TYPE_SALES_TAX = 'sales_tax'; - const TAX_TYPE_VAT = 'vat'; -} +invoices, subscriptions and + * Checkout + * Sessions to collect tax. + * + * Related guide: Tax + * Rates. + * + * @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 Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. + * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property float $percentage This represents the tax rate percent out of 100. + * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. + * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. + */ +class TaxRate extends ApiResource +{ + const OBJECT_NAME = 'tax_rate'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_TYPE_GST = 'gst'; + const TAX_TYPE_HST = 'hst'; + const TAX_TYPE_JCT = 'jct'; + const TAX_TYPE_PST = 'pst'; + const TAX_TYPE_QST = 'qst'; + const TAX_TYPE_RST = 'rst'; + const TAX_TYPE_SALES_TAX = 'sales_tax'; + const TAX_TYPE_VAT = 'vat'; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/Configuration.php b/vendor/stripe/stripe-php/lib/Terminal/Configuration.php new file mode 100644 index 0000000..16fcc42 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Terminal/Configuration.php @@ -0,0 +1,28 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $tipping + * @property \Stripe\StripeObject $verifone_p400 + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php b/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php index c6405b0..64cda24 100644 --- a/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php +++ b/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php @@ -1,22 +1,22 @@ -Fleet Management. - * - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see the docs on scoping connection tokens. - * @property string $secret Your application should pass this token to the Stripe Terminal SDK. - */ -class ConnectionToken extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.connection_token'; - - use \Stripe\ApiOperations\Create; -} +Fleet + * Management. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see the docs on scoping connection tokens. + * @property string $secret Your application should pass this token to the Stripe Terminal SDK. + */ +class ConnectionToken extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.connection_token'; + + use \Stripe\ApiOperations\Create; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/Location.php b/vendor/stripe/stripe-php/lib/Terminal/Location.php index 422cd75..d1124ef 100644 --- a/vendor/stripe/stripe-php/lib/Terminal/Location.php +++ b/vendor/stripe/stripe-php/lib/Terminal/Location.php @@ -1,29 +1,30 @@ -Fleet Management. - * - * @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 \Stripe\StripeObject $address - * @property string $display_name The display name of the location. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ -class Location extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.location'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +Fleet + * Management. + * + * @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 \Stripe\StripeObject $address + * @property string $configuration_overrides The ID of a configuration that will be used to customize all readers in this location. + * @property string $display_name The display name of the location. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class Location extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.location'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/Terminal/Reader.php b/vendor/stripe/stripe-php/lib/Terminal/Reader.php index 44fe035..674a5f2 100644 --- a/vendor/stripe/stripe-php/lib/Terminal/Reader.php +++ b/vendor/stripe/stripe-php/lib/Terminal/Reader.php @@ -1,35 +1,104 @@ -Connecting to a - * Reader. - * - * @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 null|string $device_sw_version The current software version of the reader. - * @property string $device_type Type of reader, one of bbpos_chipper2x or verifone_P400. - * @property null|string $ip_address The local IP address of the reader. - * @property string $label Custom label given to the reader for easier identification. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $serial_number Serial number of the reader. - * @property null|string $status The networking status of the reader. - */ -class Reader extends \Stripe\ApiResource -{ - const OBJECT_NAME = 'terminal.reader'; - - use \Stripe\ApiOperations\All; - use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\Delete; - use \Stripe\ApiOperations\Retrieve; - use \Stripe\ApiOperations\Update; -} +Connecting to a + * Reader. + * + * @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 null|\Stripe\StripeObject $action The most recent action performed by the reader. + * @property null|string $device_sw_version The current software version of the reader. + * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, bbpos_chipper2x, bbpos_wisepos_e, or verifone_P400. + * @property null|string $ip_address The local IP address of the reader. + * @property string $label Custom label given to the reader for easier identification. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $serial_number Serial number of the reader. + * @property null|string $status The networking status of the reader. + */ +class Reader extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.reader'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the canceled reader + */ + public function cancelAction($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel_action'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the processed reader + */ + public function processPaymentIntent($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/process_payment_intent'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the processed reader + */ + public function processSetupIntent($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/process_setup_intent'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the seted reader + */ + public function setReaderDisplay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/set_reader_display'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php b/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php new file mode 100644 index 0000000..849529b --- /dev/null +++ b/vendor/stripe/stripe-php/lib/TestHelpers/TestClock.php @@ -0,0 +1,53 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $name The custom name supplied at creation. + * @property string $status The status of the Test Clock. + */ +class TestClock extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'test_helpers.test_clock'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_ADVANCING = 'advancing'; + const STATUS_INTERNAL_FAILURE = 'internal_failure'; + const STATUS_READY = 'ready'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock the advanced test clock + */ + public function advance($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/advance'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/ThreeDSecure.php b/vendor/stripe/stripe-php/lib/ThreeDSecure.php index 51b5691..2a00db3 100644 --- a/vendor/stripe/stripe-php/lib/ThreeDSecure.php +++ b/vendor/stripe/stripe-php/lib/ThreeDSecure.php @@ -1,37 +1,37 @@ -3D - * Secure object. Once the object has been created, you can use it to - * authenticate the cardholder and create a charge. - * - * @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 $amount Amount of the charge that you will create when authentication completes. - * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. - * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

- * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". - * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. - */ -class ThreeDSecure extends ApiResource -{ - const OBJECT_NAME = 'three_d_secure'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - - /** - * @return string the endpoint URL for the given class - */ - public static function classUrl() - { - return '/v1/3d_secure'; - } -} +3D + * Secure object. Once the object has been created, you can use it to + * authenticate the cardholder and create a charge. + * + * @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 $amount Amount of the charge that you will create when authentication completes. + * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. + * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". + * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. + */ +class ThreeDSecure extends ApiResource +{ + const OBJECT_NAME = 'three_d_secure'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + return '/v1/3d_secure'; + } +} diff --git a/vendor/stripe/stripe-php/lib/Token.php b/vendor/stripe/stripe-php/lib/Token.php index 18b33e8..50ed194 100644 --- a/vendor/stripe/stripe-php/lib/Token.php +++ b/vendor/stripe/stripe-php/lib/Token.php @@ -1,57 +1,57 @@ -recommended payments integrations to - * perform this process client-side. This ensures that no sensitive card data - * touches your server, and allows your integration to operate in a PCI-compliant - * way. - * - * If you cannot use client-side tokenization, you can also create tokens using the - * API with either your publishable or secret API key. Keep in mind that if your - * integration uses this method, you are responsible for any PCI compliance that - * may be required, and you must keep your secret API key safe. Unlike with - * client-side tokenization, your customer's information is not sent directly to - * Stripe, so we cannot determine how it is handled or stored. - * - * Tokens cannot be stored or used more than once. To store card or bank account - * information for later use, you can create Customer objects or Custom accounts. Note - * that Radar, our integrated solution - * for automatic fraud protection, performs best with integrations that use - * client-side tokenization. - * - * Related guide: Accept - * a payment - * - * @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 \Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank Debits and Transfers.

- * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

- * @property null|string $client_ip IP address of the client that generated the token. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $type Type of the token: account, bank_account, card, or pii. - * @property bool $used Whether this token has already been used (tokens can be used only once). - */ -class Token extends ApiResource -{ - const OBJECT_NAME = 'token'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - - const TYPE_ACCOUNT = 'account'; - const TYPE_BANK_ACCOUNT = 'bank_account'; - const TYPE_CARD = 'card'; - const TYPE_PII = 'pii'; -} +recommended payments integrations to + * perform this process client-side. This ensures that no sensitive card data + * touches your server, and allows your integration to operate in a PCI-compliant + * way. + * + * If you cannot use client-side tokenization, you can also create tokens using the + * API with either your publishable or secret API key. Keep in mind that if your + * integration uses this method, you are responsible for any PCI compliance that + * may be required, and you must keep your secret API key safe. Unlike with + * client-side tokenization, your customer's information is not sent directly to + * Stripe, so we cannot determine how it is handled or stored. + * + * Tokens cannot be stored or used more than once. To store card or bank account + * information for later use, you can create Customer objects or Custom accounts. Note + * that Radar, our integrated solution + * for automatic fraud protection, performs best with integrations that use + * client-side tokenization. + * + * Related guide: Accept + * a payment + * + * @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 \Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank Debits and Transfers.

+ * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property null|string $client_ip IP address of the client that generated the token. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the token: account, bank_account, card, or pii. + * @property bool $used Whether this token has already been used (tokens can be used only once). + */ +class Token extends ApiResource +{ + const OBJECT_NAME = 'token'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + const TYPE_ACCOUNT = 'account'; + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + const TYPE_PII = 'pii'; +} diff --git a/vendor/stripe/stripe-php/lib/Topup.php b/vendor/stripe/stripe-php/lib/Topup.php index 69cdd68..86d9261 100644 --- a/vendor/stripe/stripe-php/lib/Topup.php +++ b/vendor/stripe/stripe-php/lib/Topup.php @@ -1,63 +1,63 @@ -Topping Up your - * Platform Account. - * - * @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 $amount Amount transferred. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. - * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). - * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Related guides: Sources API and Sources & Customers.

- * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. - * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. - * @property null|string $transfer_group A string that identifies this top-up as part of a group. - */ -class Topup extends ApiResource -{ - const OBJECT_NAME = 'topup'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const STATUS_CANCELED = 'canceled'; - const STATUS_FAILED = 'failed'; - const STATUS_PENDING = 'pending'; - const STATUS_REVERSED = 'reversed'; - const STATUS_SUCCEEDED = 'succeeded'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Topup the canceled topup - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} +Topping Up your + * Platform Account. + * + * @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 $amount Amount transferred. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. + * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Related guides: Sources API and Sources & Customers.

+ * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. + * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. + * @property null|string $transfer_group A string that identifies this top-up as part of a group. + */ +class Topup extends ApiResource +{ + const OBJECT_NAME = 'topup'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_REVERSED = 'reversed'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup the canceled topup + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/vendor/stripe/stripe-php/lib/Transfer.php b/vendor/stripe/stripe-php/lib/Transfer.php index 4fb0c6a..f778a69 100644 --- a/vendor/stripe/stripe-php/lib/Transfer.php +++ b/vendor/stripe/stripe-php/lib/Transfer.php @@ -1,130 +1,130 @@ -Transfer object is created when you move funds between Stripe - * accounts as part of Connect. - * - * Before April 6, 2017, transfers also represented movement of funds from a Stripe - * account to a card or bank account. This behavior has since been split out into a - * Payout object, with - * corresponding payout endpoints. For more information, read about the transfer/payout split. - * - * Related guide: Creating Separate - * Charges and Transfers. - * - * @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 $amount Amount in %s to be transferred. - * @property int $amount_reversed Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. - * @property int $created Time that this record of the transfer was first created. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. - * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Collection $reversals A list of reversals that have been applied to the transfer. - * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. - * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. - * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. - * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. - */ -class Transfer extends ApiResource -{ - const OBJECT_NAME = 'transfer'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\NestedResource; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; - const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; - const SOURCE_TYPE_CARD = 'card'; - const SOURCE_TYPE_FINANCING = 'financing'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer the canceled transfer - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } - - const PATH_REVERSALS = '/reversals'; - - /** - * @param string $id the ID of the transfer on which to retrieve the transfer reversals - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of transfer reversals - */ - public static function allReversals($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts); - } - - /** - * @param string $id the ID of the transfer on which to create the transfer reversal - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function createReversal($id, $params = null, $opts = null) - { - return self::_createNestedResource($id, static::PATH_REVERSALS, $params, $opts); - } - - /** - * @param string $id the ID of the transfer to which the transfer reversal belongs - * @param string $reversalId the ID of the transfer reversal to retrieve - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) - { - return self::_retrieveNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); - } - - /** - * @param string $id the ID of the transfer to which the transfer reversal belongs - * @param string $reversalId the ID of the transfer reversal to update - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\TransferReversal - */ - public static function updateReversal($id, $reversalId, $params = null, $opts = null) - { - return self::_updateNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); - } -} +Transfer object is created when you move funds between Stripe + * accounts as part of Connect. + * + * Before April 6, 2017, transfers also represented movement of funds from a Stripe + * account to a card or bank account. This behavior has since been split out into a + * Payout object, with + * corresponding payout endpoints. For more information, read about the transfer/payout split. + * + * Related guide: Creating Separate + * Charges and Transfers. + * + * @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 $amount Amount in %s to be transferred. + * @property int $amount_reversed Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. + * @property int $created Time that this record of the transfer was first created. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. + * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Collection<\Stripe\TransferReversal> $reversals A list of reversals that have been applied to the transfer. + * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. + * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. + * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Transfer extends ApiResource +{ + const OBJECT_NAME = 'transfer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; + const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; + const SOURCE_TYPE_CARD = 'card'; + const SOURCE_TYPE_FINANCING = 'financing'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer the canceled transfer + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_REVERSALS = '/reversals'; + + /** + * @param string $id the ID of the transfer on which to retrieve the transfer reversals + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TransferReversal> the list of transfer reversals + */ + public static function allReversals($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer on which to create the transfer reversal + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function createReversal($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function updateReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/TransferReversal.php b/vendor/stripe/stripe-php/lib/TransferReversal.php index b6167db..a2be682 100644 --- a/vendor/stripe/stripe-php/lib/TransferReversal.php +++ b/vendor/stripe/stripe-php/lib/TransferReversal.php @@ -1,79 +1,79 @@ -Stripe Connect platforms can - * reverse transfers made to a connected account, either entirely or partially, and - * can also specify whether to refund any related application fees. Transfer - * reversals add to the platform's balance and subtract from the destination - * account's balance. - * - * Reversing a transfer that was made for a destination charge is allowed only - * up to the amount of the charge. It is possible to reverse a transfer_group - * transfer only if the destination account has enough balance to cover the - * reversal. - * - * Related guide: Reversing - * Transfers. - * - * @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 $amount Amount, in %s. - * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. - * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. - */ -class TransferReversal extends ApiResource -{ - const OBJECT_NAME = 'transfer_reversal'; - - use ApiOperations\Update { - save as protected _save; - } - - /** - * @return string the API URL for this Stripe transfer reversal - */ - public function instanceUrl() - { - $id = $this['id']; - $transfer = $this['transfer']; - if (!$id) { - throw new Exception\UnexpectedValueException( - 'Could not determine which URL to request: ' . - "class instance has invalid ID: {$id}", - null - ); - } - $id = Util\Util::utf8($id); - $transfer = Util\Util::utf8($transfer); - - $base = Transfer::classUrl(); - $transferExtn = \urlencode($transfer); - $extn = \urlencode($id); - - return "{$base}/{$transferExtn}/reversals/{$extn}"; - } - - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return TransferReversal the saved reversal - */ - public function save($opts = null) - { - return $this->_save($opts); - } -} +Stripe Connect platforms can + * reverse transfers made to a connected account, either entirely or partially, and + * can also specify whether to refund any related application fees. Transfer + * reversals add to the platform's balance and subtract from the destination + * account's balance. + * + * Reversing a transfer that was made for a destination charge is allowed only + * up to the amount of the charge. It is possible to reverse a transfer_group + * transfer only if the destination account has enough balance to cover the + * reversal. + * + * Related guide: Reversing + * Transfers. + * + * @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 $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs 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|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. + * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. + */ +class TransferReversal extends ApiResource +{ + const OBJECT_NAME = 'transfer_reversal'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe transfer reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $transfer = $this['transfer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $transfer = Util\Util::utf8($transfer); + + $base = Transfer::classUrl(); + $transferExtn = \urlencode($transfer); + $extn = \urlencode($id); + + return "{$base}/{$transferExtn}/reversals/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return TransferReversal the saved reversal + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/UsageRecord.php b/vendor/stripe/stripe-php/lib/UsageRecord.php index 5522982..355c796 100644 --- a/vendor/stripe/stripe-php/lib/UsageRecord.php +++ b/vendor/stripe/stripe-php/lib/UsageRecord.php @@ -1,25 +1,25 @@ -Metered - * Billing. - * - * @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 $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property int $quantity The usage quantity for the specified date. - * @property string $subscription_item The ID of the subscription item this usage record contains data for. - * @property int $timestamp The timestamp when this usage occurred. - */ -class UsageRecord extends ApiResource -{ - const OBJECT_NAME = 'usage_record'; -} +Metered + * Billing. + * + * @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 $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $quantity The usage quantity for the specified date. + * @property string $subscription_item The ID of the subscription item this usage record contains data for. + * @property int $timestamp The timestamp when this usage occurred. + */ +class UsageRecord extends ApiResource +{ + const OBJECT_NAME = 'usage_record'; +} diff --git a/vendor/stripe/stripe-php/lib/UsageRecordSummary.php b/vendor/stripe/stripe-php/lib/UsageRecordSummary.php index 174e14e..d56d5d3 100644 --- a/vendor/stripe/stripe-php/lib/UsageRecordSummary.php +++ b/vendor/stripe/stripe-php/lib/UsageRecordSummary.php @@ -1,19 +1,19 @@ -true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $period - * @property string $subscription_item The ID of the subscription item this summary is describing. - * @property int $total_usage The total usage within this usage period. - */ -class UsageRecordSummary extends ApiResource -{ - const OBJECT_NAME = 'usage_record_summary'; -} +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $period + * @property string $subscription_item The ID of the subscription item this summary is describing. + * @property int $total_usage The total usage within this usage period. + */ +class UsageRecordSummary extends ApiResource +{ + const OBJECT_NAME = 'usage_record_summary'; +} diff --git a/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index 670ab0b..ce6bd3a 100644 --- a/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -1,72 +1,93 @@ -container = \array_change_key_case($initial_array, \CASE_LOWER); - } - - public function count() - { - return \count($this->container); - } - - public function getIterator() - { - return new \ArrayIterator($this->container); - } - - public function offsetSet($offset, $value) - { - $offset = static::maybeLowercase($offset); - if (null === $offset) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - public function offsetExists($offset) - { - $offset = static::maybeLowercase($offset); - - return isset($this->container[$offset]); - } - - public function offsetUnset($offset) - { - $offset = static::maybeLowercase($offset); - unset($this->container[$offset]); - } - - public function offsetGet($offset) - { - $offset = static::maybeLowercase($offset); - - return isset($this->container[$offset]) ? $this->container[$offset] : null; - } - - private static function maybeLowercase($v) - { - if (\is_string($v)) { - return \strtolower($v); - } - - return $v; - } -} +container = \array_change_key_case($initial_array, \CASE_LOWER); + } + + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->container); + } + + /** + * @return \ArrayIterator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->container); + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + $offset = static::maybeLowercase($offset); + if (null === $offset) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * @return bool + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]); + } + + /** + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $offset = static::maybeLowercase($offset); + unset($this->container[$offset]); + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + private static function maybeLowercase($v) + { + if (\is_string($v)) { + return \strtolower($v); + } + + return $v; + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php b/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php index 016cbe8..b749702 100644 --- a/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php +++ b/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php @@ -1,29 +1,29 @@ - 0) { - throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); - } - - if (null === $this->destination) { - \error_log($message, $this->messageType); - } else { - \error_log($message, $this->messageType, $this->destination); - } - } -} + 0) { + throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); + } + + if (null === $this->destination) { + \error_log($message, $this->messageType); + } else { + \error_log($message, $this->messageType, $this->destination); + } + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php b/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php index 5603c81..c9b7be2 100644 --- a/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php +++ b/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php @@ -1,34 +1,34 @@ - \Stripe\Account::class, - \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, - \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, - \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, - \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, - \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, - \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, - \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, - \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, - \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, - \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, - \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, - \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, - \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, - \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, - \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, - \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, - \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, - \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, - \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, - \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, - \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, - \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, - \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, - \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, - \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, - \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, - \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, - \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, - \Stripe\File::OBJECT_NAME => \Stripe\File::class, - \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, - \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, - \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, - \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, - \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, - \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, - \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, - \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, - \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, - \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, - \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, - \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, - \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, - \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, - \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, - \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, - \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, - \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, - \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, - \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, - \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, - \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, - \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, - \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, - \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, - \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, - \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, - \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, - \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, - \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, - \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, - \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, - \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, - \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, - \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, - \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, - \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, - \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, - \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, - \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, - \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, - \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, - \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, - \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, - \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, - \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, - \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, - \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, - \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, - \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, - \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, - \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, - \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, - \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, - \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, - \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, - \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, - \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, - ]; -} + \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, + \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, + \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, + \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, + \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, + \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, + \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, + \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, + \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, + \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, + \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, + \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, + \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, + \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, + \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, + \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, + \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, + \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, + \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, + \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, + \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, + \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, + \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, + \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, + \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, + \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, + \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, + \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, + \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, + \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, + \Stripe\SearchResult::OBJECT_NAME => \Stripe\SearchResult::class, + \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, + \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, + \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class, + \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, + \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, + \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, + \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, + \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, + \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, + \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, + \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, + \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, + \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, + \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, + \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, + \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, + \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, + \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, + \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, + \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, + ]; +} diff --git a/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php b/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php index b11e445..78a324e 100644 --- a/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php +++ b/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php @@ -1,36 +1,36 @@ - a list of headers that should be persisted across requests - */ - public static $HEADERS_TO_PERSIST = [ - 'Stripe-Account', - 'Stripe-Version', - ]; - - /** @var array */ - public $headers; - - /** @var null|string */ - public $apiKey; - - /** @var null|string */ - public $apiBase; - - /** - * @param null|string $key - * @param array $headers - * @param null|string $base - */ - public function __construct($key = null, $headers = [], $base = null) - { - $this->apiKey = $key; - $this->headers = $headers; - $this->apiBase = $base; - } - - /** - * @return array - */ - public function __debugInfo() - { - return [ - 'apiKey' => $this->redactedApiKey(), - 'headers' => $this->headers, - 'apiBase' => $this->apiBase, - ]; - } - - /** - * Unpacks an options array and merges it into the existing RequestOptions - * object. - * - * @param null|array|RequestOptions|string $options a key => value array - * @param bool $strict when true, forbid string form and arbitrary keys in array form - * - * @return RequestOptions - */ - public function merge($options, $strict = false) - { - $other_options = self::parse($options, $strict); - if (null === $other_options->apiKey) { - $other_options->apiKey = $this->apiKey; - } - if (null === $other_options->apiBase) { - $other_options->apiBase = $this->apiBase; - } - $other_options->headers = \array_merge($this->headers, $other_options->headers); - - return $other_options; - } - - /** - * Discards all headers that we don't want to persist across requests. - */ - public function discardNonPersistentHeaders() - { - foreach ($this->headers as $k => $v) { - if (!\in_array($k, self::$HEADERS_TO_PERSIST, true)) { - unset($this->headers[$k]); - } - } - } - - /** - * Unpacks an options array into an RequestOptions object. - * - * @param null|array|RequestOptions|string $options a key => value array - * @param bool $strict when true, forbid string form and arbitrary keys in array form - * - * @throws \Stripe\Exception\InvalidArgumentException - * - * @return RequestOptions - */ - public static function parse($options, $strict = false) - { - if ($options instanceof self) { - return $options; - } - - if (null === $options) { - return new RequestOptions(null, [], null); - } - - if (\is_string($options)) { - if ($strict) { - $message = 'Do not pass a string for request options. If you want to set the ' - . 'API key, pass an array like ["api_key" => ] instead.'; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - return new RequestOptions($options, [], null); - } - - if (\is_array($options)) { - $headers = []; - $key = null; - $base = null; - - if (\array_key_exists('api_key', $options)) { - $key = $options['api_key']; - unset($options['api_key']); - } - if (\array_key_exists('idempotency_key', $options)) { - $headers['Idempotency-Key'] = $options['idempotency_key']; - unset($options['idempotency_key']); - } - if (\array_key_exists('stripe_account', $options)) { - $headers['Stripe-Account'] = $options['stripe_account']; - unset($options['stripe_account']); - } - if (\array_key_exists('stripe_version', $options)) { - $headers['Stripe-Version'] = $options['stripe_version']; - unset($options['stripe_version']); - } - if (\array_key_exists('api_base', $options)) { - $base = $options['api_base']; - unset($options['api_base']); - } - - if ($strict && !empty($options)) { - $message = 'Got unexpected keys in options array: ' . \implode(', ', \array_keys($options)); - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - return new RequestOptions($key, $headers, $base); - } - - $message = 'The second argument to Stripe API method calls is an ' - . 'optional per-request apiKey, which must be a string, or ' - . 'per-request options, which must be an array. (HINT: you can set ' - . 'a global apiKey by "Stripe::setApiKey()")'; - - throw new \Stripe\Exception\InvalidArgumentException($message); - } - - private function redactedApiKey() - { - $pieces = \explode('_', $this->apiKey, 3); - $last = \array_pop($pieces); - $redactedLast = \strlen($last) > 4 - ? (\str_repeat('*', \strlen($last) - 4) . \substr($last, -4)) - : $last; - $pieces[] = $redactedLast; - - return \implode('_', $pieces); - } -} + a list of headers that should be persisted across requests + */ + public static $HEADERS_TO_PERSIST = [ + 'Stripe-Account', + 'Stripe-Version', + ]; + + /** @var array */ + public $headers; + + /** @var null|string */ + public $apiKey; + + /** @var null|string */ + public $apiBase; + + /** + * @param null|string $key + * @param array $headers + * @param null|string $base + */ + public function __construct($key = null, $headers = [], $base = null) + { + $this->apiKey = $key; + $this->headers = $headers; + $this->apiBase = $base; + } + + /** + * @return array + */ + public function __debugInfo() + { + return [ + 'apiKey' => $this->redactedApiKey(), + 'headers' => $this->headers, + 'apiBase' => $this->apiBase, + ]; + } + + /** + * Unpacks an options array and merges it into the existing RequestOptions + * object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @return RequestOptions + */ + public function merge($options, $strict = false) + { + $other_options = self::parse($options, $strict); + if (null === $other_options->apiKey) { + $other_options->apiKey = $this->apiKey; + } + if (null === $other_options->apiBase) { + $other_options->apiBase = $this->apiBase; + } + $other_options->headers = \array_merge($this->headers, $other_options->headers); + + return $other_options; + } + + /** + * Discards all headers that we don't want to persist across requests. + */ + public function discardNonPersistentHeaders() + { + foreach ($this->headers as $k => $v) { + if (!\in_array($k, self::$HEADERS_TO_PERSIST, true)) { + unset($this->headers[$k]); + } + } + } + + /** + * Unpacks an options array into an RequestOptions object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return RequestOptions + */ + public static function parse($options, $strict = false) + { + if ($options instanceof self) { + return clone $options; + } + + if (null === $options) { + return new RequestOptions(null, [], null); + } + + if (\is_string($options)) { + if ($strict) { + $message = 'Do not pass a string for request options. If you want to set the ' + . 'API key, pass an array like ["api_key" => ] instead.'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($options, [], null); + } + + if (\is_array($options)) { + $headers = []; + $key = null; + $base = null; + + if (\array_key_exists('api_key', $options)) { + $key = $options['api_key']; + unset($options['api_key']); + } + if (\array_key_exists('idempotency_key', $options)) { + $headers['Idempotency-Key'] = $options['idempotency_key']; + unset($options['idempotency_key']); + } + if (\array_key_exists('stripe_account', $options)) { + $headers['Stripe-Account'] = $options['stripe_account']; + unset($options['stripe_account']); + } + if (\array_key_exists('stripe_version', $options)) { + $headers['Stripe-Version'] = $options['stripe_version']; + unset($options['stripe_version']); + } + if (\array_key_exists('api_base', $options)) { + $base = $options['api_base']; + unset($options['api_base']); + } + + if ($strict && !empty($options)) { + $message = 'Got unexpected keys in options array: ' . \implode(', ', \array_keys($options)); + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($key, $headers, $base); + } + + $message = 'The second argument to Stripe API method calls is an ' + . 'optional per-request apiKey, which must be a string, or ' + . 'per-request options, which must be an array. (HINT: you can set ' + . 'a global apiKey by "Stripe::setApiKey()")'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + private function redactedApiKey() + { + $pieces = \explode('_', $this->apiKey, 3); + $last = \array_pop($pieces); + $redactedLast = \strlen($last) > 4 + ? (\str_repeat('*', \strlen($last) - 4) . \substr($last, -4)) + : $last; + $pieces[] = $redactedLast; + + return \implode('_', $pieces); + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/Set.php b/vendor/stripe/stripe-php/lib/Util/Set.php index 017f929..57caab1 100644 --- a/vendor/stripe/stripe-php/lib/Util/Set.php +++ b/vendor/stripe/stripe-php/lib/Util/Set.php @@ -1,44 +1,48 @@ -_elts = []; - foreach ($members as $item) { - $this->_elts[$item] = true; - } - } - - public function includes($elt) - { - return isset($this->_elts[$elt]); - } - - public function add($elt) - { - $this->_elts[$elt] = true; - } - - public function discard($elt) - { - unset($this->_elts[$elt]); - } - - public function toArray() - { - return \array_keys($this->_elts); - } - - public function getIterator() - { - return new ArrayIterator($this->toArray()); - } -} +_elts = []; + foreach ($members as $item) { + $this->_elts[$item] = true; + } + } + + public function includes($elt) + { + return isset($this->_elts[$elt]); + } + + public function add($elt) + { + $this->_elts[$elt] = true; + } + + public function discard($elt) + { + unset($this->_elts[$elt]); + } + + public function toArray() + { + return \array_keys($this->_elts); + } + + /** + * @return ArrayIterator + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new ArrayIterator($this->toArray()); + } +} diff --git a/vendor/stripe/stripe-php/lib/Util/Util.php b/vendor/stripe/stripe-php/lib/Util/Util.php index 4f39050..602f466 100644 --- a/vendor/stripe/stripe-php/lib/Util/Util.php +++ b/vendor/stripe/stripe-php/lib/Util/Util.php @@ -1,265 +1,265 @@ -id; - } - if (static::isList($h)) { - $results = []; - foreach ($h as $v) { - $results[] = static::objectsToIds($v); - } - - return $results; - } - if (\is_array($h)) { - $results = []; - foreach ($h as $k => $v) { - if (null === $v) { - continue; - } - $results[$k] = static::objectsToIds($v); - } - - return $results; - } - - return $h; - } - - /** - * @param array $params - * - * @return string - */ - public static function encodeParameters($params) - { - $flattenedParams = self::flattenParams($params); - $pieces = []; - foreach ($flattenedParams as $param) { - list($k, $v) = $param; - $pieces[] = self::urlEncode($k) . '=' . self::urlEncode($v); - } - - return \implode('&', $pieces); - } - - /** - * @param array $params - * @param null|string $parentKey - * - * @return array - */ - public static function flattenParams($params, $parentKey = null) - { - $result = []; - - foreach ($params as $key => $value) { - $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; - - if (self::isList($value)) { - $result = \array_merge($result, self::flattenParamsList($value, $calculatedKey)); - } elseif (\is_array($value)) { - $result = \array_merge($result, self::flattenParams($value, $calculatedKey)); - } else { - \array_push($result, [$calculatedKey, $value]); - } - } - - return $result; - } - - /** - * @param array $value - * @param string $calculatedKey - * - * @return array - */ - public static function flattenParamsList($value, $calculatedKey) - { - $result = []; - - foreach ($value as $i => $elem) { - if (self::isList($elem)) { - $result = \array_merge($result, self::flattenParamsList($elem, $calculatedKey)); - } elseif (\is_array($elem)) { - $result = \array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); - } else { - \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); - } - } - - return $result; - } - - /** - * @param string $key a string to URL-encode - * - * @return string the URL-encoded string - */ - public static function urlEncode($key) - { - $s = \urlencode((string) $key); - - // Don't use strict form encoding by changing the square bracket control - // characters back to their literals. This is fine by the server, and - // makes these parameter strings easier to read. - $s = \str_replace('%5B', '[', $s); - - return \str_replace('%5D', ']', $s); - } - - public static function normalizeId($id) - { - if (\is_array($id)) { - $params = $id; - $id = $params['id']; - unset($params['id']); - } else { - $params = []; - } - - return [$id, $params]; - } - - /** - * Returns UNIX timestamp in milliseconds. - * - * @return int current time in millis - */ - public static function currentTimeMillis() - { - return (int) \round(\microtime(true) * 1000); - } -} +id; + } + if (static::isList($h)) { + $results = []; + foreach ($h as $v) { + $results[] = static::objectsToIds($v); + } + + return $results; + } + if (\is_array($h)) { + $results = []; + foreach ($h as $k => $v) { + if (null === $v) { + continue; + } + $results[$k] = static::objectsToIds($v); + } + + return $results; + } + + return $h; + } + + /** + * @param array $params + * + * @return string + */ + public static function encodeParameters($params) + { + $flattenedParams = self::flattenParams($params); + $pieces = []; + foreach ($flattenedParams as $param) { + list($k, $v) = $param; + $pieces[] = self::urlEncode($k) . '=' . self::urlEncode($v); + } + + return \implode('&', $pieces); + } + + /** + * @param array $params + * @param null|string $parentKey + * + * @return array + */ + public static function flattenParams($params, $parentKey = null) + { + $result = []; + + foreach ($params as $key => $value) { + $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; + + if (self::isList($value)) { + $result = \array_merge($result, self::flattenParamsList($value, $calculatedKey)); + } elseif (\is_array($value)) { + $result = \array_merge($result, self::flattenParams($value, $calculatedKey)); + } else { + \array_push($result, [$calculatedKey, $value]); + } + } + + return $result; + } + + /** + * @param array $value + * @param string $calculatedKey + * + * @return array + */ + public static function flattenParamsList($value, $calculatedKey) + { + $result = []; + + foreach ($value as $i => $elem) { + if (self::isList($elem)) { + $result = \array_merge($result, self::flattenParamsList($elem, $calculatedKey)); + } elseif (\is_array($elem)) { + $result = \array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); + } else { + \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); + } + } + + return $result; + } + + /** + * @param string $key a string to URL-encode + * + * @return string the URL-encoded string + */ + public static function urlEncode($key) + { + $s = \urlencode((string) $key); + + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + $s = \str_replace('%5B', '[', $s); + + return \str_replace('%5D', ']', $s); + } + + public static function normalizeId($id) + { + if (\is_array($id)) { + $params = $id; + $id = $params['id']; + unset($params['id']); + } else { + $params = []; + } + + return [$id, $params]; + } + + /** + * Returns UNIX timestamp in milliseconds. + * + * @return int current time in millis + */ + public static function currentTimeMillis() + { + return (int) \round(\microtime(true) * 1000); + } +} diff --git a/vendor/stripe/stripe-php/lib/Webhook.php b/vendor/stripe/stripe-php/lib/Webhook.php index b9db2d6..67d2799 100644 --- a/vendor/stripe/stripe-php/lib/Webhook.php +++ b/vendor/stripe/stripe-php/lib/Webhook.php @@ -1,42 +1,42 @@ -webhook - * endpoints via the API to be notified about events that happen in your Stripe - * account or connected accounts. - * - * Most users configure webhooks from the dashboard, which provides a - * user interface for registering and testing your webhook endpoints. - * - * Related guide: Setting up - * Webhooks. - * - * @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 null|string $api_version The API version events are rendered as for this webhook endpoint. - * @property null|string $application The ID of the associated Connect application. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string $description An optional description of what the webhook is used for. - * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. - * @property string $status The status of the webhook. It can be enabled or disabled. - * @property string $url The URL of the webhook endpoint. - */ -class WebhookEndpoint extends ApiResource -{ - const OBJECT_NAME = 'webhook_endpoint'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} +webhook + * endpoints via the API to be notified about events that happen in your Stripe + * account or connected accounts. + * + * Most users configure webhooks from the dashboard, which provides a + * user interface for registering and testing your webhook endpoints. + * + * Related guide: Setting up + * Webhooks. + * + * @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 null|string $api_version The API version events are rendered as for this webhook endpoint. + * @property null|string $application The ID of the associated Connect application. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An optional description of what the webhook is used for. + * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. + * @property string $status The status of the webhook. It can be enabled or disabled. + * @property string $url The URL of the webhook endpoint. + */ +class WebhookEndpoint extends ApiResource +{ + const OBJECT_NAME = 'webhook_endpoint'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/vendor/stripe/stripe-php/lib/WebhookSignature.php b/vendor/stripe/stripe-php/lib/WebhookSignature.php index 46cbb28..bfd1dde 100644 --- a/vendor/stripe/stripe-php/lib/WebhookSignature.php +++ b/vendor/stripe/stripe-php/lib/WebhookSignature.php @@ -1,140 +1,140 @@ - 0) && (\abs(\time() - $timestamp) > $tolerance)) { - throw Exception\SignatureVerificationException::factory( - 'Timestamp outside the tolerance zone', - $payload, - $header - ); - } - - return true; - } - - /** - * Extracts the timestamp in a signature header. - * - * @param string $header the signature header - * - * @return int the timestamp contained in the header, or -1 if no valid - * timestamp is found - */ - private static function getTimestamp($header) - { - $items = \explode(',', $header); - - foreach ($items as $item) { - $itemParts = \explode('=', $item, 2); - if ('t' === $itemParts[0]) { - if (!\is_numeric($itemParts[1])) { - return -1; - } - - return (int) ($itemParts[1]); - } - } - - return -1; - } - - /** - * Extracts the signatures matching a given scheme in a signature header. - * - * @param string $header the signature header - * @param string $scheme the signature scheme to look for - * - * @return array the list of signatures matching the provided scheme - */ - private static function getSignatures($header, $scheme) - { - $signatures = []; - $items = \explode(',', $header); - - foreach ($items as $item) { - $itemParts = \explode('=', $item, 2); - if (\trim($itemParts[0]) === $scheme) { - $signatures[] = $itemParts[1]; - } - } - - return $signatures; - } - - /** - * Computes the signature for a given payload and secret. - * - * The current scheme used by Stripe ("v1") is HMAC/SHA-256. - * - * @param string $payload the payload to sign - * @param string $secret the secret used to generate the signature - * - * @return string the signature as a string - */ - private static function computeSignature($payload, $secret) - { - return \hash_hmac('sha256', $payload, $secret); - } -} + 0) && (\abs(\time() - $timestamp) > $tolerance)) { + throw Exception\SignatureVerificationException::factory( + 'Timestamp outside the tolerance zone', + $payload, + $header + ); + } + + return true; + } + + /** + * Extracts the timestamp in a signature header. + * + * @param string $header the signature header + * + * @return int the timestamp contained in the header, or -1 if no valid + * timestamp is found + */ + private static function getTimestamp($header) + { + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if ('t' === $itemParts[0]) { + if (!\is_numeric($itemParts[1])) { + return -1; + } + + return (int) ($itemParts[1]); + } + } + + return -1; + } + + /** + * Extracts the signatures matching a given scheme in a signature header. + * + * @param string $header the signature header + * @param string $scheme the signature scheme to look for + * + * @return array the list of signatures matching the provided scheme + */ + private static function getSignatures($header, $scheme) + { + $signatures = []; + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if (\trim($itemParts[0]) === $scheme) { + $signatures[] = $itemParts[1]; + } + } + + return $signatures; + } + + /** + * Computes the signature for a given payload and secret. + * + * The current scheme used by Stripe ("v1") is HMAC/SHA-256. + * + * @param string $payload the payload to sign + * @param string $secret the secret used to generate the signature + * + * @return string the signature as a string + */ + private static function computeSignature($payload, $secret) + { + return \hash_hmac('sha256', $payload, $secret); + } +} -- cgit v1.2.3