├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── OPENAPI_VERSION ├── README.md ├── VERSION ├── composer.json ├── data └── ca-certificates.crt ├── init.php ├── justfile └── lib ├── Account.php ├── AccountLink.php ├── AccountSession.php ├── ApiOperations ├── All.php ├── Create.php ├── Delete.php ├── NestedResource.php ├── Request.php ├── Retrieve.php ├── SingletonRetrieve.php └── Update.php ├── ApiRequestor.php ├── ApiResource.php ├── ApiResponse.php ├── ApplePayDomain.php ├── Application.php ├── ApplicationFee.php ├── ApplicationFeeRefund.php ├── Apps └── Secret.php ├── Balance.php ├── BalanceTransaction.php ├── BankAccount.php ├── BaseStripeClient.php ├── BaseStripeClientInterface.php ├── Billing ├── Alert.php ├── AlertTriggered.php ├── CreditBalanceSummary.php ├── CreditBalanceTransaction.php ├── CreditGrant.php ├── Meter.php ├── MeterEvent.php ├── MeterEventAdjustment.php └── MeterEventSummary.php ├── BillingPortal ├── Configuration.php └── Session.php ├── Capability.php ├── Card.php ├── CashBalance.php ├── Charge.php ├── Checkout └── Session.php ├── Climate ├── Order.php ├── Product.php └── Supplier.php ├── Collection.php ├── ConfirmationToken.php ├── ConnectCollectionTransfer.php ├── CountrySpec.php ├── Coupon.php ├── CreditNote.php ├── CreditNoteLineItem.php ├── Customer.php ├── CustomerBalanceTransaction.php ├── CustomerCashBalanceTransaction.php ├── CustomerSession.php ├── Discount.php ├── Dispute.php ├── Entitlements ├── ActiveEntitlement.php ├── ActiveEntitlementSummary.php └── Feature.php ├── EphemeralKey.php ├── ErrorObject.php ├── Event.php ├── EventData ├── V1BillingMeterErrorReportTriggeredEventData.php └── V1BillingMeterNoMeterFoundEventData.php ├── Events ├── V1BillingMeterErrorReportTriggeredEvent.php ├── V1BillingMeterNoMeterFoundEvent.php └── V2CoreEventDestinationPingEvent.php ├── Exception ├── ApiConnectionException.php ├── ApiErrorException.php ├── AuthenticationException.php ├── BadMethodCallException.php ├── CardException.php ├── ExceptionInterface.php ├── IdempotencyException.php ├── InvalidArgumentException.php ├── InvalidRequestException.php ├── OAuth │ ├── ExceptionInterface.php │ ├── InvalidClientException.php │ ├── InvalidGrantException.php │ ├── InvalidRequestException.php │ ├── InvalidScopeException.php │ ├── OAuthErrorException.php │ ├── UnknownOAuthErrorException.php │ ├── UnsupportedGrantTypeException.php │ └── UnsupportedResponseTypeException.php ├── PermissionException.php ├── RateLimitException.php ├── SignatureVerificationException.php ├── TemporarySessionExpiredException.php ├── UnexpectedValueException.php └── UnknownApiErrorException.php ├── ExchangeRate.php ├── File.php ├── FileLink.php ├── FinancialConnections ├── Account.php ├── AccountOwner.php ├── AccountOwnership.php ├── Session.php └── Transaction.php ├── Forwarding └── Request.php ├── FundingInstructions.php ├── HttpClient ├── ClientInterface.php ├── CurlClient.php └── StreamingClientInterface.php ├── Identity ├── VerificationReport.php └── VerificationSession.php ├── Invoice.php ├── InvoiceItem.php ├── InvoiceLineItem.php ├── InvoicePayment.php ├── InvoiceRenderingTemplate.php ├── Issuing ├── Authorization.php ├── Card.php ├── CardDetails.php ├── Cardholder.php ├── Dispute.php ├── PersonalizationDesign.php ├── PhysicalBundle.php ├── Token.php └── Transaction.php ├── LineItem.php ├── LoginLink.php ├── Mandate.php ├── OAuth.php ├── OAuthErrorObject.php ├── PaymentIntent.php ├── PaymentLink.php ├── PaymentMethod.php ├── PaymentMethodConfiguration.php ├── PaymentMethodDomain.php ├── Payout.php ├── Person.php ├── Plan.php ├── Price.php ├── Product.php ├── ProductFeature.php ├── PromotionCode.php ├── Quote.php ├── Radar ├── EarlyFraudWarning.php ├── ValueList.php └── ValueListItem.php ├── Reason.php ├── RecipientTransfer.php ├── Refund.php ├── RelatedObject.php ├── Reporting ├── ReportRun.php └── ReportType.php ├── RequestTelemetry.php ├── ReserveTransaction.php ├── Review.php ├── SearchResult.php ├── Service ├── AbstractService.php ├── AbstractServiceFactory.php ├── AccountLinkService.php ├── AccountService.php ├── AccountSessionService.php ├── ApplePayDomainService.php ├── ApplicationFeeService.php ├── Apps │ ├── AppsServiceFactory.php │ └── SecretService.php ├── BalanceService.php ├── BalanceTransactionService.php ├── Billing │ ├── AlertService.php │ ├── BillingServiceFactory.php │ ├── CreditBalanceSummaryService.php │ ├── CreditBalanceTransactionService.php │ ├── CreditGrantService.php │ ├── MeterEventAdjustmentService.php │ ├── MeterEventService.php │ └── MeterService.php ├── BillingPortal │ ├── BillingPortalServiceFactory.php │ ├── ConfigurationService.php │ └── SessionService.php ├── ChargeService.php ├── Checkout │ ├── CheckoutServiceFactory.php │ └── SessionService.php ├── Climate │ ├── ClimateServiceFactory.php │ ├── OrderService.php │ ├── ProductService.php │ └── SupplierService.php ├── ConfirmationTokenService.php ├── CoreServiceFactory.php ├── CountrySpecService.php ├── CouponService.php ├── CreditNoteService.php ├── CustomerService.php ├── CustomerSessionService.php ├── DisputeService.php ├── Entitlements │ ├── ActiveEntitlementService.php │ ├── EntitlementsServiceFactory.php │ └── FeatureService.php ├── EphemeralKeyService.php ├── EventService.php ├── ExchangeRateService.php ├── FileLinkService.php ├── FileService.php ├── FinancialConnections │ ├── AccountService.php │ ├── FinancialConnectionsServiceFactory.php │ ├── SessionService.php │ └── TransactionService.php ├── Forwarding │ ├── ForwardingServiceFactory.php │ └── RequestService.php ├── Identity │ ├── IdentityServiceFactory.php │ ├── VerificationReportService.php │ └── VerificationSessionService.php ├── InvoiceItemService.php ├── InvoicePaymentService.php ├── InvoiceRenderingTemplateService.php ├── InvoiceService.php ├── Issuing │ ├── AuthorizationService.php │ ├── CardService.php │ ├── CardholderService.php │ ├── DisputeService.php │ ├── IssuingServiceFactory.php │ ├── PersonalizationDesignService.php │ ├── PhysicalBundleService.php │ ├── TokenService.php │ └── TransactionService.php ├── MandateService.php ├── OAuthService.php ├── PaymentIntentService.php ├── PaymentLinkService.php ├── PaymentMethodConfigurationService.php ├── PaymentMethodDomainService.php ├── PaymentMethodService.php ├── PayoutService.php ├── PlanService.php ├── PriceService.php ├── ProductService.php ├── PromotionCodeService.php ├── QuoteService.php ├── Radar │ ├── EarlyFraudWarningService.php │ ├── RadarServiceFactory.php │ ├── ValueListItemService.php │ └── ValueListService.php ├── RefundService.php ├── Reporting │ ├── ReportRunService.php │ ├── ReportTypeService.php │ └── ReportingServiceFactory.php ├── ReviewService.php ├── ServiceNavigatorTrait.php ├── SetupAttemptService.php ├── SetupIntentService.php ├── ShippingRateService.php ├── Sigma │ ├── ScheduledQueryRunService.php │ └── SigmaServiceFactory.php ├── SourceService.php ├── SubscriptionItemService.php ├── SubscriptionScheduleService.php ├── SubscriptionService.php ├── Tax │ ├── CalculationService.php │ ├── RegistrationService.php │ ├── SettingsService.php │ ├── TaxServiceFactory.php │ └── TransactionService.php ├── TaxCodeService.php ├── TaxIdService.php ├── TaxRateService.php ├── Terminal │ ├── ConfigurationService.php │ ├── ConnectionTokenService.php │ ├── LocationService.php │ ├── ReaderService.php │ └── TerminalServiceFactory.php ├── TestHelpers │ ├── ConfirmationTokenService.php │ ├── CustomerService.php │ ├── Issuing │ │ ├── AuthorizationService.php │ │ ├── CardService.php │ │ ├── IssuingServiceFactory.php │ │ ├── PersonalizationDesignService.php │ │ └── TransactionService.php │ ├── RefundService.php │ ├── Terminal │ │ ├── ReaderService.php │ │ └── TerminalServiceFactory.php │ ├── TestClockService.php │ ├── TestHelpersServiceFactory.php │ └── Treasury │ │ ├── InboundTransferService.php │ │ ├── OutboundPaymentService.php │ │ ├── OutboundTransferService.php │ │ ├── ReceivedCreditService.php │ │ ├── ReceivedDebitService.php │ │ └── TreasuryServiceFactory.php ├── TokenService.php ├── TopupService.php ├── TransferService.php ├── Treasury │ ├── CreditReversalService.php │ ├── DebitReversalService.php │ ├── FinancialAccountService.php │ ├── InboundTransferService.php │ ├── OutboundPaymentService.php │ ├── OutboundTransferService.php │ ├── ReceivedCreditService.php │ ├── ReceivedDebitService.php │ ├── TransactionEntryService.php │ ├── TransactionService.php │ └── TreasuryServiceFactory.php ├── V2 │ ├── Billing │ │ ├── BillingServiceFactory.php │ │ ├── MeterEventAdjustmentService.php │ │ ├── MeterEventService.php │ │ ├── MeterEventSessionService.php │ │ └── MeterEventStreamService.php │ ├── Core │ │ ├── CoreServiceFactory.php │ │ ├── EventDestinationService.php │ │ └── EventService.php │ └── V2ServiceFactory.php └── WebhookEndpointService.php ├── SetupAttempt.php ├── SetupIntent.php ├── ShippingRate.php ├── Sigma └── ScheduledQueryRun.php ├── SingletonApiResource.php ├── Source.php ├── SourceMandateNotification.php ├── SourceTransaction.php ├── Stripe.php ├── StripeClient.php ├── StripeClientInterface.php ├── StripeObject.php ├── StripeStreamingClientInterface.php ├── Subscription.php ├── SubscriptionItem.php ├── SubscriptionSchedule.php ├── Tax ├── Calculation.php ├── CalculationLineItem.php ├── Registration.php ├── Settings.php ├── Transaction.php └── TransactionLineItem.php ├── TaxCode.php ├── TaxDeductedAtSource.php ├── TaxId.php ├── TaxRate.php ├── Terminal ├── Configuration.php ├── ConnectionToken.php ├── Location.php └── Reader.php ├── TestHelpers └── TestClock.php ├── ThinEvent.php ├── Token.php ├── Topup.php ├── Transfer.php ├── TransferReversal.php ├── Treasury ├── CreditReversal.php ├── DebitReversal.php ├── FinancialAccount.php ├── FinancialAccountFeatures.php ├── InboundTransfer.php ├── OutboundPayment.php ├── OutboundTransfer.php ├── ReceivedCredit.php ├── ReceivedDebit.php ├── Transaction.php └── TransactionEntry.php ├── Util ├── ApiVersion.php ├── CaseInsensitiveArray.php ├── DefaultLogger.php ├── EventTypes.php ├── LoggerInterface.php ├── ObjectTypes.php ├── RandomGenerator.php ├── RequestOptions.php ├── Set.php └── Util.php ├── V2 ├── Billing │ ├── MeterEvent.php │ ├── MeterEventAdjustment.php │ └── MeterEventSession.php ├── Collection.php ├── Event.php └── EventDestination.php ├── Webhook.php ├── WebhookEndpoint.php └── WebhookSignature.php /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore build files 2 | build/* 3 | 4 | # Mac OS X dumps these all over the place. 5 | .DS_Store 6 | 7 | # Ignore the SimpleTest library if it is installed to /test/. 8 | /test/simpletest/ 9 | 10 | # Ignore the /vendor/ directory for people using composer 11 | /vendor/ 12 | 13 | # If the vendor directory isn't being commited the composer.lock file should also be ignored 14 | composer.lock 15 | 16 | # Ignore IDE's configuration files 17 | .idea 18 | 19 | # Ignore PHP CS Fixer local config and cache 20 | .php_cs 21 | .php_cs.cache 22 | .php-cs-fixer.cache 23 | 24 | # Ignore PHPStan local config 25 | .phpstan.neon 26 | 27 | # Ignore phpDocumentor's local config and artifacts 28 | .phpdoc/* 29 | phpdoc.xml 30 | 31 | # Ignore cached PHPUnit results. 32 | .phpunit.result.cache 33 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributing 3 | 4 | We welcome bug reports, feature requests, and code contributions in a pull request. 5 | 6 | For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-php/issues/new/choose). 7 | 8 | ## Contributor License Agreement 9 | 10 | All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant. 11 | 12 | ## Generated code 13 | 14 | This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution. 15 | 16 | To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`. 17 | 18 | ## Compatibility with supported language and runtime versions 19 | 20 | This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward. 21 | 22 | ## Set up your dev environment 23 | 24 | Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment. 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /OPENAPI_VERSION: -------------------------------------------------------------------------------- 1 | v1773 -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 17.3.0 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stripe/stripe-php", 3 | "description": "Stripe PHP Library", 4 | "keywords": [ 5 | "stripe", 6 | "payment processing", 7 | "api" 8 | ], 9 | "homepage": "https://stripe.com/", 10 | "license": "MIT", 11 | "authors": [ 12 | { 13 | "name": "Stripe and contributors", 14 | "homepage": "https://github.com/stripe/stripe-php/contributors" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.6.0", 19 | "ext-curl": "*", 20 | "ext-json": "*", 21 | "ext-mbstring": "*" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "^5.7 || ^9.0", 25 | "friendsofphp/php-cs-fixer": "3.72.0", 26 | "phpstan/phpstan": "^1.2" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Stripe\\": "lib/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "Stripe\\": [ 36 | "tests/", 37 | "tests/Stripe/" 38 | ] 39 | } 40 | }, 41 | "extra": { 42 | "branch-alias": { 43 | "dev-master": "2.0-dev" 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | set quiet 2 | 3 | import? '../sdk-codegen/utils.just' 4 | 5 | # make vendored executables callable directly 6 | export PATH := "vendor/bin:" + env_var('PATH') 7 | 8 | _default: 9 | just --list --unsorted 10 | 11 | # install vendored dependencies 12 | install *args: 13 | composer install {{ if is_dependency() == "true" {"--quiet"} else {""} }} {{ args }} 14 | 15 | # ⭐ run full unit test suite; needs stripe-mock 16 | [no-exit-message] 17 | test *args: install 18 | phpunit {{ args }} 19 | 20 | # run tests in CI; can use autoload mode (or not) 21 | [confirm("This will modify local files and is intended for use in CI; do you want to proceed?")] 22 | ci-test autoload: 23 | ./build.php {{ autoload }} 24 | 25 | # ⭐ format all files 26 | format *args: install 27 | PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix -v --using-cache=no {{ args }} 28 | 29 | # check formatting for, but don't modify, files 30 | format-check: (format "--dry-run") 31 | 32 | # ⭐ statically analyze code 33 | lint *args: 34 | php -d memory_limit=512M vendor/bin/phpstan analyse lib tests {{args}} 35 | 36 | # for backwards compatibility; ideally removed later 37 | [private] 38 | alias phpstan := lint 39 | 40 | # called by tooling 41 | [private] 42 | update-version version: 43 | echo "{{ version }}" > VERSION 44 | perl -pi -e 's|VERSION = '\''[.\-\w\d]+'\''|VERSION = '\''{{ version }}'\''|' lib/Stripe.php 45 | 46 | 47 | PHPDOCUMENTOR_VERSION := "v3.0.0" 48 | # generates docs; currently broken? can unhide if working 49 | [private] 50 | phpdoc: 51 | #!/usr/bin/env bash 52 | set -euo pipefail 53 | 54 | if [ ! -f vendor/bin/phpdoc ]; then 55 | curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/{{ PHPDOCUMENTOR_VERSION }}/phpDocumentor.phar -o vendor/bin/phpdoc 56 | chmod +x vendor/bin/phpdoc 57 | fi 58 | 59 | phpdoc 60 | -------------------------------------------------------------------------------- /lib/AccountLink.php: -------------------------------------------------------------------------------- 1 | Connect Onboarding 12 | * 13 | * @property string $object String representing the object's type. Objects of the same type share the same value. 14 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. 15 | * @property int $expires_at The timestamp at which this account link will expire. 16 | * @property string $url The URL for the account link. 17 | */ 18 | class AccountLink extends ApiResource 19 | { 20 | const OBJECT_NAME = 'account_link'; 21 | 22 | /** 23 | * Creates an AccountLink object that includes a single-use Stripe URL that the 24 | * platform can redirect their user to in order to take them through the Connect 25 | * Onboarding flow. 26 | * 27 | * @param null|array{account: string, collect?: string, collection_options?: array{fields?: string, future_requirements?: string}, expand?: string[], refresh_url?: string, return_url?: string, type: string} $params 28 | * @param null|array|string $options 29 | * 30 | * @return AccountLink the created resource 31 | * 32 | * @throws Exception\ApiErrorException if the request fails 33 | */ 34 | public static function create($params = null, $options = null) 35 | { 36 | self::_validateParams($params); 37 | $url = static::classUrl(); 38 | 39 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); 40 | $obj = Util\Util::convertToStripeObject($response->json, $opts); 41 | $obj->setLastResponse($response); 42 | 43 | return $obj; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/ApiOperations/All.php: -------------------------------------------------------------------------------- 1 | json, $opts); 27 | $obj->setLastResponse($response); 28 | 29 | return $obj; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/ApiOperations/Delete.php: -------------------------------------------------------------------------------- 1 | instanceUrl(); 25 | list($response, $opts) = $this->_request('delete', $url, $params, $opts); 26 | $this->refreshFrom($response, $opts); 27 | 28 | return $this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/ApiOperations/Retrieve.php: -------------------------------------------------------------------------------- 1 | refresh(); 27 | 28 | return $instance; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/ApiOperations/SingletonRetrieve.php: -------------------------------------------------------------------------------- 1 | refresh(); 26 | 27 | return $instance; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/ApiOperations/Update.php: -------------------------------------------------------------------------------- 1 | json, $opts); 29 | $obj->setLastResponse($response); 30 | 31 | return $obj; 32 | } 33 | 34 | /** 35 | * @param null|array|string $opts 36 | * 37 | * @return static the saved resource 38 | * 39 | * @throws \Stripe\Exception\ApiErrorException if the request fails 40 | * 41 | * @deprecated The `save` method is deprecated and will be removed in a 42 | * future major version of the library. Use the static method `update` 43 | * on the resource instead. 44 | */ 45 | public function save($opts = null) 46 | { 47 | $params = $this->serializeParameters(); 48 | if (\count($params) > 0) { 49 | $url = $this->instanceUrl(); 50 | list($response, $opts) = $this->_request('post', $url, $params, $opts, ['save']); 51 | $this->refreshFrom($response, $opts); 52 | } 53 | 54 | return $this; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/ApiResponse.php: -------------------------------------------------------------------------------- 1 | body = $body; 41 | $this->code = $code; 42 | $this->headers = $headers; 43 | $this->json = $json; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Application.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 13 | * @property int $value The value triggering the alert 14 | */ 15 | class AlertTriggered extends \Stripe\ApiResource 16 | { 17 | const OBJECT_NAME = 'billing.alert_triggered'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/Billing/CreditBalanceSummary.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 14 | */ 15 | class CreditBalanceSummary extends \Stripe\SingletonApiResource 16 | { 17 | const OBJECT_NAME = 'billing.credit_balance_summary'; 18 | 19 | /** 20 | * Retrieves the credit balance summary for a customer. 21 | * 22 | * @param null|array|string $opts 23 | * 24 | * @return CreditBalanceSummary 25 | * 26 | * @throws \Stripe\Exception\ApiErrorException if the request fails 27 | */ 28 | public static function retrieve($opts = null) 29 | { 30 | $opts = \Stripe\Util\RequestOptions::parse($opts); 31 | $instance = new static(null, $opts); 32 | $instance->refresh(); 33 | 34 | return $instance; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/Billing/MeterEvent.php: -------------------------------------------------------------------------------- 1 | event_name field on a meter. 13 | * @property string $identifier A unique identifier for the event. 14 | * @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. 15 | * @property \Stripe\StripeObject $payload The payload of the event. This contains the fields corresponding to a meter's customer_mapping.event_payload_key (default is stripe_customer_id) and value_settings.event_payload_key (default is value). Read more about the payload. 16 | * @property int $timestamp The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. 17 | */ 18 | class MeterEvent extends \Stripe\ApiResource 19 | { 20 | const OBJECT_NAME = 'billing.meter_event'; 21 | 22 | /** 23 | * Creates a billing meter event. 24 | * 25 | * @param null|array{event_name: string, expand?: string[], identifier?: string, payload: array, timestamp?: int} $params 26 | * @param null|array|string $options 27 | * 28 | * @return MeterEvent the created resource 29 | * 30 | * @throws \Stripe\Exception\ApiErrorException if the request fails 31 | */ 32 | public static function create($params = null, $options = null) 33 | { 34 | self::_validateParams($params); 35 | $url = static::classUrl(); 36 | 37 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); 38 | $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); 39 | $obj->setLastResponse($response); 40 | 41 | return $obj; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Billing/MeterEventAdjustment.php: -------------------------------------------------------------------------------- 1 | event_name field on a meter. 13 | * @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. 14 | * @property string $status The meter event adjustment's status. 15 | * @property string $type Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. 16 | */ 17 | class MeterEventAdjustment extends \Stripe\ApiResource 18 | { 19 | const OBJECT_NAME = 'billing.meter_event_adjustment'; 20 | 21 | const STATUS_COMPLETE = 'complete'; 22 | const STATUS_PENDING = 'pending'; 23 | 24 | /** 25 | * Creates a billing meter event adjustment. 26 | * 27 | * @param null|array{cancel?: array{identifier?: string}, event_name: string, expand?: string[], type: string} $params 28 | * @param null|array|string $options 29 | * 30 | * @return MeterEventAdjustment the created resource 31 | * 32 | * @throws \Stripe\Exception\ApiErrorException if the request fails 33 | */ 34 | public static function create($params = null, $options = null) 35 | { 36 | self::_validateParams($params); 37 | $url = static::classUrl(); 38 | 39 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); 40 | $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); 41 | $obj->setLastResponse($response); 42 | 43 | return $obj; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Billing/MeterEventSummary.php: -------------------------------------------------------------------------------- 1 | start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via default_aggregation. 16 | * @property int $end_time End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. 17 | * @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. 18 | * @property string $meter The meter associated with this event summary. 19 | * @property int $start_time Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. 20 | */ 21 | class MeterEventSummary extends \Stripe\ApiResource 22 | { 23 | const OBJECT_NAME = 'billing.meter_event_summary'; 24 | } 25 | -------------------------------------------------------------------------------- /lib/Climate/Supplier.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 14 | * @property ((object{city: null|string, country: string, latitude: null|float, longitude: null|float, region: null|string}&\Stripe\StripeObject))[] $locations The locations in which this supplier operates. 15 | * @property string $name Name of this carbon removal supplier. 16 | * @property string $removal_pathway The scientific pathway used for carbon removal. 17 | */ 18 | class Supplier extends \Stripe\ApiResource 19 | { 20 | const OBJECT_NAME = 'climate.supplier'; 21 | 22 | const REMOVAL_PATHWAY_BIOMASS_CARBON_REMOVAL_AND_STORAGE = 'biomass_carbon_removal_and_storage'; 23 | const REMOVAL_PATHWAY_DIRECT_AIR_CAPTURE = 'direct_air_capture'; 24 | const REMOVAL_PATHWAY_ENHANCED_WEATHERING = 'enhanced_weathering'; 25 | 26 | /** 27 | * Lists all available Climate supplier objects. 28 | * 29 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params 30 | * @param null|array|string $opts 31 | * 32 | * @return \Stripe\Collection of ApiResources 33 | * 34 | * @throws \Stripe\Exception\ApiErrorException if the request fails 35 | */ 36 | public static function all($params = null, $opts = null) 37 | { 38 | $url = static::classUrl(); 39 | 40 | return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); 41 | } 42 | 43 | /** 44 | * Retrieves a Climate supplier object. 45 | * 46 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key 47 | * @param null|array|string $opts 48 | * 49 | * @return Supplier 50 | * 51 | * @throws \Stripe\Exception\ApiErrorException if the request fails 52 | */ 53 | public static function retrieve($id, $opts = null) 54 | { 55 | $opts = \Stripe\Util\RequestOptions::parse($opts); 56 | $instance = new static($id, $opts); 57 | $instance->refresh(); 58 | 59 | return $instance; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/ConnectCollectionTransfer.php: -------------------------------------------------------------------------------- 1 | ISO currency code, in lowercase. Must be a supported currency. 12 | * @property Account|string $destination ID of the account that funds are being collected for. 13 | * @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. 14 | */ 15 | class ConnectCollectionTransfer extends ApiResource 16 | { 17 | const OBJECT_NAME = 'connect_collection_transfer'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/CreditNoteLineItem.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 18 | * @property ((object{amount: int, credit_balance_transaction?: Billing\CreditBalanceTransaction|string, discount?: Discount|string, type: string}&StripeObject))[] $pretax_credit_amounts The pretax credit amounts (ex: discount, credit grants, etc) for this line item. 19 | * @property null|int $quantity The number of units of product being credited. 20 | * @property TaxRate[] $tax_rates The tax rates which apply to the line item. 21 | * @property null|((object{amount: int, tax_behavior: string, tax_rate_details: null|(object{tax_rate: string}&StripeObject), taxability_reason: string, taxable_amount: null|int, type: string}&StripeObject))[] $taxes The tax information of the line item. 22 | * @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. 23 | * @property null|int $unit_amount The cost of each unit of product being credited. 24 | * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. 25 | */ 26 | class CreditNoteLineItem extends ApiResource 27 | { 28 | const OBJECT_NAME = 'credit_note_line_item'; 29 | } 30 | -------------------------------------------------------------------------------- /lib/Entitlements/ActiveEntitlement.php: -------------------------------------------------------------------------------- 1 | Feature that the customer is entitled to. 13 | * @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. 14 | * @property string $lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters. 15 | */ 16 | class ActiveEntitlement extends \Stripe\ApiResource 17 | { 18 | const OBJECT_NAME = 'entitlements.active_entitlement'; 19 | 20 | /** 21 | * Retrieve a list of active entitlements for a customer. 22 | * 23 | * @param null|array{customer: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params 24 | * @param null|array|string $opts 25 | * 26 | * @return \Stripe\Collection of ApiResources 27 | * 28 | * @throws \Stripe\Exception\ApiErrorException if the request fails 29 | */ 30 | public static function all($params = null, $opts = null) 31 | { 32 | $url = static::classUrl(); 33 | 34 | return static::_requestPage($url, \Stripe\Collection::class, $params, $opts); 35 | } 36 | 37 | /** 38 | * Retrieve an active entitlement. 39 | * 40 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key 41 | * @param null|array|string $opts 42 | * 43 | * @return ActiveEntitlement 44 | * 45 | * @throws \Stripe\Exception\ApiErrorException if the request fails 46 | */ 47 | public static function retrieve($id, $opts = null) 48 | { 49 | $opts = \Stripe\Util\RequestOptions::parse($opts); 50 | $instance = new static($id, $opts); 51 | $instance->refresh(); 52 | 53 | return $instance; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/Entitlements/ActiveEntitlementSummary.php: -------------------------------------------------------------------------------- 1 | $entitlements The list of entitlements this customer has. 13 | * @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. 14 | */ 15 | class ActiveEntitlementSummary extends \Stripe\ApiResource 16 | { 17 | const OBJECT_NAME = 'entitlements.active_entitlement_summary'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/EphemeralKey.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 13 | * @property null|string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. 14 | */ 15 | class EphemeralKey extends ApiResource 16 | { 17 | const OBJECT_NAME = 'ephemeral_key'; 18 | 19 | /** 20 | * Invalidates a short-lived API key for a given resource. 21 | * 22 | * @param null|array{expand?: string[]} $params 23 | * @param null|array|string $opts 24 | * 25 | * @return EphemeralKey the deleted resource 26 | * 27 | * @throws Exception\ApiErrorException if the request fails 28 | */ 29 | public function delete($params = null, $opts = null) 30 | { 31 | self::_validateParams($params); 32 | 33 | $url = $this->instanceUrl(); 34 | list($response, $opts) = $this->_request('delete', $url, $params, $opts); 35 | $this->refreshFrom($response, $opts); 36 | 37 | return $this; 38 | } 39 | 40 | use ApiOperations\Create { 41 | create as protected _create; 42 | } 43 | 44 | /** 45 | * @param null|array $params 46 | * @param null|array|string $opts 47 | * 48 | * @return EphemeralKey the created key 49 | * 50 | * @throws Exception\InvalidArgumentException if stripe_version is missing 51 | * @throws Exception\ApiErrorException if the request fails 52 | */ 53 | public static function create($params = null, $opts = null) 54 | { 55 | if (!$opts || !isset($opts['stripe_version'])) { 56 | throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); 57 | } 58 | 59 | return self::_create($params, $opts); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/EventData/V1BillingMeterErrorReportTriggeredEventData.php: -------------------------------------------------------------------------------- 1 | data when fetched from /v2/events. 9 | * @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens. 10 | * @property int $validation_end The end of the window that is encapsulated by this summary. 11 | * @property int $validation_start The start of the window that is encapsulated by this summary. 12 | */ 13 | class V1BillingMeterErrorReportTriggeredEventData extends \Stripe\StripeObject {} 14 | -------------------------------------------------------------------------------- /lib/EventData/V1BillingMeterNoMeterFoundEventData.php: -------------------------------------------------------------------------------- 1 | data when fetched from /v2/events. 9 | * @property (object{error_count: int, error_types: (object{code: string, error_count: int, sample_errors: (object{error_message: string, request: (object{identifier: string}&\Stripe\StripeObject)}&\Stripe\StripeObject)[]}&\Stripe\StripeObject)[]}&\Stripe\StripeObject) $reason This contains information about why meter error happens. 10 | * @property int $validation_end The end of the window that is encapsulated by this summary. 11 | * @property int $validation_start The start of the window that is encapsulated by this summary. 12 | */ 13 | class V1BillingMeterNoMeterFoundEventData extends \Stripe\StripeObject {} 14 | -------------------------------------------------------------------------------- /lib/Events/V1BillingMeterErrorReportTriggeredEvent.php: -------------------------------------------------------------------------------- 1 | related_object->url); 25 | list($object, $options) = $this->_request( 26 | 'get', 27 | $this->related_object->url, 28 | [], 29 | ['stripe_account' => $this->context], 30 | [], 31 | $apiMode 32 | ); 33 | 34 | return \Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode); 35 | } 36 | 37 | public static function constructFrom($values, $opts = null, $apiMode = 'v2') 38 | { 39 | $evt = parent::constructFrom($values, $opts, $apiMode); 40 | if (null !== $evt->data) { 41 | $evt->data = \Stripe\EventData\V1BillingMeterErrorReportTriggeredEventData::constructFrom($evt->data, $opts, $apiMode); 42 | } 43 | 44 | return $evt; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Events/V1BillingMeterNoMeterFoundEvent.php: -------------------------------------------------------------------------------- 1 | data) { 18 | $evt->data = \Stripe\EventData\V1BillingMeterNoMeterFoundEventData::constructFrom($evt->data, $opts, $apiMode); 19 | } 20 | 21 | return $evt; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/Events/V2CoreEventDestinationPingEvent.php: -------------------------------------------------------------------------------- 1 | related_object->url); 24 | list($object, $options) = $this->_request( 25 | 'get', 26 | $this->related_object->url, 27 | [], 28 | ['stripe_account' => $this->context], 29 | [], 30 | $apiMode 31 | ); 32 | 33 | return \Stripe\Util\Util::convertToStripeObject($object, $options, $apiMode); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/Exception/ApiConnectionException.php: -------------------------------------------------------------------------------- 1 | setDeclineCode($declineCode); 40 | $instance->setStripeParam($stripeParam); 41 | 42 | return $instance; 43 | } 44 | 45 | /** 46 | * Gets the decline code. 47 | * 48 | * @return null|string 49 | */ 50 | public function getDeclineCode() 51 | { 52 | return $this->declineCode; 53 | } 54 | 55 | /** 56 | * Sets the decline code. 57 | * 58 | * @param null|string $declineCode 59 | */ 60 | public function setDeclineCode($declineCode) 61 | { 62 | $this->declineCode = $declineCode; 63 | } 64 | 65 | /** 66 | * Gets the parameter related to the error. 67 | * 68 | * @return null|string 69 | */ 70 | public function getStripeParam() 71 | { 72 | return $this->stripeParam; 73 | } 74 | 75 | /** 76 | * Sets the parameter related to the error. 77 | * 78 | * @param null|string $stripeParam 79 | */ 80 | public function setStripeParam($stripeParam) 81 | { 82 | $this->stripeParam = $stripeParam; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | setStripeParam($stripeParam); 37 | 38 | return $instance; 39 | } 40 | 41 | /** 42 | * Gets the parameter related to the error. 43 | * 44 | * @return null|string 45 | */ 46 | public function getStripeParam() 47 | { 48 | return $this->stripeParam; 49 | } 50 | 51 | /** 52 | * Sets the parameter related to the error. 53 | * 54 | * @param null|string $stripeParam 55 | */ 56 | public function setStripeParam($stripeParam) 57 | { 58 | $this->stripeParam = $stripeParam; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/Exception/OAuth/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | jsonBody) { 14 | return null; 15 | } 16 | 17 | return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/Exception/OAuth/UnknownOAuthErrorException.php: -------------------------------------------------------------------------------- 1 | setHttpBody($httpBody); 30 | $instance->setSigHeader($sigHeader); 31 | 32 | return $instance; 33 | } 34 | 35 | /** 36 | * Gets the HTTP body as a string. 37 | * 38 | * @return null|string 39 | */ 40 | public function getHttpBody() 41 | { 42 | return $this->httpBody; 43 | } 44 | 45 | /** 46 | * Sets the HTTP body as a string. 47 | * 48 | * @param null|string $httpBody 49 | */ 50 | public function setHttpBody($httpBody) 51 | { 52 | $this->httpBody = $httpBody; 53 | } 54 | 55 | /** 56 | * Gets the `Stripe-Signature` HTTP header. 57 | * 58 | * @return null|string 59 | */ 60 | public function getSigHeader() 61 | { 62 | return $this->sigHeader; 63 | } 64 | 65 | /** 66 | * Sets the `Stripe-Signature` HTTP header. 67 | * 68 | * @param null|string $sigHeader 69 | */ 70 | public function setSigHeader($sigHeader) 71 | { 72 | $this->sigHeader = $sigHeader; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/Exception/TemporarySessionExpiredException.php: -------------------------------------------------------------------------------- 1 | $owners A paginated list of owners for this account. 14 | */ 15 | class AccountOwnership extends \Stripe\ApiResource 16 | { 17 | const OBJECT_NAME = 'financial_connections.account_ownership'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/HttpClient/ClientInterface.php: -------------------------------------------------------------------------------- 1 | ISO currency code, in lowercase. Must be a supported currency. 17 | * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. 18 | * @property null|(object{amount: int, discount: Discount}&StripeObject)[] $discounts The discounts applied to the line item. 19 | * @property null|Price $price The price used to generate the line item. 20 | * @property null|int $quantity The quantity of products being purchased. 21 | * @property null|((object{amount: int, rate: TaxRate, taxability_reason: null|string, taxable_amount: null|int}&StripeObject))[] $taxes The taxes applied to the line item. 22 | */ 23 | class LineItem extends ApiResource 24 | { 25 | const OBJECT_NAME = 'item'; 26 | } 27 | -------------------------------------------------------------------------------- /lib/LoginLink.php: -------------------------------------------------------------------------------- 1 | Account Link in that it takes the user directly to their Express dashboard for the specified account. 10 | * 11 | * @property string $object String representing the object's type. Objects of the same type share the same value. 12 | * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. 13 | * @property string $url The URL for the login link. 14 | */ 15 | class LoginLink extends ApiResource 16 | { 17 | const OBJECT_NAME = 'login_link'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/OAuthErrorObject.php: -------------------------------------------------------------------------------- 1 | null, 28 | 'error_description' => null, 29 | ], $values); 30 | parent::refreshFrom($values, $opts, $partial); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ProductFeature.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 15 | */ 16 | class ProductFeature extends ApiResource 17 | { 18 | const OBJECT_NAME = 'product_feature'; 19 | } 20 | -------------------------------------------------------------------------------- /lib/Reason.php: -------------------------------------------------------------------------------- 1 | requestId = $requestId; 29 | $this->requestDuration = $requestDuration; 30 | $this->usage = $usage; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ReserveTransaction.php: -------------------------------------------------------------------------------- 1 | ISO currency code, in lowercase. Must be a supported currency. 12 | * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. 13 | */ 14 | class ReserveTransaction extends ApiResource 15 | { 16 | const OBJECT_NAME = 'reserve_transaction'; 17 | } 18 | -------------------------------------------------------------------------------- /lib/Service/AbstractServiceFactory.php: -------------------------------------------------------------------------------- 1 | client = $client; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/Service/AccountLinkService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/account_links', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/ApplePayDomainService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/apple_pay/domains', $params, $opts); 27 | } 28 | 29 | /** 30 | * Create an apple pay domain. 31 | * 32 | * @param null|array{domain_name: string, expand?: string[]} $params 33 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 34 | * 35 | * @return \Stripe\ApplePayDomain 36 | * 37 | * @throws \Stripe\Exception\ApiErrorException if the request fails 38 | */ 39 | public function create($params = null, $opts = null) 40 | { 41 | return $this->request('post', '/v1/apple_pay/domains', $params, $opts); 42 | } 43 | 44 | /** 45 | * Delete an apple pay domain. 46 | * 47 | * @param string $id 48 | * @param null|array $params 49 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 50 | * 51 | * @return \Stripe\ApplePayDomain 52 | * 53 | * @throws \Stripe\Exception\ApiErrorException if the request fails 54 | */ 55 | public function delete($id, $params = null, $opts = null) 56 | { 57 | return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); 58 | } 59 | 60 | /** 61 | * Retrieve an apple pay domain. 62 | * 63 | * @param string $id 64 | * @param null|array{expand?: string[]} $params 65 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 66 | * 67 | * @return \Stripe\ApplePayDomain 68 | * 69 | * @throws \Stripe\Exception\ApiErrorException if the request fails 70 | */ 71 | public function retrieve($id, $params = null, $opts = null) 72 | { 73 | return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/Service/Apps/AppsServiceFactory.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private static $classMap = [ 18 | 'secrets' => SecretService::class, 19 | ]; 20 | 21 | protected function getServiceClass($name) 22 | { 23 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Service/BalanceService.php: -------------------------------------------------------------------------------- 1 | Accounting 18 | * for negative balances. 19 | * 20 | * @param null|array{expand?: string[]} $params 21 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 22 | * 23 | * @return \Stripe\Balance 24 | * 25 | * @throws \Stripe\Exception\ApiErrorException if the request fails 26 | */ 27 | public function retrieve($params = null, $opts = null) 28 | { 29 | return $this->request('get', '/v1/balance', $params, $opts); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/Service/BalanceTransactionService.php: -------------------------------------------------------------------------------- 1 | /v1/balance/history. 21 | * 22 | * @param null|array{created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, payout?: string, source?: string, starting_after?: string, type?: string} $params 23 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 24 | * 25 | * @return \Stripe\Collection<\Stripe\BalanceTransaction> 26 | * 27 | * @throws \Stripe\Exception\ApiErrorException if the request fails 28 | */ 29 | public function all($params = null, $opts = null) 30 | { 31 | return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); 32 | } 33 | 34 | /** 35 | * Retrieves the balance transaction with the given ID. 36 | * 37 | * Note that this endpoint previously used the path 38 | * /v1/balance/history/:id. 39 | * 40 | * @param string $id 41 | * @param null|array{expand?: string[]} $params 42 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 43 | * 44 | * @return \Stripe\BalanceTransaction 45 | * 46 | * @throws \Stripe\Exception\ApiErrorException if the request fails 47 | */ 48 | public function retrieve($id, $params = null, $opts = null) 49 | { 50 | return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/Service/Billing/BillingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | private static $classMap = [ 24 | 'alerts' => AlertService::class, 25 | 'creditBalanceSummary' => CreditBalanceSummaryService::class, 26 | 'creditBalanceTransactions' => CreditBalanceTransactionService::class, 27 | 'creditGrants' => CreditGrantService::class, 28 | 'meterEventAdjustments' => MeterEventAdjustmentService::class, 29 | 'meterEvents' => MeterEventService::class, 30 | 'meters' => MeterService::class, 31 | ]; 32 | 33 | protected function getServiceClass($name) 34 | { 35 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/Service/Billing/CreditBalanceSummaryService.php: -------------------------------------------------------------------------------- 1 | request('get', '/v1/billing/credit_balance_summary', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/Billing/CreditBalanceTransactionService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/billing/credit_balance_transactions', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves a credit balance transaction. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Billing\CreditBalanceTransaction 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/billing/credit_balance_transactions/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Billing/MeterEventAdjustmentService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/billing/meter_event_adjustments', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/Billing/MeterEventService.php: -------------------------------------------------------------------------------- 1 | , timestamp?: int} $params 18 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 19 | * 20 | * @return \Stripe\Billing\MeterEvent 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function create($params = null, $opts = null) 25 | { 26 | return $this->request('post', '/v1/billing/meter_events', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/BillingPortal/BillingPortalServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | 'configurations' => ConfigurationService::class, 20 | 'sessions' => SessionService::class, 21 | ]; 22 | 23 | protected function getServiceClass($name) 24 | { 25 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/Service/BillingPortal/SessionService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/billing_portal/sessions', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/Checkout/CheckoutServiceFactory.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private static $classMap = [ 18 | 'sessions' => SessionService::class, 19 | ]; 20 | 21 | protected function getServiceClass($name) 22 | { 23 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Service/Climate/ClimateServiceFactory.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | private static $classMap = [ 20 | 'orders' => OrderService::class, 21 | 'products' => ProductService::class, 22 | 'suppliers' => SupplierService::class, 23 | ]; 24 | 25 | protected function getServiceClass($name) 26 | { 27 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/Climate/ProductService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/climate/products', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of a Climate product with the given ID. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Climate\Product 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/climate/products/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Climate/SupplierService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/climate/suppliers', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves a Climate supplier object. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Climate\Supplier 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/climate/suppliers/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/ConfirmationTokenService.php: -------------------------------------------------------------------------------- 1 | request('get', $this->buildPath('/v1/confirmation_tokens/%s', $id), $params, $opts); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/CountrySpecService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/country_specs', $params, $opts); 27 | } 28 | 29 | /** 30 | * Returns a Country Spec for a given Country code. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\CountrySpec 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/CustomerSessionService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/customer_sessions', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/Entitlements/ActiveEntitlementService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/entitlements/active_entitlements', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieve an active entitlement. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Entitlements\ActiveEntitlement 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/entitlements/active_entitlements/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Entitlements/EntitlementsServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | 'activeEntitlements' => ActiveEntitlementService::class, 20 | 'features' => FeatureService::class, 21 | ]; 22 | 23 | protected function getServiceClass($name) 24 | { 25 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/Service/EphemeralKeyService.php: -------------------------------------------------------------------------------- 1 | request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); 28 | } 29 | 30 | /** 31 | * Creates a short-lived API key for a given resource. 32 | * 33 | * @param null|array $params 34 | * @param null|array|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\EphemeralKey 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function create($params = null, $opts = null) 41 | { 42 | if (!$opts || !isset($opts['stripe_version'])) { 43 | throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); 44 | } 45 | 46 | return $this->request('post', '/v1/ephemeral_keys', $params, $opts); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/Service/EventService.php: -------------------------------------------------------------------------------- 1 | event object 18 | * api_version attribute (not according to your current Stripe API 19 | * version or Stripe-Version header). 20 | * 21 | * @param null|array{created?: array|int, delivery_success?: bool, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string, types?: string[]} $params 22 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 23 | * 24 | * @return \Stripe\Collection<\Stripe\Event> 25 | * 26 | * @throws \Stripe\Exception\ApiErrorException if the request fails 27 | */ 28 | public function all($params = null, $opts = null) 29 | { 30 | return $this->requestCollection('get', '/v1/events', $params, $opts); 31 | } 32 | 33 | /** 34 | * Retrieves the details of an event if it was created in the last 30 days. Supply 35 | * the unique identifier of the event, which you might have received in a webhook. 36 | * 37 | * @param string $id 38 | * @param null|array{expand?: string[]} $params 39 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 40 | * 41 | * @return \Stripe\Event 42 | * 43 | * @throws \Stripe\Exception\ApiErrorException if the request fails 44 | */ 45 | public function retrieve($id, $params = null, $opts = null) 46 | { 47 | return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/Service/ExchangeRateService.php: -------------------------------------------------------------------------------- 1 | 22 | * 23 | * @throws \Stripe\Exception\ApiErrorException if the request fails 24 | */ 25 | public function all($params = null, $opts = null) 26 | { 27 | return $this->requestCollection('get', '/v1/exchange_rates', $params, $opts); 28 | } 29 | 30 | /** 31 | * Retrieves the exchange rates from the given currency to every supported 32 | * currency. 33 | * 34 | * @param string $id 35 | * @param null|array{expand?: string[]} $params 36 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 37 | * 38 | * @return \Stripe\ExchangeRate 39 | * 40 | * @throws \Stripe\Exception\ApiErrorException if the request fails 41 | */ 42 | public function retrieve($id, $params = null, $opts = null) 43 | { 44 | return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Service/FileService.php: -------------------------------------------------------------------------------- 1 | 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function all($params = null, $opts = null) 27 | { 28 | return $this->requestCollection('get', '/v1/files', $params, $opts); 29 | } 30 | 31 | /** 32 | * Retrieves the details of an existing file object. After you supply a unique file 33 | * ID, Stripe returns the corresponding file object. Learn how to access file contents. 35 | * 36 | * @param string $id 37 | * @param null|array{expand?: string[]} $params 38 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 39 | * 40 | * @return \Stripe\File 41 | * 42 | * @throws \Stripe\Exception\ApiErrorException if the request fails 43 | */ 44 | public function retrieve($id, $params = null, $opts = null) 45 | { 46 | return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); 47 | } 48 | 49 | /** 50 | * Create a file. 51 | * 52 | * @param null|array $params 53 | * @param null|array|\Stripe\Util\RequestOptions $opts 54 | * 55 | * @return \Stripe\File 56 | */ 57 | public function create($params = null, $opts = null) 58 | { 59 | $opts = \Stripe\Util\RequestOptions::parse($opts); 60 | if (!isset($opts->apiBase)) { 61 | $opts->apiBase = $this->getClient()->getFilesBase(); 62 | } 63 | 64 | // Manually flatten params, otherwise curl's multipart encoder will 65 | // choke on nested null|arrays. 66 | $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); 67 | 68 | return $this->request('post', '/v1/files', $flatParams, $opts); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | private static $classMap = [ 20 | 'accounts' => AccountService::class, 21 | 'sessions' => SessionService::class, 22 | 'transactions' => TransactionService::class, 23 | ]; 24 | 25 | protected function getServiceClass($name) 26 | { 27 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/FinancialConnections/SessionService.php: -------------------------------------------------------------------------------- 1 | Session. The session’s client_secret can be used to 17 | * launch the flow using Stripe.js. 18 | * 19 | * @param null|array{account_holder: array{account?: string, customer?: string, type: string}, expand?: string[], filters?: array{account_subcategories?: string[], countries?: string[]}, permissions: string[], prefetch?: string[], return_url?: string} $params 20 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 21 | * 22 | * @return \Stripe\FinancialConnections\Session 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function create($params = null, $opts = null) 27 | { 28 | return $this->request('post', '/v1/financial_connections/sessions', $params, $opts); 29 | } 30 | 31 | /** 32 | * Retrieves the details of a Financial Connections Session. 33 | * 34 | * @param string $id 35 | * @param null|array{expand?: string[]} $params 36 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 37 | * 38 | * @return \Stripe\FinancialConnections\Session 39 | * 40 | * @throws \Stripe\Exception\ApiErrorException if the request fails 41 | */ 42 | public function retrieve($id, $params = null, $opts = null) 43 | { 44 | return $this->request('get', $this->buildPath('/v1/financial_connections/sessions/%s', $id), $params, $opts); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Service/FinancialConnections/TransactionService.php: -------------------------------------------------------------------------------- 1 | Transaction objects. 16 | * 17 | * @param null|array{account: string, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, transacted_at?: array|int, transaction_refresh?: array{after: string}} $params 18 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 19 | * 20 | * @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction> 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/financial_connections/transactions', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of a Financial Connections Transaction. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\FinancialConnections\Transaction 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/financial_connections/transactions/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Forwarding/ForwardingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private static $classMap = [ 18 | 'requests' => RequestService::class, 19 | ]; 20 | 21 | protected function getServiceClass($name) 22 | { 23 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Service/Forwarding/RequestService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/forwarding/requests', $params, $opts); 27 | } 28 | 29 | /** 30 | * Creates a ForwardingRequest object. 31 | * 32 | * @param null|array{expand?: string[], metadata?: array, payment_method: string, replacements: string[], request: array{body?: string, headers?: array{name: string, value: string}[]}, url: string} $params 33 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 34 | * 35 | * @return \Stripe\Forwarding\Request 36 | * 37 | * @throws \Stripe\Exception\ApiErrorException if the request fails 38 | */ 39 | public function create($params = null, $opts = null) 40 | { 41 | return $this->request('post', '/v1/forwarding/requests', $params, $opts); 42 | } 43 | 44 | /** 45 | * Retrieves a ForwardingRequest object. 46 | * 47 | * @param string $id 48 | * @param null|array{expand?: string[]} $params 49 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 50 | * 51 | * @return \Stripe\Forwarding\Request 52 | * 53 | * @throws \Stripe\Exception\ApiErrorException if the request fails 54 | */ 55 | public function retrieve($id, $params = null, $opts = null) 56 | { 57 | return $this->request('get', $this->buildPath('/v1/forwarding/requests/%s', $id), $params, $opts); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/Service/Identity/IdentityServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | 'verificationReports' => VerificationReportService::class, 20 | 'verificationSessions' => VerificationSessionService::class, 21 | ]; 22 | 23 | protected function getServiceClass($name) 24 | { 25 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/Service/Identity/VerificationReportService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/identity/verification_reports', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves an existing VerificationReport. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Identity\VerificationReport 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/InvoicePaymentService.php: -------------------------------------------------------------------------------- 1 | 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function all($params = null, $opts = null) 27 | { 28 | return $this->requestCollection('get', '/v1/invoice_payments', $params, $opts); 29 | } 30 | 31 | /** 32 | * Retrieves the invoice payment with the given ID. 33 | * 34 | * @param string $id 35 | * @param null|array{expand?: string[]} $params 36 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 37 | * 38 | * @return \Stripe\InvoicePayment 39 | * 40 | * @throws \Stripe\Exception\ApiErrorException if the request fails 41 | */ 42 | public function retrieve($id, $params = null, $opts = null) 43 | { 44 | return $this->request('get', $this->buildPath('/v1/invoice_payments/%s', $id), $params, $opts); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Service/Issuing/IssuingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | private static $classMap = [ 25 | 'authorizations' => AuthorizationService::class, 26 | 'cardholders' => CardholderService::class, 27 | 'cards' => CardService::class, 28 | 'disputes' => DisputeService::class, 29 | 'personalizationDesigns' => PersonalizationDesignService::class, 30 | 'physicalBundles' => PhysicalBundleService::class, 31 | 'tokens' => TokenService::class, 32 | 'transactions' => TransactionService::class, 33 | ]; 34 | 35 | protected function getServiceClass($name) 36 | { 37 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/Service/Issuing/PhysicalBundleService.php: -------------------------------------------------------------------------------- 1 | 22 | * 23 | * @throws \Stripe\Exception\ApiErrorException if the request fails 24 | */ 25 | public function all($params = null, $opts = null) 26 | { 27 | return $this->requestCollection('get', '/v1/issuing/physical_bundles', $params, $opts); 28 | } 29 | 30 | /** 31 | * Retrieves a physical bundle object. 32 | * 33 | * @param string $id 34 | * @param null|array{expand?: string[]} $params 35 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 36 | * 37 | * @return \Stripe\Issuing\PhysicalBundle 38 | * 39 | * @throws \Stripe\Exception\ApiErrorException if the request fails 40 | */ 41 | public function retrieve($id, $params = null, $opts = null) 42 | { 43 | return $this->request('get', $this->buildPath('/v1/issuing/physical_bundles/%s', $id), $params, $opts); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Service/Issuing/TokenService.php: -------------------------------------------------------------------------------- 1 | Token objects for a given card. 16 | * 17 | * @param null|array{card: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, status?: string} $params 18 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 19 | * 20 | * @return \Stripe\Collection<\Stripe\Issuing\Token> 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/issuing/tokens', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves an Issuing Token object. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Issuing\Token 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); 43 | } 44 | 45 | /** 46 | * Attempts to update the specified Issuing Token object to the status 47 | * specified. 48 | * 49 | * @param string $id 50 | * @param null|array{expand?: string[], status: string} $params 51 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 52 | * 53 | * @return \Stripe\Issuing\Token 54 | * 55 | * @throws \Stripe\Exception\ApiErrorException if the request fails 56 | */ 57 | public function update($id, $params = null, $opts = null) 58 | { 59 | return $this->request('post', $this->buildPath('/v1/issuing/tokens/%s', $id), $params, $opts); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/Service/Issuing/TransactionService.php: -------------------------------------------------------------------------------- 1 | Transaction objects. The objects are 16 | * sorted in descending order by creation date, with the most recently created 17 | * object appearing first. 18 | * 19 | * @param null|array{card?: string, cardholder?: string, created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string, type?: string} $params 20 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 21 | * 22 | * @return \Stripe\Collection<\Stripe\Issuing\Transaction> 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function all($params = null, $opts = null) 27 | { 28 | return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); 29 | } 30 | 31 | /** 32 | * Retrieves an Issuing Transaction object. 33 | * 34 | * @param string $id 35 | * @param null|array{expand?: string[]} $params 36 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 37 | * 38 | * @return \Stripe\Issuing\Transaction 39 | * 40 | * @throws \Stripe\Exception\ApiErrorException if the request fails 41 | */ 42 | public function retrieve($id, $params = null, $opts = null) 43 | { 44 | return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); 45 | } 46 | 47 | /** 48 | * Updates the specified Issuing Transaction object by setting the 49 | * values of the parameters passed. Any parameters not provided will be left 50 | * unchanged. 51 | * 52 | * @param string $id 53 | * @param null|array{expand?: string[], metadata?: null|array} $params 54 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 55 | * 56 | * @return \Stripe\Issuing\Transaction 57 | * 58 | * @throws \Stripe\Exception\ApiErrorException if the request fails 59 | */ 60 | public function update($id, $params = null, $opts = null) 61 | { 62 | return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/Service/MandateService.php: -------------------------------------------------------------------------------- 1 | request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/Radar/EarlyFraudWarningService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an early fraud warning that has previously been 31 | * created. 32 | * 33 | * Please refer to the early fraud 34 | * warning object reference for more details. 35 | * 36 | * @param string $id 37 | * @param null|array{expand?: string[]} $params 38 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 39 | * 40 | * @return \Stripe\Radar\EarlyFraudWarning 41 | * 42 | * @throws \Stripe\Exception\ApiErrorException if the request fails 43 | */ 44 | public function retrieve($id, $params = null, $opts = null) 45 | { 46 | return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/Service/Radar/RadarServiceFactory.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | private static $classMap = [ 20 | 'earlyFraudWarnings' => EarlyFraudWarningService::class, 21 | 'valueListItems' => ValueListItemService::class, 22 | 'valueLists' => ValueListService::class, 23 | ]; 24 | 25 | protected function getServiceClass($name) 26 | { 27 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/Reporting/ReportRunService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/reporting/report_runs', $params, $opts); 27 | } 28 | 29 | /** 30 | * Creates a new object and begin running the report. (Certain report types require 31 | * a live-mode API key.). 32 | * 33 | * @param null|array{expand?: string[], parameters?: array{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}, report_type: string} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Reporting\ReportRun 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function create($params = null, $opts = null) 41 | { 42 | return $this->request('post', '/v1/reporting/report_runs', $params, $opts); 43 | } 44 | 45 | /** 46 | * Retrieves the details of an existing Report Run. 47 | * 48 | * @param string $id 49 | * @param null|array{expand?: string[]} $params 50 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 51 | * 52 | * @return \Stripe\Reporting\ReportRun 53 | * 54 | * @throws \Stripe\Exception\ApiErrorException if the request fails 55 | */ 56 | public function retrieve($id, $params = null, $opts = null) 57 | { 58 | return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/Service/Reporting/ReportTypeService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/reporting/report_types', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of a Report Type. (Certain report types require a live-mode API key.). 32 | * 33 | * @param string $id 34 | * @param null|array{expand?: string[]} $params 35 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 36 | * 37 | * @return \Stripe\Reporting\ReportType 38 | * 39 | * @throws \Stripe\Exception\ApiErrorException if the request fails 40 | */ 41 | public function retrieve($id, $params = null, $opts = null) 42 | { 43 | return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Service/Reporting/ReportingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | 'reportRuns' => ReportRunService::class, 20 | 'reportTypes' => ReportTypeService::class, 21 | ]; 22 | 23 | protected function getServiceClass($name) 24 | { 25 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/Service/ReviewService.php: -------------------------------------------------------------------------------- 1 | Review objects that have open set to 16 | * true. The objects are sorted in descending order by creation date, 17 | * with the most recently created object appearing first. 18 | * 19 | * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params 20 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 21 | * 22 | * @return \Stripe\Collection<\Stripe\Review> 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function all($params = null, $opts = null) 27 | { 28 | return $this->requestCollection('get', '/v1/reviews', $params, $opts); 29 | } 30 | 31 | /** 32 | * Approves a Review object, closing it and removing it from the list 33 | * of reviews. 34 | * 35 | * @param string $id 36 | * @param null|array{expand?: string[]} $params 37 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 38 | * 39 | * @return \Stripe\Review 40 | * 41 | * @throws \Stripe\Exception\ApiErrorException if the request fails 42 | */ 43 | public function approve($id, $params = null, $opts = null) 44 | { 45 | return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); 46 | } 47 | 48 | /** 49 | * Retrieves a Review object. 50 | * 51 | * @param string $id 52 | * @param null|array{expand?: string[]} $params 53 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 54 | * 55 | * @return \Stripe\Review 56 | * 57 | * @throws \Stripe\Exception\ApiErrorException if the request fails 58 | */ 59 | public function retrieve($id, $params = null, $opts = null) 60 | { 61 | return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/Service/ServiceNavigatorTrait.php: -------------------------------------------------------------------------------- 1 | */ 12 | protected $services = []; 13 | 14 | /** @var \Stripe\StripeClientInterface */ 15 | protected $client; 16 | 17 | protected function getServiceClass($name) 18 | { 19 | \trigger_error('Undefined property: ' . static::class . '::$' . $name); 20 | } 21 | 22 | public function __get($name) 23 | { 24 | $serviceClass = $this->getServiceClass($name); 25 | if (null !== $serviceClass) { 26 | if (!\array_key_exists($name, $this->services)) { 27 | $this->services[$name] = new $serviceClass($this->client); 28 | } 29 | 30 | return $this->services[$name]; 31 | } 32 | 33 | \trigger_error('Undefined property: ' . static::class . '::$' . $name); 34 | 35 | return null; 36 | } 37 | 38 | /** 39 | * @param string $name 40 | * 41 | * @return null|AbstractService|AbstractServiceFactory 42 | */ 43 | public function getService($name) 44 | { 45 | $serviceClass = $this->getServiceClass($name); 46 | if (null !== $serviceClass) { 47 | if (!\array_key_exists($name, $this->services)) { 48 | $this->services[$name] = new $serviceClass($this->client); 49 | } 50 | 51 | return $this->services[$name]; 52 | } 53 | 54 | \trigger_error('Undefined property: ' . static::class . '::$' . $name); 55 | 56 | return null; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/Service/SetupAttemptService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/setup_attempts', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/Sigma/ScheduledQueryRunService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an scheduled query run. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Sigma\ScheduledQueryRun 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Sigma/SigmaServiceFactory.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private static $classMap = [ 18 | 'scheduledQueryRuns' => ScheduledQueryRunService::class, 19 | ]; 20 | 21 | protected function getServiceClass($name) 22 | { 23 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Service/Tax/SettingsService.php: -------------------------------------------------------------------------------- 1 | Settings for a merchant. 16 | * 17 | * @param null|array{expand?: string[]} $params 18 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 19 | * 20 | * @return \Stripe\Tax\Settings 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function retrieve($params = null, $opts = null) 25 | { 26 | return $this->request('get', '/v1/tax/settings', $params, $opts); 27 | } 28 | 29 | /** 30 | * Updates Tax Settings parameters used in tax calculations. All 31 | * parameters are editable but none can be removed once set. 32 | * 33 | * @param null|array{defaults?: array{tax_behavior?: string, tax_code?: string}, expand?: string[], head_office?: array{address: array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}}} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Tax\Settings 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function update($params = null, $opts = null) 41 | { 42 | return $this->request('post', '/v1/tax/settings', $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Tax/TaxServiceFactory.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | private static $classMap = [ 21 | 'calculations' => CalculationService::class, 22 | 'registrations' => RegistrationService::class, 23 | 'settings' => SettingsService::class, 24 | 'transactions' => TransactionService::class, 25 | ]; 26 | 27 | protected function getServiceClass($name) 28 | { 29 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/Service/TaxCodeService.php: -------------------------------------------------------------------------------- 1 | all tax codes 16 | * available to add to Products in order to allow specific tax calculations. 17 | * 18 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params 19 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 20 | * 21 | * @return \Stripe\Collection<\Stripe\TaxCode> 22 | * 23 | * @throws \Stripe\Exception\ApiErrorException if the request fails 24 | */ 25 | public function all($params = null, $opts = null) 26 | { 27 | return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); 28 | } 29 | 30 | /** 31 | * Retrieves the details of an existing tax code. Supply the unique tax code ID and 32 | * Stripe will return the corresponding tax code information. 33 | * 34 | * @param string $id 35 | * @param null|array{expand?: string[]} $params 36 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 37 | * 38 | * @return \Stripe\TaxCode 39 | * 40 | * @throws \Stripe\Exception\ApiErrorException if the request fails 41 | */ 42 | public function retrieve($id, $params = null, $opts = null) 43 | { 44 | return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/Service/Terminal/ConnectionTokenService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/terminal/connection_tokens', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/Terminal/TerminalServiceFactory.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | private static $classMap = [ 21 | 'configurations' => ConfigurationService::class, 22 | 'connectionTokens' => ConnectionTokenService::class, 23 | 'locations' => LocationService::class, 24 | 'readers' => ReaderService::class, 25 | ]; 26 | 27 | protected function getServiceClass($name) 28 | { 29 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/CustomerService.php: -------------------------------------------------------------------------------- 1 | request('post', $this->buildPath('/v1/test_helpers/customers/%s/fund_cash_balance', $id), $params, $opts); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | private static $classMap = [ 21 | 'authorizations' => AuthorizationService::class, 22 | 'cards' => CardService::class, 23 | 'personalizationDesigns' => PersonalizationDesignService::class, 24 | 'transactions' => TransactionService::class, 25 | ]; 26 | 27 | protected function getServiceClass($name) 28 | { 29 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/RefundService.php: -------------------------------------------------------------------------------- 1 | requires_action. 16 | * 17 | * @param string $id 18 | * @param null|array{expand?: string[]} $params 19 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 20 | * 21 | * @return \Stripe\Refund 22 | * 23 | * @throws \Stripe\Exception\ApiErrorException if the request fails 24 | */ 25 | public function expire($id, $params = null, $opts = null) 26 | { 27 | return $this->request('post', $this->buildPath('/v1/test_helpers/refunds/%s/expire', $id), $params, $opts); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private static $classMap = [ 18 | 'readers' => ReaderService::class, 19 | ]; 20 | 21 | protected function getServiceClass($name) 22 | { 23 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/TestHelpersServiceFactory.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | private static $classMap = [ 24 | 'confirmationTokens' => ConfirmationTokenService::class, 25 | 'customers' => CustomerService::class, 26 | 'issuing' => Issuing\IssuingServiceFactory::class, 27 | 'refunds' => RefundService::class, 28 | 'terminal' => Terminal\TerminalServiceFactory::class, 29 | 'testClocks' => TestClockService::class, 30 | 'treasury' => Treasury\TreasuryServiceFactory::class, 31 | ]; 32 | 33 | protected function getServiceClass($name) 34 | { 35 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/Treasury/ReceivedCreditService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/test_helpers/treasury/received_credits', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/Treasury/ReceivedDebitService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v1/test_helpers/treasury/received_debits', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | private static $classMap = [ 22 | 'inboundTransfers' => InboundTransferService::class, 23 | 'outboundPayments' => OutboundPaymentService::class, 24 | 'outboundTransfers' => OutboundTransferService::class, 25 | 'receivedCredits' => ReceivedCreditService::class, 26 | 'receivedDebits' => ReceivedDebitService::class, 27 | ]; 28 | 29 | protected function getServiceClass($name) 30 | { 31 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/Service/Treasury/CreditReversalService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/credit_reversals', $params, $opts); 27 | } 28 | 29 | /** 30 | * Reverses a ReceivedCredit and creates a CreditReversal object. 31 | * 32 | * @param null|array{expand?: string[], metadata?: array, received_credit: string} $params 33 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 34 | * 35 | * @return \Stripe\Treasury\CreditReversal 36 | * 37 | * @throws \Stripe\Exception\ApiErrorException if the request fails 38 | */ 39 | public function create($params = null, $opts = null) 40 | { 41 | return $this->request('post', '/v1/treasury/credit_reversals', $params, $opts); 42 | } 43 | 44 | /** 45 | * Retrieves the details of an existing CreditReversal by passing the unique 46 | * CreditReversal ID from either the CreditReversal creation request or 47 | * CreditReversal list. 48 | * 49 | * @param string $id 50 | * @param null|array{expand?: string[]} $params 51 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 52 | * 53 | * @return \Stripe\Treasury\CreditReversal 54 | * 55 | * @throws \Stripe\Exception\ApiErrorException if the request fails 56 | */ 57 | public function retrieve($id, $params = null, $opts = null) 58 | { 59 | return $this->request('get', $this->buildPath('/v1/treasury/credit_reversals/%s', $id), $params, $opts); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/Service/Treasury/DebitReversalService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/debit_reversals', $params, $opts); 27 | } 28 | 29 | /** 30 | * Reverses a ReceivedDebit and creates a DebitReversal object. 31 | * 32 | * @param null|array{expand?: string[], metadata?: array, received_debit: string} $params 33 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 34 | * 35 | * @return \Stripe\Treasury\DebitReversal 36 | * 37 | * @throws \Stripe\Exception\ApiErrorException if the request fails 38 | */ 39 | public function create($params = null, $opts = null) 40 | { 41 | return $this->request('post', '/v1/treasury/debit_reversals', $params, $opts); 42 | } 43 | 44 | /** 45 | * Retrieves a DebitReversal object. 46 | * 47 | * @param string $id 48 | * @param null|array{expand?: string[]} $params 49 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 50 | * 51 | * @return \Stripe\Treasury\DebitReversal 52 | * 53 | * @throws \Stripe\Exception\ApiErrorException if the request fails 54 | */ 55 | public function retrieve($id, $params = null, $opts = null) 56 | { 57 | return $this->request('get', $this->buildPath('/v1/treasury/debit_reversals/%s', $id), $params, $opts); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/Service/Treasury/ReceivedCreditService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/received_credits', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an existing ReceivedCredit by passing the unique 31 | * ReceivedCredit ID from the ReceivedCredit list. 32 | * 33 | * @param string $id 34 | * @param null|array{expand?: string[]} $params 35 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 36 | * 37 | * @return \Stripe\Treasury\ReceivedCredit 38 | * 39 | * @throws \Stripe\Exception\ApiErrorException if the request fails 40 | */ 41 | public function retrieve($id, $params = null, $opts = null) 42 | { 43 | return $this->request('get', $this->buildPath('/v1/treasury/received_credits/%s', $id), $params, $opts); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Service/Treasury/ReceivedDebitService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/received_debits', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an existing ReceivedDebit by passing the unique 31 | * ReceivedDebit ID from the ReceivedDebit list. 32 | * 33 | * @param string $id 34 | * @param null|array{expand?: string[]} $params 35 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 36 | * 37 | * @return \Stripe\Treasury\ReceivedDebit 38 | * 39 | * @throws \Stripe\Exception\ApiErrorException if the request fails 40 | */ 41 | public function retrieve($id, $params = null, $opts = null) 42 | { 43 | return $this->request('get', $this->buildPath('/v1/treasury/received_debits/%s', $id), $params, $opts); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/Service/Treasury/TransactionEntryService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/transaction_entries', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves a TransactionEntry object. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Treasury\TransactionEntry 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/treasury/transaction_entries/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Treasury/TransactionService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v1/treasury/transactions', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an existing Transaction. 31 | * 32 | * @param string $id 33 | * @param null|array{expand?: string[]} $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\Treasury\Transaction 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v1/treasury/transactions/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/Treasury/TreasuryServiceFactory.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | private static $classMap = [ 27 | 'creditReversals' => CreditReversalService::class, 28 | 'debitReversals' => DebitReversalService::class, 29 | 'financialAccounts' => FinancialAccountService::class, 30 | 'inboundTransfers' => InboundTransferService::class, 31 | 'outboundPayments' => OutboundPaymentService::class, 32 | 'outboundTransfers' => OutboundTransferService::class, 33 | 'receivedCredits' => ReceivedCreditService::class, 34 | 'receivedDebits' => ReceivedDebitService::class, 35 | 'transactionEntries' => TransactionEntryService::class, 36 | 'transactions' => TransactionService::class, 37 | ]; 38 | 39 | protected function getServiceClass($name) 40 | { 41 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Service/V2/Billing/BillingServiceFactory.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | private static $classMap = [ 21 | 'meterEventAdjustments' => MeterEventAdjustmentService::class, 22 | 'meterEvents' => MeterEventService::class, 23 | 'meterEventSession' => MeterEventSessionService::class, 24 | 'meterEventStream' => MeterEventStreamService::class, 25 | ]; 26 | 27 | protected function getServiceClass($name) 28 | { 29 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/Service/V2/Billing/MeterEventAdjustmentService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v2/billing/meter_event_adjustments', $params, $opts); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Service/V2/Billing/MeterEventService.php: -------------------------------------------------------------------------------- 1 | , timestamp?: string} $params 20 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 21 | * 22 | * @return \Stripe\V2\Billing\MeterEvent 23 | * 24 | * @throws \Stripe\Exception\ApiErrorException if the request fails 25 | */ 26 | public function create($params = null, $opts = null) 27 | { 28 | return $this->request('post', '/v2/billing/meter_events', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/V2/Billing/MeterEventSessionService.php: -------------------------------------------------------------------------------- 1 | request('post', '/v2/billing/meter_event_session', $params, $opts); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/Service/V2/Billing/MeterEventStreamService.php: -------------------------------------------------------------------------------- 1 | , timestamp?: string}[]} $params 20 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 21 | * 22 | * @return void 23 | * 24 | * @throws \Stripe\Exception\TemporarySessionExpiredException 25 | */ 26 | public function create($params = null, $opts = null) 27 | { 28 | $opts = \Stripe\Util\RequestOptions::parse($opts); 29 | if (!isset($opts->apiBase)) { 30 | $opts->apiBase = $this->getClient()->getMeterEventsBase(); 31 | } 32 | $this->request('post', '/v2/billing/meter_event_stream', $params, $opts); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/Service/V2/Core/CoreServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | // Class Map: The beginning of the section generated from our OpenAPI spec 20 | 'eventDestinations' => EventDestinationService::class, 21 | 'events' => EventService::class, 22 | // Class Map: The end of the section generated from our OpenAPI spec 23 | ]; 24 | 25 | protected function getServiceClass($name) 26 | { 27 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Service/V2/Core/EventService.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @throws \Stripe\Exception\ApiErrorException if the request fails 23 | */ 24 | public function all($params = null, $opts = null) 25 | { 26 | return $this->requestCollection('get', '/v2/core/events', $params, $opts); 27 | } 28 | 29 | /** 30 | * Retrieves the details of an event. 31 | * 32 | * @param string $id 33 | * @param null|array $params 34 | * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts 35 | * 36 | * @return \Stripe\V2\Event 37 | * 38 | * @throws \Stripe\Exception\ApiErrorException if the request fails 39 | */ 40 | public function retrieve($id, $params = null, $opts = null) 41 | { 42 | return $this->request('get', $this->buildPath('/v2/core/events/%s', $id), $params, $opts); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/Service/V2/V2ServiceFactory.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | private static $classMap = [ 19 | 'billing' => Billing\BillingServiceFactory::class, 20 | 'core' => Core\CoreServiceFactory::class, 21 | ]; 22 | 23 | protected function getServiceClass($name) 24 | { 25 | return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/SingletonApiResource.php: -------------------------------------------------------------------------------- 1 | smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. 11 | * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. 12 | * @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. 13 | * @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. 14 | * @property null|string $product The ID of an existing Product. 15 | * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. 16 | * @property string $reference A custom identifier for this line item. 17 | * @property string $tax_behavior Specifies whether the amount includes taxes. If tax_behavior=inclusive, then the amount includes taxes. 18 | * @property null|((object{amount: int, jurisdiction: (object{country: string, display_name: string, level: string, state: null|string}&\Stripe\StripeObject), sourcing: string, tax_rate_details: null|(object{display_name: string, percentage_decimal: string, tax_type: string}&\Stripe\StripeObject), taxability_reason: string, taxable_amount: int}&\Stripe\StripeObject))[] $tax_breakdown Detailed account of taxes relevant to this line item. 19 | * @property string $tax_code The tax code ID used for this resource. 20 | */ 21 | class CalculationLineItem extends \Stripe\ApiResource 22 | { 23 | const OBJECT_NAME = 'tax.calculation_line_item'; 24 | 25 | const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; 26 | const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; 27 | } 28 | -------------------------------------------------------------------------------- /lib/Tax/TransactionLineItem.php: -------------------------------------------------------------------------------- 1 | smallest currency unit. If tax_behavior=inclusive, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. 11 | * @property int $amount_tax The amount of tax calculated for this line item, in the smallest currency unit. 12 | * @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. 13 | * @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. 14 | * @property null|string $product The ID of an existing Product. 15 | * @property int $quantity The number of units of the item being purchased. For reversals, this is the quantity reversed. 16 | * @property string $reference A custom identifier for this line item in the transaction. 17 | * @property null|(object{original_line_item: string}&\Stripe\StripeObject) $reversal If type=reversal, contains information about what was reversed. 18 | * @property string $tax_behavior Specifies whether the amount includes taxes. If tax_behavior=inclusive, then the amount includes taxes. 19 | * @property string $tax_code The tax code ID used for this resource. 20 | * @property string $type If reversal, this line item reverses an earlier transaction. 21 | */ 22 | class TransactionLineItem extends \Stripe\ApiResource 23 | { 24 | const OBJECT_NAME = 'tax.transaction_line_item'; 25 | 26 | const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; 27 | const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; 28 | 29 | const TYPE_REVERSAL = 'reversal'; 30 | const TYPE_TRANSACTION = 'transaction'; 31 | } 32 | -------------------------------------------------------------------------------- /lib/TaxCode.php: -------------------------------------------------------------------------------- 1 | Tax codes classify goods and services for tax purposes. 9 | * 10 | * @property string $id Unique identifier for the object. 11 | * @property string $object String representing the object's type. Objects of the same type share the same value. 12 | * @property string $description A detailed description of which types of products the tax code represents. 13 | * @property string $name A short name for the tax code. 14 | */ 15 | class TaxCode extends ApiResource 16 | { 17 | const OBJECT_NAME = 'tax_code'; 18 | 19 | /** 20 | * A list of all tax codes 21 | * available to add to Products in order to allow specific tax calculations. 22 | * 23 | * @param null|array{ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params 24 | * @param null|array|string $opts 25 | * 26 | * @return Collection of ApiResources 27 | * 28 | * @throws Exception\ApiErrorException if the request fails 29 | */ 30 | public static function all($params = null, $opts = null) 31 | { 32 | $url = static::classUrl(); 33 | 34 | return static::_requestPage($url, Collection::class, $params, $opts); 35 | } 36 | 37 | /** 38 | * Retrieves the details of an existing tax code. Supply the unique tax code ID and 39 | * Stripe will return the corresponding tax code information. 40 | * 41 | * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key 42 | * @param null|array|string $opts 43 | * 44 | * @return TaxCode 45 | * 46 | * @throws Exception\ApiErrorException if the request fails 47 | */ 48 | public static function retrieve($id, $opts = null) 49 | { 50 | $opts = Util\RequestOptions::parse($opts); 51 | $instance = new static($id, $opts); 52 | $instance->refresh(); 53 | 54 | return $instance; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /lib/TaxDeductedAtSource.php: -------------------------------------------------------------------------------- 1 | Fleet management 11 | * 12 | * @property string $object String representing the object's type. Objects of the same type share the same value. 13 | * @property null|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. 14 | * @property string $secret Your application should pass this token to the Stripe Terminal SDK. 15 | */ 16 | class ConnectionToken extends \Stripe\ApiResource 17 | { 18 | const OBJECT_NAME = 'terminal.connection_token'; 19 | 20 | /** 21 | * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived 22 | * connection token from Stripe, proxied through your server. On your backend, add 23 | * an endpoint that creates and returns a connection token. 24 | * 25 | * @param null|array{expand?: string[], location?: string} $params 26 | * @param null|array|string $options 27 | * 28 | * @return ConnectionToken the created resource 29 | * 30 | * @throws \Stripe\Exception\ApiErrorException if the request fails 31 | */ 32 | public static function create($params = null, $options = null) 33 | { 34 | self::_validateParams($params); 35 | $url = static::classUrl(); 36 | 37 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); 38 | $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); 39 | $obj->setLastResponse($response); 40 | 41 | return $obj; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/ThinEvent.php: -------------------------------------------------------------------------------- 1 | v2->core->events->retrieve(thin_event.id)` to fetch the full event object. 9 | * 10 | * @property string $id Unique identifier for the event. 11 | * @property string $type The type of the event. 12 | * @property string $created Time at which the object was created. 13 | * @property null|string $context Authentication context needed to fetch the event or related object. 14 | * @property null|RelatedObject $related_object Object containing the reference to API resource relevant to the event. 15 | * @property null|Reason $reason Reason for the event. 16 | * @property bool $livemode Livemode indicates if the event is from a production(true) or test(false) account. 17 | */ 18 | class ThinEvent 19 | { 20 | public $id; 21 | public $type; 22 | public $created; 23 | public $context; 24 | public $related_object; 25 | public $reason; 26 | public $livemode; 27 | } 28 | -------------------------------------------------------------------------------- /lib/Util/ApiVersion.php: -------------------------------------------------------------------------------- 1 | container = \array_change_key_case($initial_array, \CASE_LOWER); 22 | } 23 | 24 | /** 25 | * @return int 26 | */ 27 | #[\ReturnTypeWillChange] 28 | public function count() 29 | { 30 | return \count($this->container); 31 | } 32 | 33 | /** 34 | * @return \ArrayIterator 35 | */ 36 | #[\ReturnTypeWillChange] 37 | public function getIterator() 38 | { 39 | return new \ArrayIterator($this->container); 40 | } 41 | 42 | /** 43 | * @return void 44 | */ 45 | #[\ReturnTypeWillChange] 46 | public function offsetSet($offset, $value) 47 | { 48 | $offset = self::maybeLowercase($offset); 49 | if (null === $offset) { 50 | $this->container[] = $value; 51 | } else { 52 | $this->container[$offset] = $value; 53 | } 54 | } 55 | 56 | /** 57 | * @return bool 58 | */ 59 | #[\ReturnTypeWillChange] 60 | public function offsetExists($offset) 61 | { 62 | $offset = self::maybeLowercase($offset); 63 | 64 | return isset($this->container[$offset]); 65 | } 66 | 67 | /** 68 | * @return void 69 | */ 70 | #[\ReturnTypeWillChange] 71 | public function offsetUnset($offset) 72 | { 73 | $offset = self::maybeLowercase($offset); 74 | unset($this->container[$offset]); 75 | } 76 | 77 | /** 78 | * @return mixed 79 | */ 80 | #[\ReturnTypeWillChange] 81 | public function offsetGet($offset) 82 | { 83 | $offset = self::maybeLowercase($offset); 84 | 85 | return isset($this->container[$offset]) ? $this->container[$offset] : null; 86 | } 87 | 88 | private static function maybeLowercase($v) 89 | { 90 | if (\is_string($v)) { 91 | return \strtolower($v); 92 | } 93 | 94 | return $v; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/Util/DefaultLogger.php: -------------------------------------------------------------------------------- 1 | 0) { 20 | throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); 21 | } 22 | 23 | if (null === $this->destination) { 24 | \error_log($message, $this->messageType); 25 | } else { 26 | \error_log($message, $this->messageType, $this->destination); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/Util/EventTypes.php: -------------------------------------------------------------------------------- 1 | \Stripe\Events\V1BillingMeterErrorReportTriggeredEvent::class, 10 | \Stripe\Events\V1BillingMeterNoMeterFoundEvent::LOOKUP_TYPE => \Stripe\Events\V1BillingMeterNoMeterFoundEvent::class, 11 | \Stripe\Events\V2CoreEventDestinationPingEvent::LOOKUP_TYPE => \Stripe\Events\V2CoreEventDestinationPingEvent::class, 12 | // The end of the section generated from our OpenAPI spec 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /lib/Util/LoggerInterface.php: -------------------------------------------------------------------------------- 1 | _elts = []; 12 | foreach ($members as $item) { 13 | $this->_elts[$item] = true; 14 | } 15 | } 16 | 17 | public function includes($elt) 18 | { 19 | return isset($this->_elts[$elt]); 20 | } 21 | 22 | public function add($elt) 23 | { 24 | $this->_elts[$elt] = true; 25 | } 26 | 27 | public function discard($elt) 28 | { 29 | unset($this->_elts[$elt]); 30 | } 31 | 32 | public function toArray() 33 | { 34 | return \array_keys($this->_elts); 35 | } 36 | 37 | /** 38 | * @return \ArrayIterator 39 | */ 40 | #[\ReturnTypeWillChange] 41 | public function getIterator() 42 | { 43 | return new \ArrayIterator($this->toArray()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/V2/Billing/MeterEvent.php: -------------------------------------------------------------------------------- 1 | event_name field on a meter. 13 | * @property string $identifier A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We’ll enforce uniqueness within a rolling 24 hour period. 14 | * @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. 15 | * @property \Stripe\StripeObject $payload The payload of the event. This must contain the fields corresponding to a meter’s customer_mapping.event_payload_key (default is stripe_customer_id) and value_settings.event_payload_key (default is value). Read more about the payload. 16 | * @property int $timestamp The time of the event. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. 17 | */ 18 | class MeterEvent extends \Stripe\ApiResource 19 | { 20 | const OBJECT_NAME = 'v2.billing.meter_event'; 21 | } 22 | -------------------------------------------------------------------------------- /lib/V2/Billing/MeterEventAdjustment.php: -------------------------------------------------------------------------------- 1 | event_name field on a meter. 13 | * @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. 14 | * @property string $status Open Enum. The meter event adjustment’s status. 15 | * @property string $type Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. 16 | */ 17 | class MeterEventAdjustment extends \Stripe\ApiResource 18 | { 19 | const OBJECT_NAME = 'v2.billing.meter_event_adjustment'; 20 | 21 | const STATUS_COMPLETE = 'complete'; 22 | const STATUS_PENDING = 'pending'; 23 | } 24 | -------------------------------------------------------------------------------- /lib/V2/Billing/MeterEventSession.php: -------------------------------------------------------------------------------- 1 | true if the object exists in live mode or the value false if the object exists in test mode. 14 | */ 15 | class MeterEventSession extends \Stripe\ApiResource 16 | { 17 | const OBJECT_NAME = 'v2.billing.meter_event_session'; 18 | } 19 | -------------------------------------------------------------------------------- /lib/V2/Event.php: -------------------------------------------------------------------------------- 1 |