From 936512d0bbf9dc992f677e35660b1b667084cbcc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Apr 2023 18:42:04 +0200 Subject: [PATCH] Update Stripe lib to 10.7.0 --- COPYRIGHT | 2 +- .../stripe-php/.coveralls.github-actions.yml | 3 - .../includes/stripe/stripe-php/.editorconfig | 20 - htdocs/includes/stripe/stripe-php/.gitignore | 4 + .../includes/stripe/stripe-php/.php_cs.dist | 45 - .../includes/stripe/stripe-php/CHANGELOG.md | 631 +++++++ .../stripe/stripe-php/CODE_OF_CONDUCT.md | 77 - htdocs/includes/stripe/stripe-php/Makefile | 36 - .../stripe/stripe-php/OPENAPI_VERSION | 1 + htdocs/includes/stripe/stripe-php/README.md | 50 +- htdocs/includes/stripe/stripe-php/VERSION | 2 +- htdocs/includes/stripe/stripe-php/build.php | 25 - .../includes/stripe/stripe-php/composer.json | 8 +- .../stripe-php/data/ca-certificates.crt | 1661 ++++++++--------- htdocs/includes/stripe/stripe-php/init.php | 90 +- .../stripe/stripe-php/lib/Account.php | 129 +- .../stripe/stripe-php/lib/AlipayAccount.php | 75 - .../stripe-php/lib/ApiOperations/Request.php | 32 + .../stripe-php/lib/ApiOperations/Search.php | 37 + .../lib/ApiOperations/SingletonRetrieve.php | 30 + .../stripe-php/lib/ApiOperations/Update.php | 4 + .../stripe/stripe-php/lib/ApiRequestor.php | 121 +- .../stripe/stripe-php/lib/ApiResource.php | 2 + .../stripe/stripe-php/lib/ApplicationFee.php | 4 +- .../stripe/stripe-php/lib/Apps/Secret.php | 79 + .../stripe/stripe-php/lib/Balance.php | 18 +- .../stripe/stripe-php/lib/BankAccount.php | 1 + .../stripe-php/lib/BaseStripeClient.php | 45 +- .../lib/BaseStripeClientInterface.php | 44 + .../lib/BillingPortal/Configuration.php | 33 + .../stripe-php/lib/BillingPortal/Session.php | 26 +- .../stripe/stripe-php/lib/BitcoinReceiver.php | 71 - .../stripe-php/lib/BitcoinTransaction.php | 19 - .../stripe/stripe-php/lib/Capability.php | 3 +- .../includes/stripe/stripe-php/lib/Card.php | 10 +- .../stripe/stripe-php/lib/CashBalance.php | 66 + .../includes/stripe/stripe-php/lib/Charge.php | 32 +- .../stripe-php/lib/Checkout/Session.php | 94 +- .../stripe/stripe-php/lib/Collection.php | 46 +- .../includes/stripe/stripe-php/lib/Coupon.php | 14 +- .../stripe/stripe-php/lib/CreditNote.php | 32 +- .../stripe-php/lib/CreditNoteLineItem.php | 4 +- .../stripe/stripe-php/lib/Customer.php | 157 +- .../lib/CustomerBalanceTransaction.php | 3 +- .../lib/CustomerCashBalanceTransaction.php | 42 + .../stripe/stripe-php/lib/Discount.php | 13 +- .../stripe/stripe-php/lib/Dispute.php | 6 +- .../stripe/stripe-php/lib/EphemeralKey.php | 3 +- .../stripe/stripe-php/lib/Error/Api.php | 7 - .../stripe-php/lib/Error/ApiConnection.php | 7 - .../stripe-php/lib/Error/Authentication.php | 7 - .../stripe/stripe-php/lib/Error/Base.php | 69 - .../stripe/stripe-php/lib/Error/Card.php | 40 - .../stripe-php/lib/Error/Idempotency.php | 7 - .../stripe-php/lib/Error/InvalidRequest.php | 23 - .../lib/Error/OAuth/InvalidClient.php | 10 - .../lib/Error/OAuth/InvalidGrant.php | 13 - .../lib/Error/OAuth/InvalidRequest.php | 11 - .../lib/Error/OAuth/InvalidScope.php | 10 - .../stripe-php/lib/Error/OAuth/OAuthBase.php | 23 - .../lib/Error/OAuth/UnsupportedGrantType.php | 11 - .../Error/OAuth/UnsupportedResponseType.php | 11 - .../stripe-php/lib/Error/Permission.php | 7 - .../stripe/stripe-php/lib/Error/RateLimit.php | 7 - .../lib/Error/SignatureVerification.php | 20 - .../stripe/stripe-php/lib/ErrorObject.php | 64 +- .../includes/stripe/stripe-php/lib/Event.php | 99 +- .../includes/stripe/stripe-php/lib/File.php | 14 +- .../stripe/stripe-php/lib/FileUpload.php | 6 - .../lib/FinancialConnections/Account.php | 104 ++ .../lib/FinancialConnections/AccountOwner.php | 20 + .../FinancialConnections/AccountOwnership.php | 18 + .../lib/FinancialConnections/Session.php | 27 + .../stripe-php/lib/FundingInstructions.php | 28 + .../stripe-php/lib/HttpClient/CurlClient.php | 224 ++- .../HttpClient/StreamingClientInterface.php | 23 + .../lib/Identity/VerificationReport.php | 45 + .../lib/Identity/VerificationSession.php | 88 + .../stripe/stripe-php/lib/Invoice.php | 167 +- .../stripe/stripe-php/lib/InvoiceItem.php | 26 +- .../stripe/stripe-php/lib/InvoiceLineItem.php | 11 +- .../stripe-php/lib/IssuerFraudRecord.php | 24 - .../stripe-php/lib/Issuing/Authorization.php | 10 +- .../stripe/stripe-php/lib/Issuing/Card.php | 28 +- .../stripe-php/lib/Issuing/Cardholder.php | 2 +- .../stripe/stripe-php/lib/Issuing/Dispute.php | 7 +- .../stripe-php/lib/Issuing/Transaction.php | 2 + .../stripe/stripe-php/lib/LineItem.php | 14 +- .../stripe/stripe-php/lib/Mandate.php | 4 +- .../includes/stripe/stripe-php/lib/Order.php | 81 - .../stripe/stripe-php/lib/OrderItem.php | 19 - .../stripe/stripe-php/lib/OrderReturn.php | 32 - .../stripe/stripe-php/lib/PaymentIntent.php | 84 +- .../stripe/stripe-php/lib/PaymentLink.php | 92 + .../stripe/stripe-php/lib/PaymentMethod.php | 59 +- .../includes/stripe/stripe-php/lib/Payout.php | 6 +- .../includes/stripe/stripe-php/lib/Person.php | 31 +- .../includes/stripe/stripe-php/lib/Plan.php | 8 +- .../includes/stripe/stripe-php/lib/Price.php | 37 +- .../stripe/stripe-php/lib/Product.php | 42 +- .../stripe/stripe-php/lib/PromotionCode.php | 7 +- .../includes/stripe/stripe-php/lib/Quote.php | 171 ++ .../lib/Radar/EarlyFraudWarning.php | 1 + .../stripe/stripe-php/lib/Radar/ValueList.php | 4 +- .../stripe/stripe-php/lib/Recipient.php | 44 - .../includes/stripe/stripe-php/lib/Refund.php | 28 +- .../stripe-php/lib/Reporting/ReportRun.php | 6 +- .../stripe-php/lib/Reporting/ReportType.php | 5 +- .../includes/stripe/stripe-php/lib/Review.php | 8 +- htdocs/includes/stripe/stripe-php/lib/SKU.php | 44 - .../stripe/stripe-php/lib/SearchResult.php | 237 +++ .../lib/Service/AbstractService.php | 26 + .../lib/Service/AbstractServiceFactory.php | 10 + .../stripe-php/lib/Service/AccountService.php | 45 +- .../lib/Service/ApplePayDomainService.php | 2 +- .../lib/Service/ApplicationFeeService.php | 4 +- .../lib/Service/Apps/AppsServiceFactory.php | 25 + .../lib/Service/Apps/SecretService.php | 68 + .../lib/Service/BalanceTransactionService.php | 2 +- .../BillingPortalServiceFactory.php | 2 + .../BillingPortal/ConfigurationService.php | 73 + .../stripe-php/lib/Service/ChargeService.php | 29 +- .../lib/Service/Checkout/SessionService.php | 29 +- .../lib/Service/CoreServiceFactory.php | 24 +- .../lib/Service/CountrySpecService.php | 2 +- .../stripe-php/lib/Service/CouponService.php | 2 +- .../lib/Service/CreditNoteService.php | 8 +- .../lib/Service/CustomerService.php | 161 +- .../stripe-php/lib/Service/DisputeService.php | 2 +- .../stripe-php/lib/Service/EventService.php | 2 +- .../lib/Service/ExchangeRateService.php | 2 +- .../lib/Service/FileLinkService.php | 2 +- .../stripe-php/lib/Service/FileService.php | 2 +- .../FinancialConnections/AccountService.php | 89 + .../FinancialConnectionsServiceFactory.php | 27 + .../FinancialConnections/SessionService.php | 41 + .../Identity/IdentityServiceFactory.php | 27 + .../Identity/VerificationReportService.php | 39 + .../Identity/VerificationSessionService.php | 146 ++ .../lib/Service/InvoiceItemService.php | 2 +- .../stripe-php/lib/Service/InvoiceService.php | 38 +- .../Service/Issuing/AuthorizationService.php | 10 +- .../lib/Service/Issuing/CardService.php | 2 +- .../lib/Service/Issuing/CardholderService.php | 2 +- .../lib/Service/Issuing/DisputeService.php | 2 +- .../Service/Issuing/TransactionService.php | 2 +- .../lib/Service/OrderReturnService.php | 42 - .../stripe-php/lib/Service/OrderService.php | 109 -- .../lib/Service/PaymentIntentService.php | 128 +- .../lib/Service/PaymentLinkService.php | 89 + .../lib/Service/PaymentMethodService.php | 30 +- .../stripe-php/lib/Service/PayoutService.php | 2 +- .../stripe-php/lib/Service/PlanService.php | 2 +- .../stripe-php/lib/Service/PriceService.php | 22 +- .../stripe-php/lib/Service/ProductService.php | 22 +- .../lib/Service/PromotionCodeService.php | 7 +- .../stripe-php/lib/Service/QuoteService.php | 177 ++ .../Radar/EarlyFraudWarningService.php | 2 +- .../Service/Radar/ValueListItemService.php | 2 +- .../lib/Service/Radar/ValueListService.php | 2 +- .../stripe-php/lib/Service/RefundService.php | 21 +- .../Service/Reporting/ReportRunService.php | 12 +- .../Service/Reporting/ReportTypeService.php | 7 +- .../stripe-php/lib/Service/ReviewService.php | 2 +- .../lib/Service/SetupAttemptService.php | 2 +- .../lib/Service/SetupIntentService.php | 18 +- .../lib/Service/ShippingRateService.php | 70 + .../Sigma/ScheduledQueryRunService.php | 2 +- .../stripe-php/lib/Service/SourceService.php | 8 +- .../lib/Service/SubscriptionItemService.php | 4 +- .../Service/SubscriptionScheduleService.php | 2 +- .../lib/Service/SubscriptionService.php | 54 +- .../stripe-php/lib/Service/TaxCodeService.php | 41 + .../stripe-php/lib/Service/TaxRateService.php | 2 +- .../ConfigurationService.php} | 43 +- .../lib/Service/Terminal/LocationService.php | 6 +- .../lib/Service/Terminal/ReaderService.php | 82 +- .../Terminal/TerminalServiceFactory.php | 2 + .../Service/TestHelpers/CustomerService.php | 24 + .../TestHelpers/Issuing/CardService.php | 76 + .../Issuing/IssuingServiceFactory.php | 25 + .../lib/Service/TestHelpers/RefundService.php | 24 + .../TestHelpers/Terminal/ReaderService.php | 25 + .../Terminal/TerminalServiceFactory.php | 25 + .../Service/TestHelpers/TestClockService.php | 87 + .../TestHelpers/TestHelpersServiceFactory.php | 35 + .../Treasury/InboundTransferService.php | 62 + .../Treasury/OutboundPaymentService.php | 62 + .../Treasury/OutboundTransferService.php | 62 + .../Treasury/ReceivedCreditService.php | 25 + .../Treasury/ReceivedDebitService.php | 25 + .../Treasury/TreasuryServiceFactory.php | 33 + .../stripe-php/lib/Service/TopupService.php | 2 +- .../lib/Service/TransferService.php | 18 +- .../Treasury/CreditReversalService.php | 56 + .../Service/Treasury/DebitReversalService.php | 54 + .../Treasury/FinancialAccountService.php | 103 + .../Treasury/InboundTransferService.php | 70 + .../Treasury/OutboundPaymentService.php | 72 + .../Treasury/OutboundTransferService.php | 72 + .../Treasury/ReceivedCreditService.php | 40 + .../Service/Treasury/ReceivedDebitService.php | 40 + .../Treasury/TransactionEntryService.php | 39 + .../Service/Treasury/TransactionService.php | 39 + .../Treasury/TreasuryServiceFactory.php | 43 + .../lib/Service/WebhookEndpointService.php | 2 +- .../stripe/stripe-php/lib/SetupAttempt.php | 4 +- .../stripe/stripe-php/lib/SetupIntent.php | 27 +- .../stripe/stripe-php/lib/ShippingRate.php | 41 + .../lib/Sigma/ScheduledQueryRun.php | 2 +- .../stripe-php/lib/SingletonApiResource.php | 11 +- .../includes/stripe/stripe-php/lib/Source.php | 85 +- .../includes/stripe/stripe-php/lib/Stripe.php | 10 +- .../stripe/stripe-php/lib/StripeClient.php | 12 +- .../stripe-php/lib/StripeClientInterface.php | 37 +- .../stripe/stripe-php/lib/StripeObject.php | 37 +- .../lib/StripeStreamingClientInterface.php | 11 + .../stripe/stripe-php/lib/Subscription.php | 72 +- .../stripe-php/lib/SubscriptionItem.php | 28 +- .../stripe-php/lib/SubscriptionSchedule.php | 8 +- .../stripe/stripe-php/lib/TaxCode.php | 22 + .../includes/stripe/stripe-php/lib/TaxId.php | 21 +- .../stripe/stripe-php/lib/TaxRate.php | 13 + .../stripe-php/lib/Terminal/Configuration.php | 28 + .../lib/Terminal/ConnectionToken.php | 5 +- .../stripe-php/lib/Terminal/Location.php | 4 +- .../stripe/stripe-php/lib/Terminal/Reader.php | 92 +- .../stripe-php/lib/TestHelpers/TestClock.php | 53 + .../stripe/stripe-php/lib/ThreeDSecure.php | 37 - .../includes/stripe/stripe-php/lib/Token.php | 8 +- .../includes/stripe/stripe-php/lib/Topup.php | 4 +- .../stripe/stripe-php/lib/Transfer.php | 26 +- .../lib/Treasury/CreditReversal.php | 42 + .../stripe-php/lib/Treasury/DebitReversal.php | 43 + .../lib/Treasury/FinancialAccount.php | 75 + .../lib/Treasury/FinancialAccountFeatures.php | 24 + .../lib/Treasury/InboundTransfer.php | 65 + .../lib/Treasury/OutboundPayment.php | 69 + .../lib/Treasury/OutboundTransfer.php | 69 + .../lib/Treasury/ReceivedCredit.php | 48 + .../stripe-php/lib/Treasury/ReceivedDebit.php | 47 + .../stripe-php/lib/Treasury/Transaction.php | 48 + .../lib/Treasury/TransactionEntry.php | 62 + .../stripe/stripe-php/lib/Util/ApiVersion.php | 10 + .../lib/Util/AutoPagingIterator.php | 61 - .../lib/Util/CaseInsensitiveArray.php | 24 + .../stripe-php/lib/Util/ObjectTypes.php | 39 +- .../stripe-php/lib/Util/RandomGenerator.php | 4 +- .../stripe-php/lib/Util/RequestOptions.php | 7 +- .../stripe/stripe-php/lib/Util/Set.php | 4 + .../stripe/stripe-php/lib/Util/Util.php | 4 +- .../stripe/stripe-php/lib/WebhookEndpoint.php | 2 +- .../stripe/stripe-php/phpdoc.dist.xml | 31 - .../stripe/stripe-php/phpstan-baseline.neon | 12 - .../stripe/stripe-php/phpstan.neon.dist | 11 - .../stripe/stripe-php/update_certs.php | 19 - 256 files changed, 8077 insertions(+), 2978 deletions(-) delete mode 100644 htdocs/includes/stripe/stripe-php/.coveralls.github-actions.yml delete mode 100644 htdocs/includes/stripe/stripe-php/.editorconfig delete mode 100644 htdocs/includes/stripe/stripe-php/.php_cs.dist delete mode 100644 htdocs/includes/stripe/stripe-php/CODE_OF_CONDUCT.md delete mode 100644 htdocs/includes/stripe/stripe-php/Makefile create mode 100644 htdocs/includes/stripe/stripe-php/OPENAPI_VERSION delete mode 100644 htdocs/includes/stripe/stripe-php/build.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/AlipayAccount.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/ApiOperations/Search.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/ApiOperations/SingletonRetrieve.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Apps/Secret.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/BaseStripeClientInterface.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/BillingPortal/Configuration.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/BitcoinReceiver.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/BitcoinTransaction.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/CashBalance.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/CustomerCashBalanceTransaction.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Api.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/ApiConnection.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Authentication.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Base.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Card.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Idempotency.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/InvalidRequest.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidGrant.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidRequest.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidScope.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/OAuth/UnsupportedResponseType.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/Permission.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/RateLimit.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Error/SignatureVerification.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/FileUpload.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/FinancialConnections/Account.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/FinancialConnections/AccountOwnership.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/FinancialConnections/Session.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/FundingInstructions.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Identity/VerificationReport.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Identity/VerificationSession.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/IssuerFraudRecord.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Order.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/OrderItem.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/OrderReturn.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/PaymentLink.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Quote.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Recipient.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/SKU.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/SearchResult.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Apps/AppsServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Apps/SecretService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/OrderReturnService.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/OrderService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/PaymentLinkService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/QuoteService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/ShippingRateService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TaxCodeService.php rename htdocs/includes/stripe/stripe-php/lib/Service/{SkuService.php => Terminal/ConfigurationService.php} (50%) create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/CustomerService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/CreditReversalService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/DebitReversalService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/FinancialAccountService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/InboundTransferService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundPaymentService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundTransferService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedCreditService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedDebitService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionEntryService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionService.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TreasuryServiceFactory.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/ShippingRate.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/StripeStreamingClientInterface.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/TaxCode.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Terminal/Configuration.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/TestHelpers/TestClock.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/ThreeDSecure.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/CreditReversal.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/DebitReversal.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccount.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccountFeatures.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/InboundTransfer.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundPayment.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundTransfer.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedCredit.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedDebit.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/Transaction.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Treasury/TransactionEntry.php create mode 100644 htdocs/includes/stripe/stripe-php/lib/Util/ApiVersion.php delete mode 100644 htdocs/includes/stripe/stripe-php/lib/Util/AutoPagingIterator.php delete mode 100644 htdocs/includes/stripe/stripe-php/phpdoc.dist.xml delete mode 100644 htdocs/includes/stripe/stripe-php/phpstan-baseline.neon delete mode 100644 htdocs/includes/stripe/stripe-php/phpstan.neon.dist delete mode 100644 htdocs/includes/stripe/stripe-php/update_certs.php diff --git a/COPYRIGHT b/COPYRIGHT index 405482ff71c..eb4176aef19 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -43,7 +43,7 @@ Restler 3.1.1 LGPL-3+ Yes Sabre 3.2.2 BSD Yes DAV support Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP Symfony/var-dumper ??? MIT License Yes Library to make var dump (used by DebugBar) -Stripe 7.67.0 MIT Licence Yes Library for Stripe module +Stripe 10.7.0 MIT Licence Yes Library for Stripe module TCPDF 6.3.2 LGPL-3+ Yes PDF generation TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement diff --git a/htdocs/includes/stripe/stripe-php/.coveralls.github-actions.yml b/htdocs/includes/stripe/stripe-php/.coveralls.github-actions.yml deleted file mode 100644 index 40ff9a76b32..00000000000 --- a/htdocs/includes/stripe/stripe-php/.coveralls.github-actions.yml +++ /dev/null @@ -1,3 +0,0 @@ -service_name: github-actions -coverage_clover: clover.xml -json_path: coveralls-upload.json diff --git a/htdocs/includes/stripe/stripe-php/.editorconfig b/htdocs/includes/stripe/stripe-php/.editorconfig deleted file mode 100644 index 174e9120bf8..00000000000 --- a/htdocs/includes/stripe/stripe-php/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -; https://editorconfig.org/ - -root = true - -[*] -indent_style = space -indent_size = 4 -insert_final_newline = true -trim_trailing_whitespace = true -end_of_line = lf -charset = utf-8 - -[*.{json,yml}] -indent_size = 2 - -[*.neon] -indent_style = tab - -[Makefile] -indent_style = tab diff --git a/htdocs/includes/stripe/stripe-php/.gitignore b/htdocs/includes/stripe/stripe-php/.gitignore index db88f6676d7..880465ac1ef 100644 --- a/htdocs/includes/stripe/stripe-php/.gitignore +++ b/htdocs/includes/stripe/stripe-php/.gitignore @@ -22,6 +22,7 @@ clover.xml # Ignore PHP CS Fixer local config and cache .php_cs .php_cs.cache +.php-cs-fixer.cache # Ignore PHPStan local config .phpstan.neon @@ -29,3 +30,6 @@ clover.xml # Ignore phpDocumentor's local config and artifacts .phpdoc/* phpdoc.xml + +# Ignore cached PHPUnit results. +.phpunit.result.cache diff --git a/htdocs/includes/stripe/stripe-php/.php_cs.dist b/htdocs/includes/stripe/stripe-php/.php_cs.dist deleted file mode 100644 index 2ebf9f3d8c4..00000000000 --- a/htdocs/includes/stripe/stripe-php/.php_cs.dist +++ /dev/null @@ -1,45 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - // Rulesets - '@PSR2' => true, - '@PhpCsFixer' => true, - '@PhpCsFixer:risky' => true, - '@PHP56Migration:risky' => true, - '@PHPUnit57Migration:risky' => true, - - // Additional rules - 'fopen_flags' => true, - 'linebreak_after_opening_tag' => true, - 'native_constant_invocation' => true, - 'native_function_invocation' => true, - - // --- Diffs from @PhpCsFixer / @PhpCsFixer:risky --- - - // This is the same as the default for the @PhpCsFixer ruleset, minus - // the following values: ['include', 'include_once', 'require', - // 'require_once']. We could enable them and remove this line after - // updating codegen for the `init.php` file to be compliant. - 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'return', 'switch', 'throw', 'try']], - - // This is just prettier / easier to read. - 'concat_space' => ['spacing' => 'one'], - - // This causes strange ordering with codegen'd classes. We might be - // able to enable this if we update codegen to output class elements - // in the correct order. - 'ordered_class_elements' => false, - - // Keep this disabled to avoid unnecessary diffs in PHPDoc comments of - // codegen'd classes. - 'phpdoc_align' => false, - - // This is a "risky" rule that causes a bug in our codebase. - // Specifically, in `StripeObject.updateAttributes` we construct new - // `StripeObject`s for metadata. We can't use `self` there because it - // needs to be a raw `StripeObject`. - 'self_accessor' => false, - ]) -; diff --git a/htdocs/includes/stripe/stripe-php/CHANGELOG.md b/htdocs/includes/stripe/stripe-php/CHANGELOG.md index 4e867c82b14..8452e4e6d51 100644 --- a/htdocs/includes/stripe/stripe-php/CHANGELOG.md +++ b/htdocs/includes/stripe/stripe-php/CHANGELOG.md @@ -1,5 +1,636 @@ # Changelog +## 10.7.0 - 2023-02-23 +* [#1444](https://github.com/stripe/stripe-php/pull/1444) API Updates + * Add support for new value `igst` on enum `TaxRate.tax_type` + +## 10.6.1 - 2023-02-21 +* [#1443](https://github.com/stripe/stripe-php/pull/1443) Remove init.php from the list of ignored files + +## 10.6.0 - 2023-02-16 +* [#1441](https://github.com/stripe/stripe-php/pull/1441) API Updates + * Add support for `refund_payment` method on resource `Terminal.Reader` + * Add support for `custom_fields` on `Checkout.Session` and `PaymentLink` +* [#1236](https://github.com/stripe/stripe-php/pull/1236) subscription_proration_date not always presented in Invoice +* [#1431](https://github.com/stripe/stripe-php/pull/1431) Fix: Do not use unbounded version constraint for `actions/checkout` +* [#1436](https://github.com/stripe/stripe-php/pull/1436) Enhancement: Enable and configure `visibility_required` fixer +* [#1432](https://github.com/stripe/stripe-php/pull/1432) Enhancement: Update `actions/cache` +* [#1434](https://github.com/stripe/stripe-php/pull/1434) Fix: Remove parentheses +* [#1433](https://github.com/stripe/stripe-php/pull/1433) Enhancement: Run tests on PHP 8.2 +* [#1438](https://github.com/stripe/stripe-php/pull/1438) Update .gitattributes + +## 10.5.0 - 2023-02-02 +* [#1439](https://github.com/stripe/stripe-php/pull/1439) API Updates + * Add support for `resume` method on resource `Subscription` + * Add support for `amount_shipping` and `shipping_cost` on `CreditNote` and `Invoice` + * Add support for `shipping_details` on `Invoice` + * Add support for `invoice_creation` on `PaymentLink` + * Add support for `trial_settings` on `Subscription` + * Add support for new value `paused` on enum `Subscription.status` + +## 10.4.0 - 2023-01-19 +* [#1381](https://github.com/stripe/stripe-php/pull/1381) Add getService methods to StripeClient and AbstractServiceFactory to allow mocking +* [#1424](https://github.com/stripe/stripe-php/pull/1424) API Updates + + * Added `REFUND_CREATED`, `REFUND_UPDATED` event definitions. +* [#1426](https://github.com/stripe/stripe-php/pull/1426) Ignore PHP version for formatting +* [#1425](https://github.com/stripe/stripe-php/pull/1425) Fix Stripe::setAccountId parameter type +* [#1418](https://github.com/stripe/stripe-php/pull/1418) Switch to mb_convert_encoding to fix utf8_encode deprecation warning + +## 10.3.0 - 2022-12-22 +* [#1413](https://github.com/stripe/stripe-php/pull/1413) API Updates + Change `CheckoutSession.cancel_url` to be nullable. + +## 10.2.0 - 2022-12-15 +* [#1411](https://github.com/stripe/stripe-php/pull/1411) API Updates + * Add support for new value `invoice_overpaid` on enum `CustomerBalanceTransaction.type` +* [#1407](https://github.com/stripe/stripe-php/pull/1407) API Updates + + +## 10.1.0 - 2022-12-06 +* [#1405](https://github.com/stripe/stripe-php/pull/1405) API Updates + * Add support for `flow` on `BillingPortal.Session` +* [#1404](https://github.com/stripe/stripe-php/pull/1404) API Updates + * Remove support for resources `Order` and `Sku` + * Remove support for `all`, `cancel`, `create`, `list_line_items`, `reopen`, `retrieve`, `submit`, and `update` methods on resource `Order` + * Remove support for `all`, `create`, `delete`, `retrieve`, and `update` methods on resource `Sku` + * Add support for `custom_text` on `Checkout.Session` and `PaymentLink` + * Add support for `invoice_creation` and `invoice` on `Checkout.Session` + * Remove support for `product` on `LineItem` + * Add support for `latest_charge` on `PaymentIntent` + * Remove support for `charges` on `PaymentIntent` + +## 10.0.0 - 2022-11-16 +* [#1392](https://github.com/stripe/stripe-php/pull/1392) Next major release changes + +Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15. + +"⚠️" symbol highlights breaking changes. + +### Deprecated +* [#1382](https://github.com/stripe/stripe-php/pull/1382) Mark `resource.save` as deprecated. Prefer the static update method that doesn't require retrieval of the resource to update it. +```PHP +// before +$resource = Price::retrieve(self::TEST_RESOURCE_ID); +$resource->metadata['key'] = 'value'; +$resource->save(); + +// after +$resource = Price::update('price_123', [ + 'metadata' => ['key' => 'value'], +]); +``` + +### ⚠️ Removed +- [#1377](https://github.com/stripe/stripe-php/pull/1377) Removed deprecated `Sku` resource and service +- [#1375](https://github.com/stripe/stripe-php/pull/1375) Removed deprecated `Orders` resource and service +- [#1375](https://github.com/stripe/stripe-php/pull/1375) Removed deprecated `Product` field from the `LineItem` +- [#1388](https://github.com/stripe/stripe-php/pull/1388) Removed deprecated `AlipayAccount` resource +- [#1396](https://github.com/stripe/stripe-php/pull/1396) Removed `charges` field on `PaymentIntent` and replace it with `latest_charge`. + + +## 9.9.0 - 2022-11-08 +* [#1394](https://github.com/stripe/stripe-php/pull/1394) API Updates + * Add support for new values `eg_tin`, `ph_tin`, and `tr_tin` on enum `TaxId.type` +* [#1389](https://github.com/stripe/stripe-php/pull/1389) API Updates + * Add support for `on_behalf_of` on `Subscription` +* [#1379](https://github.com/stripe/stripe-php/pull/1379) Do not run Coveralls in PR-s + +## 9.8.0 - 2022-10-20 +* [#1383](https://github.com/stripe/stripe-php/pull/1383) API Updates + * Add support for new values `jp_trn` and `ke_pin` on enum `TaxId.type` +* [#1293](https://github.com/stripe/stripe-php/pull/1293) Install deps in the install step of CI +* [#1291](https://github.com/stripe/stripe-php/pull/1291) Fix: Configure finder for `friendsofphp/php-cs-fixer` + +## 9.7.0 - 2022-10-13 +* [#1376](https://github.com/stripe/stripe-php/pull/1376) API Updates + * Add support for `network_data` on `Issuing.Authorization` +* [#1374](https://github.com/stripe/stripe-php/pull/1374) Add request_log_url on ErrorObject +* [#1370](https://github.com/stripe/stripe-php/pull/1370) API Updates + * Add support for `created` on `Checkout.Session` + +## 9.6.0 - 2022-09-15 +* [#1365](https://github.com/stripe/stripe-php/pull/1365) API Updates + * Add support for `from_invoice` and `latest_revision` on `Invoice` + * Add support for new value `pix` on enum `PaymentLink.payment_method_types[]` + * Add support for `pix` on `PaymentMethod` + * Add support for new value `pix` on enum `PaymentMethod.type` + * Add support for `created` on `Treasury.CreditReversal` and `Treasury.DebitReversal` + +## 9.5.0 - 2022-09-06 +* [#1364](https://github.com/stripe/stripe-php/pull/1364) API Updates + * Add support for new value `terminal_reader_splashscreen` on enum `File.purpose` +* [#1363](https://github.com/stripe/stripe-php/pull/1363) chore: Update PHP tests to handle search methods. + +## 9.4.0 - 2022-08-26 +* [#1362](https://github.com/stripe/stripe-php/pull/1362) API Updates + * Add support for `login_page` on `BillingPortal.Configuration` +* [#1360](https://github.com/stripe/stripe-php/pull/1360) Add test coverage using Coveralls +* [#1361](https://github.com/stripe/stripe-php/pull/1361) fix: Fix type hints for error objects. + * Update `Invoice.last_finalization_error`, `PaymentIntent.last_payment_error`, `SetupAttempt.setup_error` and `SetupIntent.setup_error` type to be `StripeObject`. + * Addresses https://github.com/stripe/stripe-php/issues/1353. The library today does not actually return a `ErrorObject` for these fields, so the type annotation was incorrect. +* [#1356](https://github.com/stripe/stripe-php/pull/1356) Add beta readme.md section + +## 9.3.0 - 2022-08-23 +* [#1355](https://github.com/stripe/stripe-php/pull/1355) API Updates + * Change type of `Treasury.OutboundTransfer.destination_payment_method` from `string` to `string | null` + * Change the return type of `CustomerService.fundCashBalance` test helper from `CustomerBalanceTransaction` to `CustomerCashBalanceTransaction`. + * This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change. + +## 9.2.0 - 2022-08-19 +* [#1352](https://github.com/stripe/stripe-php/pull/1352) API Updates + * Add support for new resource `CustomerCashBalanceTransaction` + * Add support for `currency` on `PaymentLink` + * Add constant for `customer_cash_balance_transaction.created` webhook event. +* [#1351](https://github.com/stripe/stripe-php/pull/1351) Add a support section to the readme +* [#1304](https://github.com/stripe/stripe-php/pull/1304) Allow passing PSR-3 loggers to setLogger as they are compatible + +## 9.1.0 - 2022-08-11 +* [#1348](https://github.com/stripe/stripe-php/pull/1348) API Updates + * Add support for `payment_method_collection` on `Checkout.Session` and `PaymentLink` + +* [#1346](https://github.com/stripe/stripe-php/pull/1346) API Updates + * Add support for `expires_at` on `Apps.Secret` + +## 9.0.0 - 2022-08-02 + +Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v9. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01. + +"⚠️" symbol highlights breaking changes. + +* [#1344](https://github.com/stripe/stripe-php/pull/1344) API Updates +* [#1337](https://github.com/stripe/stripe-php/pull/1337) API Updates +* [#1273](https://github.com/stripe/stripe-php/pull/1273) Add some PHPDoc return types and fixes +* [#1341](https://github.com/stripe/stripe-php/pull/1341) Next major release changes + +### Added +* Add `alternate_statement_descriptors`, `authorization_code`, and `level3` properties to `Charge` resource. +* Add `previewLines` method to `CreditNote` resource. +* Add `transfer_data` property to `Subscription` resource. +* Add `SOURCE_TYPE_FPX` constant to `Transfer` resource. +* Add new error code constants to `ErrorObject`. +* Add support for `shipping_cost` and `shipping_details` on `Checkout.Session` + +### ⚠️ Changed +* Updated certificate bundle ([#1314](https://github.com/stripe/stripe-php/pull/1314)) +* Add `params` parameter to `close` method in `Dispute` resource. + +### ⚠️ Removed +* Remove deprecated `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `Recipient`, `RecipientTransfer`, and `ThreeDSecure` resources. +* Remove `CAPABILITY_CARD_PAYMENTS`, `CAPABILITY_LEGACY_PAYMENTS`, `CAPABILITY_PLATFORM_PAYMENTS`, `CAPABILITY_TRANSFERS`, `CAPABILITY_STATUS_ACTIVE`, `CAPABILITY_STATUS_INACTIVE`, and `CAPABILITY_STATUS_PENDING` constants from `Account` resource. Please use up-to-date values from https://stripe.com/docs/connect/account-capabilities. +* Remove `AssociatedObjects` array property from `EphemeralKey` resource. The field was undocumented and unsupported. +* Remove `details` method from `Card` resource. The endpoint was deprecated and no longer exists. +* Remove `recipient` property from `Card` resource. The property was deprecated. +* Remove ability to list `Card` resources for a particular `Recipient`. +* Remove `sources` property from `Card` resource. The property was deprecated. +* Remove `FAILURE_REASON` constant from `Refund` resource. The value was deprecated. +* Remove `Recipient` resource. The resource was deprecated. +* Remove `OrderItem` resource. The resource was deprecated. +* Remove `all` method from `LineItem`. +* Remove `cancel` method from `Transfer` and `TransferService`. This method is deprecated. +* Remove `allTransactions` method from `SourceService` service. Please use `allSourceTransactions` method instead. +* Remove `persons` method from `Account` resource. Please use `allPersons` method instead. +* Remove `sourceTransactions` method from `Source` resource. Please use `allSourceTransactions` method instead. +* Remove `usageRecordSummaries` method from `SubscriptionItem` resource. Please use `allUsageRecordSummaries` method instead. +* Remove `SOURCE_TYPE_ALIPAY_ACCOUNT` and `SOURCE_TYPE_FINANCING` constants from `Transfer` resource. The values were deprecated and are no longer in use. +* Remove deprecated error code constants from `ErrorObject`: `CODE_ACCOUNT_ALREADY_EXISTS`, `CODE_ORDER_CREATION_FAILED`, `CODE_ORDER_REQUIRED_SETTINGS`, `CODE_ORDER_STATUS_INVALID`, `CODE_ORDER_UPSTREAM_TIMEOUT`, and `CODE_UPSTREAM_ORDER_CREATION_FAILED`. +* Remove deprecated event constants from `Webhook`: `ISSUER_FRAUD_RECORD_CREATED`, ` ORDER_PAYMENT_FAILED`, `ORDER_PAYMENT_SUCCEEDED`, `ORDER_UPDATED`, `ORDER_RETURN_CREATED`, `PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED`, `PING`, `PROMOTION_CODE_DELETED`, and `TREASURY_RECEIVED_CREDIT_REVERSED`. The events are deprecated and no longer sent by Stripe. + +## 8.12.0 - 2022-07-25 +* [#1332](https://github.com/stripe/stripe-php/pull/1332) API Updates + * Add support for `default_currency` and `invoice_credit_balance` on `Customer` + + +## 8.11.0 - 2022-07-18 +* [#1324](https://github.com/stripe/stripe-php/pull/1324) API Updates + * Add support for new value `blik` on enum `PaymentLink.payment_method_types[]` + * Add support for `blik` on `PaymentMethod` + * Add support for new value `blik` on enum `PaymentMethod.type` + * Add `Invoice.upcomingLines` method. + * Add `SourceService.allSourceTransactions` method. +* [#1322](https://github.com/stripe/stripe-php/pull/1322) API Updates + * Change type of `source_type` on `Transfer` from nullable string to string (comment-only change) + +## 8.10.0 - 2022-07-07 +* [#1319](https://github.com/stripe/stripe-php/pull/1319) API Updates + * Add support for `currency_options` on `Coupon` and `Price` + * Add support for `currency` on `Subscription` +* [#1318](https://github.com/stripe/stripe-php/pull/1318) API Updates + * Add support for new values financial_connections.account.created, financial_connections.account.deactivated, financial_connections.account.disconnected, financial_connections.account.reactivated, and financial_connections.account.refreshed_balance on `Event`. + +## 8.9.0 - 2022-06-29 +* [#1316](https://github.com/stripe/stripe-php/pull/1316) API Updates + * Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card` + * Add support for `subtotal_excluding_tax` on `CreditNote` and `Invoice` + * Add support for `amount_excluding_tax` and `unit_amount_excluding_tax` on `CreditNoteLineItem` and `InvoiceLineItem` + * Add support for `total_excluding_tax` on `Invoice` + * Change type of `PaymentLink.payment_method_types[]` from `literal('card')` to `enum` + * Add support for `promptpay` on `PaymentMethod` + * Add support for new value `promptpay` on enum `PaymentMethod.type` + * Add support for `hosted_regulatory_receipt_url` and `reversal_details` on `Treasury.ReceivedCredit` and `Treasury.ReceivedDebit` + +## 8.8.0 - 2022-06-23 +* [#1302](https://github.com/stripe/stripe-php/pull/1302) API Updates + * Add support for `custom_unit_amount` on `Price` +* [#1301](https://github.com/stripe/stripe-php/pull/1301) API Updates + + Documentation updates. + +## 8.7.0 - 2022-06-17 +* [#1306](https://github.com/stripe/stripe-php/pull/1306) API Updates + * Add support for `fund_cash_balance` test helper method on resource `Customer` + * Add support for `total_excluding_tax` on `CreditNote` + * Add support for `rendering_options` on `Invoice` +* [#1307](https://github.com/stripe/stripe-php/pull/1307) Support updating pre-release versions +* [#1305](https://github.com/stripe/stripe-php/pull/1305) Trigger workflows on beta branches +* [#1302](https://github.com/stripe/stripe-php/pull/1302) API Updates + * Add support for `custom_unit_amount` on `Price` +* [#1301](https://github.com/stripe/stripe-php/pull/1301) API Updates + + Documentation updates. + +## 8.6.0 - 2022-06-08 +* [#1300](https://github.com/stripe/stripe-php/pull/1300) API Updates + * Add support for `attach_to_self` and `flow_directions` on `SetupAttempt` + +## 8.5.0 - 2022-06-01 +* [#1298](https://github.com/stripe/stripe-php/pull/1298) API Updates + * Add support for `radar_options` on `Charge` and `PaymentMethod` + * Add support for new value `simulated_wisepos_e` on enum `Terminal.Reader.device_type` + +## 8.4.0 - 2022-05-26 +* [#1296](https://github.com/stripe/stripe-php/pull/1296) API Updates + * Add support for `persons` method on resource `Account` + * Add support for `balance_transactions` method on resource `Customer` + * Add support for `id_number_secondary_provided` on `Person` +* [#1295](https://github.com/stripe/stripe-php/pull/1295) API Updates + + +## 8.3.0 - 2022-05-23 +* [#1294](https://github.com/stripe/stripe-php/pull/1294) API Updates + * Add support for new resource `Apps.Secret` + * Add support for `affirm` and `link` on `PaymentMethod` + * Add support for new values `affirm` and `link` on enum `PaymentMethod.type` +* [#1289](https://github.com/stripe/stripe-php/pull/1289) fix: Update RequestOptions#redactedApiKey to stop exploding null. + +## 8.2.0 - 2022-05-19 +* [#1286](https://github.com/stripe/stripe-php/pull/1286) API Updates + * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction` + * Add support for `retrieve_payment_method` method on resource `Customer` + * Add support for `all` and `list_owners` methods on resource `FinancialConnections.Account` + * Add support for `treasury` on `Issuing.Authorization`, `Issuing.Dispute`, and `Issuing.Transaction` + * Add support for `financial_account` on `Issuing.Card` + * Add support for `client_secret` on `Order` + * Add support for `attach_to_self` and `flow_directions` on `SetupIntent` + +## 8.1.0 - 2022-05-11 +* [#1284](https://github.com/stripe/stripe-php/pull/1284) API Updates + * Add support for `consent_collection`, `customer_creation`, `payment_intent_data`, `shipping_options`, `submit_type`, and `tax_id_collection` on `PaymentLink` + * Add support for `description` on `Subscription` + +## 8.0.0 - 2022-05-09 +* [#1283](https://github.com/stripe/stripe-php/pull/1283) Major version release of v8.0.0. The [migration guide](https://github.com/stripe/stripe-php/wiki/Migration-Guide-for-v8) contains more information. + (⚠️ = breaking changes): + * ⚠️ Replace the legacy `Order` API with the new `Order` API. + * Resource modified: `Order`. + * New methods: `cancel`, `list_line_items`, `reopen`, and `submit` + * Removed methods: `pay` and `return_order` + * Removed resources: `OrderItem` and `OrderReturn` + * Removed references from other resources: `Charge.order` + * ⚠️ Rename `\FinancialConnections\Account.refresh` method to `\FinancialConnections\Account.refresh_account` + * Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem` + +## 7.128.0 - 2022-05-05 +* [#1282](https://github.com/stripe/stripe-php/pull/1282) API Updates + * Add support for `default_price` on `Product` + * Add support for `instructions_email` on `Refund` + + +## 7.127.0 - 2022-05-05 +* [#1281](https://github.com/stripe/stripe-php/pull/1281) API Updates + * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` +* [#1278](https://github.com/stripe/stripe-php/pull/1278) Pin setup-php action version. +* [#1277](https://github.com/stripe/stripe-php/pull/1277) API Updates + * Add support for `registered_address` on `Person` + +## 7.126.0 - 2022-05-03 +* [#1276](https://github.com/stripe/stripe-php/pull/1276) API Updates + * Add support for new resource `CashBalance` + * Change type of `BillingPortal.Configuration.application` from `$Application` to `deletable($Application)` + * Add support for `cash_balance` on `Customer` + * Add support for `application` on `Invoice`, `Quote`, `SubscriptionSchedule`, and `Subscription` + * Add support for new value `eu_oss_vat` on enum `TaxId.type` +* [#1274](https://github.com/stripe/stripe-php/pull/1274) Fix PHPDoc on Discount for nullable properties +* [#1272](https://github.com/stripe/stripe-php/pull/1272) Allow users to pass a custom IPRESOLVE cURL option. + +## 7.125.0 - 2022-04-21 +* [#1270](https://github.com/stripe/stripe-php/pull/1270) API Updates + * Add support for `expire` test helper method on resource `Refund` + +## 7.124.0 - 2022-04-18 +* [#1265](https://github.com/stripe/stripe-php/pull/1265) API Updates + * Add support for new resources `FundingInstructions` and `Terminal.Configuration` + * Add support for `create_funding_instructions` method on resource `Customer` + * Add support for `amount_details` on `PaymentIntent` + * Add support for `customer_balance` on `PaymentMethod` + * Add support for new value `customer_balance` on enum `PaymentMethod.type` + * Add support for `configuration_overrides` on `Terminal.Location` + + +## 7.123.0 - 2022-04-13 +* [#1263](https://github.com/stripe/stripe-php/pull/1263) API Updates + * Add support for `increment_authorization` method on resource `PaymentIntent` +* [#1262](https://github.com/stripe/stripe-php/pull/1262) Add support for updating the version of the repo +* [#1230](https://github.com/stripe/stripe-php/pull/1230) Add PHPDoc return types +* [#1242](https://github.com/stripe/stripe-php/pull/1242) Fix some PHPDoc in tests + +## 7.122.0 - 2022-04-08 +* [#1261](https://github.com/stripe/stripe-php/pull/1261) API Updates + * Add support for `apply_customer_balance` method on resource `PaymentIntent` +* [#1259](https://github.com/stripe/stripe-php/pull/1259) API Updates + + * Add `payment_intent.partially_funded`, `terminal.reader.action_failed`, and `terminal.reader.action_succeeded` events. + +## 7.121.0 - 2022-03-30 +* [#1258](https://github.com/stripe/stripe-php/pull/1258) API Updates + * Add support for `cancel_action`, `process_payment_intent`, `process_setup_intent`, and `set_reader_display` methods on resource `Terminal.Reader` + * Add support for `action` on `Terminal.Reader` + +## 7.120.0 - 2022-03-29 +* [#1257](https://github.com/stripe/stripe-php/pull/1257) API Updates + * Add support for Search API + * Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription` + +## 7.119.0 - 2022-03-25 +* [#1256](https://github.com/stripe/stripe-php/pull/1256) API Updates + * Add support for PayNow and US Bank Accounts Debits payments + * Add support for `paynow` and `us_bank_account` on `PaymentMethod` + * Add support for new values `paynow` and `us_bank_account` on enum `PaymentMethod.type` + * Add support for `failure_balance_transaction` on `Charge` + +## 7.118.0 - 2022-03-23 +* [#1255](https://github.com/stripe/stripe-php/pull/1255) API Updates + * Add support for `cancel` method on resource `Refund` + * Add support for new values `bg_uic`, `hu_tin`, and `si_tin` on enum `TaxId.type` + * Add `test_helpers.test_clock.advancing`, `test_helpers.test_clock.created`, `test_helpers.test_clock.deleted`, `test_helpers.test_clock.internal_failure`, and `test_helpers.test_clock.ready` events. + + +## 7.117.0 - 2022-03-18 +* [#1254](https://github.com/stripe/stripe-php/pull/1254) API Updates + * Add support for `status` on `Card` +* [#1251](https://github.com/stripe/stripe-php/pull/1251) Add support for SearchResult objects. +* [#1249](https://github.com/stripe/stripe-php/pull/1249) Add missing constant for payment_behavior + +## 7.116.0 - 2022-03-02 +* [#1248](https://github.com/stripe/stripe-php/pull/1248) API Updates + * Add support for `proration_details` on `InvoiceLineItem` + + +## 7.115.0 - 2022-03-01 +* [#1245](https://github.com/stripe/stripe-php/pull/1245) [#1247](https://github.com/stripe/stripe-php/pull/1247) API Updates + * Add support for new resource `TestHelpers.TestClock` + * Add support for `test_clock` on `Customer`, `Invoice`, `InvoiceItem`, `Quote`, `Subscription`, and `SubscriptionSchedule` + * Add support for `next_action` on `Refund` + * Add support for `konbini` on `PaymentMethod` +* [#1244](https://github.com/stripe/stripe-php/pull/1244) API Updates + * Add support for new values `bbpos_wisepad3` and `stripe_m2` on enum `Terminal.Reader.device_type` + +## 7.114.0 - 2022-02-15 +* [#1243](https://github.com/stripe/stripe-php/pull/1243) Add test +* [#1240](https://github.com/stripe/stripe-php/pull/1240) API Updates + * Add support for `verify_microdeposits` method on resources `PaymentIntent` and `SetupIntent` +* [#1241](https://github.com/stripe/stripe-php/pull/1241) Add generic parameter to \Stripe\Collection usages + +## 7.113.0 - 2022-02-03 +* [#1239](https://github.com/stripe/stripe-php/pull/1239) API Updates + * Add `REASON_EXPIRED_UNCAPTURED_CHARGE` enum value on `Refund`. + +## 7.112.0 - 2022-01-25 +* [#1235](https://github.com/stripe/stripe-php/pull/1235) API Updates + * Add support for `phone_number_collection` on `PaymentLink` + * Add support for new value `is_vat` on enum `TaxId.type` + + +## 7.111.0 - 2022-01-20 +* [#1233](https://github.com/stripe/stripe-php/pull/1233) API Updates + * Add support for new resource `PaymentLink` + * Add support for `payment_link` on `Checkout.Session` + +## 7.110.0 - 2022-01-13 +* [#1232](https://github.com/stripe/stripe-php/pull/1232) API Updates + * Add support for `paid_out_of_band` on `Invoice` + +## 7.109.0 - 2022-01-12 +* [#1231](https://github.com/stripe/stripe-php/pull/1231) API Updates + * Add support for `customer_creation` on `Checkout.Session` +* [#1227](https://github.com/stripe/stripe-php/pull/1227) Update docs URLs + +## 7.108.0 - 2021-12-22 +* [#1226](https://github.com/stripe/stripe-php/pull/1226) Upgrade php-cs-fixer to 3.4.0. +* [#1222](https://github.com/stripe/stripe-php/pull/1222) API Updates + * Add support for `processing` on `PaymentIntent` +* [#1220](https://github.com/stripe/stripe-php/pull/1220) API Updates + +## 7.107.0 - 2021-12-09 +* [#1219](https://github.com/stripe/stripe-php/pull/1219) API Updates + * Add support for `metadata` on `BillingPortal.Configuration` + * Add support for `wallets` on `Issuing.Card` + +## 7.106.0 - 2021-12-09 +* [#1218](https://github.com/stripe/stripe-php/pull/1218) API Updates + * Add support for new values `ge_vat` and `ua_vat` on enum `TaxId.type` +* [#1216](https://github.com/stripe/stripe-php/pull/1216) Fix namespaced classes in @return PHPDoc. +* [#1214](https://github.com/stripe/stripe-php/pull/1214) Announce PHP8 support in CHANGELOG.md + +## 7.105.0 - 2021-12-06 +* [#1213](https://github.com/stripe/stripe-php/pull/1213) PHP 8.1 missing ReturnTypeWillChange annotations. +* As of this version, PHP 8.1 is officially supported. + +## 7.104.0 - 2021-12-01 +* [#1211](https://github.com/stripe/stripe-php/pull/1211) PHPStan compatibility with PHP8.x +* [#1209](https://github.com/stripe/stripe-php/pull/1209) PHPUnit compatibility with PHP 8.x + +## 7.103.0 - 2021-11-19 +* [#1206](https://github.com/stripe/stripe-php/pull/1206) API Updates + * Add support for new value `jct` on enum `TaxRate.tax_type` + +## 7.102.0 - 2021-11-17 +* [#1205](https://github.com/stripe/stripe-php/pull/1205) API Updates + * Add support for `automatic_payment_methods` on `PaymentIntent` + +## 7.101.0 - 2021-11-16 +* [#1203](https://github.com/stripe/stripe-php/pull/1203) API Updates + * Add support for new resource `ShippingRate` + * Add support for `shipping_options` and `shipping_rate` on `Checkout.Session` + * Add support for `expire` method on resource `Checkout.Session` + * Add support for `status` on `Checkout.Session` + +## 7.100.0 - 2021-10-11 +* [#1190](https://github.com/stripe/stripe-php/pull/1190) API Updates + * Add support for `klarna` on `PaymentMethod`. + +## 7.99.0 - 2021-10-11 +* [#1188](https://github.com/stripe/stripe-php/pull/1188) API Updates + * Add support for `list_payment_methods` method on resource `Customer` + +## 7.98.0 - 2021-10-07 +* [#1187](https://github.com/stripe/stripe-php/pull/1187) API Updates + * Add support for `phone_number_collection` on `Checkout.Session` + * Add support for new value `customer_id` on enum `Radar.ValueList.item_type` + * Add support for new value `bbpos_wisepos_e` on enum `Terminal.Reader.device_type` + +## 7.97.0 - 2021-09-16 +* [#1181](https://github.com/stripe/stripe-php/pull/1181) API Updates + * Add support for `full_name_aliases` on `Person` + +## 7.96.0 - 2021-09-15 +* [#1178](https://github.com/stripe/stripe-php/pull/1178) API Updates + * Add support for livemode on Reporting.ReportType + * Add support for new value `rst` on enum `TaxRate.tax_type` + +## 7.95.0 - 2021-09-01 +* [#1177](https://github.com/stripe/stripe-php/pull/1177) API Updates + * Add support for `future_requirements` on `Account`, `Capability`, and `Person` + * Add support for `after_expiration`, `consent`, `consent_collection`, `expires_at`, and `recovered_from` on `Checkout.Session` + +## 7.94.0 - 2021-08-19 +* [#1173](https://github.com/stripe/stripe-php/pull/1173) API Updates + * Add support for new value `fil` on enum `Checkout.Session.locale` + * Add support for new value `au_arn` on enum `TaxId.type` + +## 7.93.0 - 2021-08-11 +* [#1172](https://github.com/stripe/stripe-php/pull/1172) API Updates + * Add support for `locale` on `BillingPortal.Session` + +* [#1171](https://github.com/stripe/stripe-php/pull/1171) Fix typo in docblock `CurlClient::executeStreamingRequestWithRetries` + +## 7.92.0 - 2021-07-28 +* [#1167](https://github.com/stripe/stripe-php/pull/1167) API Updates + * Add support for `account_type` on `BankAccount` + * Add support for new value `redacted` on enum `Review.closed_reason` + +## 7.91.0 - 2021-07-22 +* [#1164](https://github.com/stripe/stripe-php/pull/1164) API Updates + * Add support for new values `hr`, `ko`, and `vi` on enum `Checkout.Session.locale` + * Add support for `payment_settings` on `Subscription` + +## 7.90.0 - 2021-07-20 +* [#1163](https://github.com/stripe/stripe-php/pull/1163) API Updates + * Add support for `wallet` on `Issuing.Transaction` +* [#1160](https://github.com/stripe/stripe-php/pull/1160) Remove unused API error types from docs. + +## 7.89.0 - 2021-07-14 +* [#1158](https://github.com/stripe/stripe-php/pull/1158) API Updates + * Add support for `list_computed_upfront_line_items` method on resource `Quote` +* [#1157](https://github.com/stripe/stripe-php/pull/1157) Improve readme for old PHP versions + +## 7.88.0 - 2021-07-09 +* [#1152](https://github.com/stripe/stripe-php/pull/1152) API Updates + * Add support for new resource `Quote` + * Add support for `quote` on `Invoice` + * Add support for new value `quote_accept` on enum `Invoice.billing_reason` +* [#1155](https://github.com/stripe/stripe-php/pull/1155) Add streaming methods to Service infra + * Add support for `setStreamingHttpClient` and `streamingHttpClient` to `ApiRequestor` + * Add support for `getStreamingClient` and `requestStream` to `AbstractService` + * Add support for `requestStream` to `BaseStripeClient` + * `\Stripe\RequestOptions::parse` now clones its input if it is already a `RequestOptions` object, to prevent accidental mutation. +* [#1151](https://github.com/stripe/stripe-php/pull/1151) Add `mode` constants into Checkout\Session + +## 7.87.0 - 2021-06-30 +* [#1149](https://github.com/stripe/stripe-php/pull/1149) API Updates + * Add support for `wechat_pay` on `PaymentMethod` +* [#1143](https://github.com/stripe/stripe-php/pull/1143) Streaming requests +* [#1138](https://github.com/stripe/stripe-php/pull/1138) Deprecate travis + +## 7.86.0 - 2021-06-25 +* [#1145](https://github.com/stripe/stripe-php/pull/1145) API Updates + * Add support for `boleto` on `PaymentMethod`. + * Add support for `il_vat` as a member of the `TaxID.Type` enum. + +## 7.85.0 - 2021-06-18 +* [#1142](https://github.com/stripe/stripe-php/pull/1142) API Updates + * Add support for new TaxId types: `ca_pst_mb`, `ca_pst_bc`, `ca_gst_hst`, and `ca_pst_sk`. + +## 7.84.0 - 2021-06-16 +* [#1141](https://github.com/stripe/stripe-php/pull/1141) Update PHPDocs + * Add support for `url` on `Checkout\Session` + + +## 7.83.0 - 2021-06-07 +* [#1140](https://github.com/stripe/stripe-php/pull/1140) API Updates + * Added support for `tax_id_collection` on `Checkout\Session` and `Checkout\Session#create` + * Update `Location` to be expandable on `Terminal\Reader` + +## 7.82.0 - 2021-06-04 +* [#1136](https://github.com/stripe/stripe-php/pull/1136) Update PHPDocs + * Add support for `controller` on `Account`. + +## 7.81.0 - 2021-06-04 +* [#1135](https://github.com/stripe/stripe-php/pull/1135) API Updates + * Add support for new resource `TaxCode` + * Add support for `automatic_tax` `Invoice` and`Checkout.Session`. + * Add support for `tax_behavior` on `Price` + * Add support for `tax_code` on `Product` + * Add support for `tax` on `Customer` + * Add support for `tax_type` enum on `TaxRate` + +## 7.80.0 - 2021-05-26 +* [#1130](https://github.com/stripe/stripe-php/pull/1130) Update PHPDocs + +## 7.79.0 - 2021-05-19 +* [#1126](https://github.com/stripe/stripe-php/pull/1126) API Updates + * Added support for new resource `Identity.VerificationReport` + * Added support for new resource `Identity.VerificationSession` + * `File#list.purpose` and `File.purpose` added new enum members: `identity_document_downloadable` and `selfie`. + +## 7.78.0 - 2021-05-05 +* [#1120](https://github.com/stripe/stripe-php/pull/1120) Update PHPDocs + * Add support for `Radar.EarlyFraudWarning.payment_intent` + +## 7.77.0 - 2021-04-12 +* [#1110](https://github.com/stripe/stripe-php/pull/1110) Update PHPDocs + * Add support for `acss_debit` on `PaymentMethod` + * Add support for `payment_method_options` on `Checkout\Session` +* [#1107](https://github.com/stripe/stripe-php/pull/1107) Remove duplicate object phpdoc + +## 7.76.0 - 2021-03-22 +* [#1100](https://github.com/stripe/stripe-php/pull/1100) Update PHPDocs + * Added support for `amount_shipping` on `Checkout.Session.total_details` +* [#1088](https://github.com/stripe/stripe-php/pull/1088) Make possibility to extend CurlClient + +## 7.75.0 - 2021-02-22 +* [#1094](https://github.com/stripe/stripe-php/pull/1094) Add support for Billing Portal Configuration API + +## 7.74.0 - 2021-02-17 +* [#1093](https://github.com/stripe/stripe-php/pull/1093) Update PHPDocs + * Add support for on_behalf_of to Invoice + +## 7.73.0 - 2021-02-16 +* [#1091](https://github.com/stripe/stripe-php/pull/1091) Update PHPDocs + * Add support for `afterpay_clearpay` on `PaymentMethod`. + +## 7.72.0 - 2021-02-08 +* [#1089](https://github.com/stripe/stripe-php/pull/1089) Update PHPDocs + * Add support for `afterpay_clearpay_payments` on `Account.capabilities` + * Add support for `payment_settings` on `Invoice` + +## 7.71.0 - 2021-02-05 +* [#1087](https://github.com/stripe/stripe-php/pull/1087) Update PHPDocs +* [#1086](https://github.com/stripe/stripe-php/pull/1086) Update CA cert bundle URL + +## 7.70.0 - 2021-02-03 +* [#1085](https://github.com/stripe/stripe-php/pull/1085) Update PHPDocs + * Add support for `nationality` on `Person` + * Add member `gb_vat` of `TaxID` enum + + +## 7.69.0 - 2021-01-21 +* [#1079](https://github.com/stripe/stripe-php/pull/1079) Update PHPDocs + +## 7.68.0 - 2021-01-14 +* [#1063](https://github.com/stripe/stripe-php/pull/1063) Multiple API changes +* [#1061](https://github.com/stripe/stripe-php/pull/1061) Bump phpDocumentor to 3.0.0 + ## 7.67.0 - 2020-12-09 * [#1060](https://github.com/stripe/stripe-php/pull/1060) Improve PHPDocs for `Discount` * [#1059](https://github.com/stripe/stripe-php/pull/1059) Upgrade PHPStan to 0.12.59 diff --git a/htdocs/includes/stripe/stripe-php/CODE_OF_CONDUCT.md b/htdocs/includes/stripe/stripe-php/CODE_OF_CONDUCT.md deleted file mode 100644 index 349f5a0bfd7..00000000000 --- a/htdocs/includes/stripe/stripe-php/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,77 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to make participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies within all project spaces, and it also applies when -an individual is representing the project or its community in public spaces. -Examples of representing a project or community include using an official -project e-mail address, posting via an official social media account, or acting -as an appointed representative at an online or offline event. Representation of -a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at conduct@stripe.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq - diff --git a/htdocs/includes/stripe/stripe-php/Makefile b/htdocs/includes/stripe/stripe-php/Makefile deleted file mode 100644 index 8de55c18222..00000000000 --- a/htdocs/includes/stripe/stripe-php/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -export PHPDOCUMENTOR_VERSION := v3.0.0-rc -export PHPSTAN_VERSION := 0.12.59 - -vendor: composer.json - composer install - -vendor/bin/phpstan: vendor - curl -sfL https://github.com/phpstan/phpstan/releases/download/$(PHPSTAN_VERSION)/phpstan.phar -o vendor/bin/phpstan - chmod +x vendor/bin/phpstan - -vendor/bin/phpdoc: vendor - curl -sfL https://github.com/phpDocumentor/phpDocumentor/releases/download/$(PHPDOCUMENTOR_VERSION)/phpDocumentor.phar -o vendor/bin/phpdoc - chmod +x vendor/bin/phpdoc - -test: vendor - vendor/bin/phpunit -.PHONY: test - -fmt: vendor - vendor/bin/php-cs-fixer fix -v --using-cache=no . -.PHONY: fmt - -fmtcheck: vendor - vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no . -.PHONY: fmtcheck - -phpdoc: vendor/bin/phpdoc - vendor/bin/phpdoc - -phpstan: vendor/bin/phpstan - php -d memory_limit=512M vendor/bin/phpstan analyse lib tests -.PHONY: phpstan - -phpstan-baseline: vendor/bin/phpstan - php -d memory_limit=512M vendor/bin/phpstan analyse lib tests --generate-baseline -.PHONY: phpstan-baseline diff --git a/htdocs/includes/stripe/stripe-php/OPENAPI_VERSION b/htdocs/includes/stripe/stripe-php/OPENAPI_VERSION new file mode 100644 index 00000000000..3c2b47ae767 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/OPENAPI_VERSION @@ -0,0 +1 @@ +v232 \ No newline at end of file diff --git a/htdocs/includes/stripe/stripe-php/README.md b/htdocs/includes/stripe/stripe-php/README.md index 1be6aa1beff..e85892ecdd1 100644 --- a/htdocs/includes/stripe/stripe-php/README.md +++ b/htdocs/includes/stripe/stripe-php/README.md @@ -1,6 +1,6 @@ # Stripe PHP bindings -[![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php) +[![Build Status](https://github.com/stripe/stripe-php/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-php/actions?query=branch%3Amaster) [![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) [![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) [![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) @@ -27,7 +27,7 @@ composer require stripe/stripe-php To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): ```php -require_once('vendor/autoload.php'); +require_once 'vendor/autoload.php'; ``` ## Manual Installation @@ -35,7 +35,7 @@ require_once('vendor/autoload.php'); If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file. ```php -require_once('/path/to/stripe-php/init.php'); +require_once '/path/to/stripe-php/init.php'; ``` ## Dependencies @@ -68,21 +68,26 @@ You can continue to use the legacy integration patterns used prior to version [7 ## Documentation -See the [PHP API docs](https://stripe.com/docs/api/php#intro). +See the [PHP API docs](https://stripe.com/docs/api/?lang=php#intro). + +See [video demonstrations][youtube-playlist] covering how to use the library. ## Legacy Version Support ### PHP 5.4 & 5.5 -If you are using PHP 5.4 or 5.5, you can download v6.21.1 ([zip](https://github.com/stripe/stripe-php/archive/v6.21.1.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v6.21.1.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. +If you are using PHP 5.4 or 5.5, you should consider upgrading your environment as those versions have been past end of life since September 2015 and July 2016 respectively. +Otherwise, you can still use Stripe by downloading stripe-php v6.43.1 ([zip](https://github.com/stripe/stripe-php/archive/v6.43.1.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/6.43.1.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will work but might not support recent features we added since the version was released and upgrading PHP is the best course of action. ### PHP 5.3 -If you are using PHP 5.3, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. +If you are using PHP 5.3, you should upgrade your environment as this version has been past end of life since August 2014. +Otherwise, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. ## Custom Request Timeouts -_NOTE:_ We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic. +> **Note** +> We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/?lang=php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic. To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient. @@ -196,6 +201,32 @@ You can disable this behavior if you prefer: \Stripe\Stripe::setEnableTelemetry(false); ``` +### Beta SDKs + +Stripe has features in the beta phase that can be accessed via the beta version of this package. +We would love for you to try these and share feedback with us before these features reach the stable phase. +Use the `composer require` command with an exact version specified to install the beta version of the stripe-php pacakge. + + +```bash +composer require stripe/stripe-php:v9.2.0-beta.1 +``` + +> **Note** +> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your composer.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. + +We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. + +If your beta feature requires a `Stripe-Version` header to be sent, use the `apiVersion` property of `config` object to set it: + +```php +Stripe::setApiVersion(Stripe::getApiVersion() . '; feature_beta=v3'); +``` + +## Support + +New features and bug fixes are released on the latest major version of the Stripe PHP library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. + ## Development Get [Composer][composer]. For example, on Mac OS: @@ -228,7 +259,7 @@ Install dependencies as mentioned above (which will resolve [PHPUnit](http://pac Or to run an individual test file: ```bash -./vendor/bin/phpunit tests/UtilTest.php +./vendor/bin/phpunit tests/Stripe/UtilTest.php ``` Update bundled CA certificates from the [Mozilla cURL release][curl]: @@ -260,7 +291,8 @@ See the "SSL / TLS compatibility issues" paragraph above for full context. If yo [composer]: https://getcomposer.org/ [connect]: https://stripe.com/connect [curl]: http://curl.haxx.se/docs/caextract.html -[idempotency-keys]: https://stripe.com/docs/api/php#idempotent_requests +[idempotency-keys]: https://stripe.com/docs/api/?lang=php#idempotent_requests [php-cs-fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [psr3]: http://www.php-fig.org/psr/psr-3/ [stripe-mock]: https://github.com/stripe/stripe-mock +[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M6cUbiHrfMkXxZ9j9SGBxFE diff --git a/htdocs/includes/stripe/stripe-php/VERSION b/htdocs/includes/stripe/stripe-php/VERSION index 6a09420b3d9..1bcdaf5fec0 100644 --- a/htdocs/includes/stripe/stripe-php/VERSION +++ b/htdocs/includes/stripe/stripe-php/VERSION @@ -1 +1 @@ -7.67.0 +10.7.0 diff --git a/htdocs/includes/stripe/stripe-php/build.php b/htdocs/includes/stripe/stripe-php/build.php deleted file mode 100644 index 2d2837a0852..00000000000 --- a/htdocs/includes/stripe/stripe-php/build.php +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env php -create and manage Express or - * Custom accounts. + * For Custom accounts, the properties below are always returned. For other + * accounts, some properties are returned until that account has started to go + * through Connect Onboarding. Once you create an Account Link for a Standard + * or Express account, some parameters are no longer returned. These are marked as + * Custom Only or Custom and Express below. Learn + * about the differences between + * accounts. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\StripeObject $business_profile Business information about the account. * @property null|string $business_type The business type. - * @property \Stripe\StripeObject $capabilities - * @property bool $charges_enabled Whether the account can create live charges. - * @property \Stripe\StripeObject $company - * @property string $country The account's country. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. - * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. - * @property null|string $email The primary user's email address. - * @property \Stripe\Collection $external_accounts External accounts (bank accounts and debit cards) currently attached to this account - * @property \Stripe\Person $individual

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

Related guide: Handling Identity Verification with the API.

- * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property bool $payouts_enabled Whether Stripe can send payouts to this account. - * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $capabilities + * @property null|bool $charges_enabled Whether the account can create live charges. + * @property null|\Stripe\StripeObject $company + * @property null|\Stripe\StripeObject $controller + * @property null|string $country The account's country. + * @property null|int $created Time at which the account was connected. Measured in seconds since the Unix epoch. + * @property null|string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. + * @property null|bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * @property null|string $email An email address associated with the account. You can treat this as metadata: it is not used for authentication or messaging account holders. + * @property null|\Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> $external_accounts External accounts (bank accounts and debit cards) currently attached to this account + * @property null|\Stripe\StripeObject $future_requirements + * @property null|\Stripe\Person $individual

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

A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

Related guide: Handling Identity Verification with the API.

+ * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|bool $payouts_enabled Whether Stripe can send payouts to this account. + * @property null|\Stripe\StripeObject $requirements * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. - * @property \Stripe\StripeObject $tos_acceptance - * @property string $type The Stripe account type. Can be standard, express, or custom. + * @property null|\Stripe\StripeObject $tos_acceptance + * @property null|string $type The Stripe account type. Can be standard, express, or custom. */ class Account extends ApiResource { @@ -49,15 +56,6 @@ class Account extends ApiResource const BUSINESS_TYPE_INDIVIDUAL = 'individual'; const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; - const CAPABILITY_CARD_PAYMENTS = 'card_payments'; - const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; - const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; - const CAPABILITY_TRANSFERS = 'transfers'; - - const CAPABILITY_STATUS_ACTIVE = 'active'; - const CAPABILITY_STATUS_INACTIVE = 'inactive'; - const CAPABILITY_STATUS_PENDING = 'pending'; - const TYPE_CUSTOM = 'custom'; const TYPE_EXPRESS = 'express'; const TYPE_STANDARD = 'standard'; @@ -88,6 +86,25 @@ class Account extends ApiResource return parent::instanceUrl(); } + /** + * @param null|array|string $id the ID of the account to retrieve, or an + * options array containing an `id` key + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public static function retrieve($id = null, $opts = null) + { + if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { + $opts = $id; + $id = null; + } + + return self::_retrieve($id, $opts); + } + public function serializeParameters($force = false) { $update = parent::serializeParameters($force); @@ -139,25 +156,6 @@ class Account extends ApiResource return $updateArr; } - /** - * @param null|array|string $id the ID of the account to retrieve, or an - * options array containing an `id` key - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Account - */ - public static function retrieve($id = null, $opts = null) - { - if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { - $opts = $id; - $id = null; - } - - return self::_retrieve($id, $opts); - } - /** * @param null|array $clientId * @param null|array|string $opts @@ -182,25 +180,7 @@ class Account extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of persons - */ - public function persons($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/persons'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return Account the rejected account + * @return \Stripe\Account the rejected account */ public function reject($params = null, $opts = null) { @@ -211,12 +191,6 @@ class Account extends ApiResource return $this; } - /* - * Capabilities methods - * We can not add the capabilities() method today as the Account object already has a - * capabilities property which is a hash and not the sub-list of capabilities. - */ - const PATH_CAPABILITIES = '/capabilities'; /** @@ -226,7 +200,7 @@ class Account extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of capabilities + * @return \Stripe\Collection<\Stripe\Capability> the list of capabilities */ public static function allCapabilities($id, $params = null, $opts = null) { @@ -262,7 +236,6 @@ class Account extends ApiResource { return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); } - const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; /** @@ -272,7 +245,7 @@ class Account extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of external accounts (BankAccount or Card) + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> the list of external accounts (BankAccount or Card) */ public static function allExternalAccounts($id, $params = null, $opts = null) { @@ -337,7 +310,6 @@ class Account extends ApiResource { return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); } - const PATH_LOGIN_LINKS = '/login_links'; /** @@ -353,7 +325,6 @@ class Account extends ApiResource { return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); } - const PATH_PERSONS = '/persons'; /** @@ -363,7 +334,7 @@ class Account extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of persons + * @return \Stripe\Collection<\Stripe\Person> the list of persons */ public static function allPersons($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/AlipayAccount.php b/htdocs/includes/stripe/stripe-php/lib/AlipayAccount.php deleted file mode 100644 index 1d6a5096fff..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/AlipayAccount.php +++ /dev/null @@ -1,75 +0,0 @@ -json, $options]; } + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + protected function _requestStream($method, $url, $readBodyChunk, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + static::_staticStreamingRequest($method, $url, $readBodyChunk, $params, $opts); + } + /** * @param string $method HTTP method ('get', 'post', etc.) * @param string $url URL for the request @@ -65,4 +80,21 @@ trait Request return [$response, $opts]; } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param callable $readBodyChunk function that will receive chunks of data from a successful request body + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + protected static function _staticStreamingRequest($method, $url, $readBodyChunk, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + $requestor->requestStream($method, $url, $readBodyChunk, $params, $opts->headers); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Search.php b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Search.php new file mode 100644 index 00000000000..09472ebaa3f --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Search.php @@ -0,0 +1,37 @@ +json, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setLastResponse($response); + $obj->setFilters($params); + + return $obj; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/ApiOperations/SingletonRetrieve.php b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/SingletonRetrieve.php new file mode 100644 index 00000000000..baae67e12fd --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/SingletonRetrieve.php @@ -0,0 +1,30 @@ +refresh(); + + return $instance; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Update.php b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Update.php index 688f0808a79..9fde1e4f738 100644 --- a/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Update.php +++ b/htdocs/includes/stripe/stripe-php/lib/ApiOperations/Update.php @@ -37,6 +37,10 @@ trait Update * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return static the saved resource + * + * @deprecated The `save` method is deprecated and will be removed in a + * future major version of the library. Use the static method `update` + * on the resource instead. */ public function save($opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/ApiRequestor.php b/htdocs/includes/stripe/stripe-php/lib/ApiRequestor.php index 048c462c066..7162e33b532 100644 --- a/htdocs/includes/stripe/stripe-php/lib/ApiRequestor.php +++ b/htdocs/includes/stripe/stripe-php/lib/ApiRequestor.php @@ -21,6 +21,10 @@ class ApiRequestor * @var HttpClient\ClientInterface */ private static $_httpClient; + /** + * @var HttpClient\StreamingClientInterface + */ + private static $_streamingHttpClient; /** * @var RequestTelemetry @@ -123,6 +127,26 @@ class ApiRequestor return [$resp, $myApiKey]; } + /** + * @param string $method + * @param string $url + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + */ + public function requestStream($method, $url, $readBodyChunkCallable, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable); + if ($rcode >= 300) { + $this->_interpretResponse($rbody, $rcode, $rheaders); + } + } + /** * @param string $rbody a JSON string * @param int $rcode @@ -271,9 +295,8 @@ class ApiRequestor /** * @static * - * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') + * @param string $disableFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled - * @param mixed $disableFunctionsOutput * * @return bool */ @@ -328,18 +351,7 @@ class ApiRequestor ]; } - /** - * @param string $method - * @param string $url - * @param array $params - * @param array $headers - * - * @throws Exception\AuthenticationException - * @throws Exception\ApiConnectionException - * - * @return array - */ - private function _requestRaw($method, $url, $params, $headers) + private function _prepareRequest($method, $url, $params, $headers) { $myApiKey = $this->_apiKey; if (!$myApiKey) { @@ -416,6 +428,24 @@ class ApiRequestor $rawHeaders[] = $header . ': ' . $value; } + return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRaw($method, $url, $params, $headers) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + $requestStartMs = Util\Util::currentTimeMillis(); list($rbody, $rcode, $rheaders) = $this->httpClient()->request( @@ -428,7 +458,46 @@ class ApiRequestor if (isset($rheaders['request-id']) && \is_string($rheaders['request-id']) - && \strlen($rheaders['request-id']) > 0) { + && '' !== $rheaders['request-id']) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * @param callable $readBodyChunkCallable + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRawStreaming($method, $url, $params, $headers, $readBodyChunkCallable) + { + list($absUrl, $rawHeaders, $params, $hasFile, $myApiKey) = $this->_prepareRequest($method, $url, $params, $headers); + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->streamingHttpClient()->requestStream( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile, + $readBodyChunkCallable + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && '' !== $rheaders['request-id']) { self::$requestTelemetry = new RequestTelemetry( $rheaders['request-id'], Util\Util::currentTimeMillis() - $requestStartMs @@ -502,6 +571,16 @@ class ApiRequestor self::$_httpClient = $client; } + /** + * @static + * + * @param HttpClient\StreamingClientInterface $client + */ + public static function setStreamingHttpClient($client) + { + self::$_streamingHttpClient = $client; + } + /** * @static * @@ -523,4 +602,16 @@ class ApiRequestor return self::$_httpClient; } + + /** + * @return HttpClient\StreamingClientInterface + */ + private function streamingHttpClient() + { + if (!self::$_streamingHttpClient) { + self::$_streamingHttpClient = HttpClient\CurlClient::instance(); + } + + return self::$_streamingHttpClient; + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/ApiResource.php b/htdocs/includes/stripe/stripe-php/lib/ApiResource.php index 521010b3f7c..25c6b84a0ee 100644 --- a/htdocs/includes/stripe/stripe-php/lib/ApiResource.php +++ b/htdocs/includes/stripe/stripe-php/lib/ApiResource.php @@ -82,6 +82,8 @@ abstract class ApiResource extends StripeObject { // Replace dots with slashes for namespaced resources, e.g. if the object's name is // "foo.bar", then its URL will be "/v1/foo/bars". + + /** @phpstan-ignore-next-line */ $base = \str_replace('.', '/', static::OBJECT_NAME); return "/v1/{$base}s"; diff --git a/htdocs/includes/stripe/stripe-php/lib/ApplicationFee.php b/htdocs/includes/stripe/stripe-php/lib/ApplicationFee.php index 88aeed64553..2a53204a8aa 100644 --- a/htdocs/includes/stripe/stripe-php/lib/ApplicationFee.php +++ b/htdocs/includes/stripe/stripe-php/lib/ApplicationFee.php @@ -18,7 +18,7 @@ namespace Stripe; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection $refunds A list of refunds that have been applied to the fee. + * @property \Stripe\Collection<\Stripe\StripeObject> $refunds A list of refunds that have been applied to the fee. */ class ApplicationFee extends ApiResource { @@ -37,7 +37,7 @@ class ApplicationFee extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of fee refunds + * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> the list of fee refunds */ public static function allRefunds($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Apps/Secret.php b/htdocs/includes/stripe/stripe-php/lib/Apps/Secret.php new file mode 100644 index 00000000000..bd0d777f43a --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Apps/Secret.php @@ -0,0 +1,79 @@ +secret. Other apps can't + * view secrets created by an app. Additionally, secrets are scoped to provide + * further permission control. + * + * All Dashboard users and the app backend share account scoped + * secrets. Use the account scope for secrets that don't change + * per-user, like a third-party API key. + * + * A user scoped secret is accessible by the app backend and one + * specific Dashboard user. Use the user scope for per-user secrets + * like per-user OAuth tokens, where different users might have different + * permissions. + * + * Related guide: Store + * data between page reloads. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|int $expires_at The Unix timestamp for the expiry time of the secret, after which the secret deletes. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $name A name for the secret that's unique within the scope. + * @property null|string $payload The plaintext secret value to be stored. + * @property \Stripe\StripeObject $scope + */ +class Secret extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'apps.secret'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Apps\Secret the deleted secret + */ + public static function deleteWhere($params = null, $opts = null) + { + $url = static::classUrl() . '/delete'; + list($response, $opts) = static::_staticRequest('post', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Apps\Secret the finded secret + */ + public static function find($params = null, $opts = null) + { + $url = static::classUrl() . '/find'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Balance.php b/htdocs/includes/stripe/stripe-php/lib/Balance.php index 0fdc2850c41..92622c21d93 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Balance.php +++ b/htdocs/includes/stripe/stripe-php/lib/Balance.php @@ -21,9 +21,9 @@ namespace Stripe; * * @property string $object String representing the object's type. Objects of the same type share the same value. * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. - * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. - * @property \Stripe\StripeObject $issuing + * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. + * @property null|\Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property null|\Stripe\StripeObject $issuing * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. */ @@ -31,15 +31,5 @@ class Balance extends SingletonApiResource { const OBJECT_NAME = 'balance'; - /** - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Balance - */ - public static function retrieve($opts = null) - { - return self::_singletonRetrieve($opts); - } + use ApiOperations\SingletonRetrieve; } diff --git a/htdocs/includes/stripe/stripe-php/lib/BankAccount.php b/htdocs/includes/stripe/stripe-php/lib/BankAccount.php index 40eca41c5f5..57fd19be562 100644 --- a/htdocs/includes/stripe/stripe-php/lib/BankAccount.php +++ b/htdocs/includes/stripe/stripe-php/lib/BankAccount.php @@ -23,6 +23,7 @@ namespace Stripe; * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. * @property null|string $account_holder_name The name of the person or business that owns the bank account. * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. + * @property null|string $account_type The bank account type. This can only be checking or savings in most countries. In Japan, this can only be futsu or toza. * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). * @property string $country Two-letter ISO code representing the country the bank account is located in. diff --git a/htdocs/includes/stripe/stripe-php/lib/BaseStripeClient.php b/htdocs/includes/stripe/stripe-php/lib/BaseStripeClient.php index 5499fe3a847..b0b2e7e57b2 100644 --- a/htdocs/includes/stripe/stripe-php/lib/BaseStripeClient.php +++ b/htdocs/includes/stripe/stripe-php/lib/BaseStripeClient.php @@ -2,7 +2,7 @@ namespace Stripe; -class BaseStripeClient implements StripeClientInterface +class BaseStripeClient implements StripeClientInterface, StripeStreamingClientInterface { /** @var string default base URL for Stripe's API */ const DEFAULT_API_BASE = 'https://api.stripe.com'; @@ -139,6 +139,25 @@ class BaseStripeClient implements StripeClientInterface return $obj; } + /** + * Sends a request to Stripe's API, passing chunks of the streamed response + * into a user-provided $readBodyChunkCallable callback. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param callable $readBodyChunkCallable a function that will be called + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * with chunks of bytes from the body if the request is successful + */ + public function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) + { + $opts = $this->defaultOpts->merge($opts, true); + $baseUrl = $opts->apiBase ?: $this->getApiBase(); + $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response, $opts->apiKey) = $requestor->requestStream($method, $path, $readBodyChunkCallable, $params, $opts->headers); + } + /** * Sends a request to Stripe's API. * @@ -163,6 +182,30 @@ class BaseStripeClient implements StripeClientInterface return $obj; } + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\SearchResult of ApiResources + */ + public function requestSearchResult($method, $path, $params, $opts) + { + $obj = $this->request($method, $path, $params, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + $received_class = \get_class($obj); + $msg = "Expected to receive `Stripe\\SearchResult` object from Stripe API. Instead received `{$received_class}`."; + + throw new \Stripe\Exception\UnexpectedValueException($msg); + } + $obj->setFilters($params); + + return $obj; + } + /** * @param \Stripe\Util\RequestOptions $opts * diff --git a/htdocs/includes/stripe/stripe-php/lib/BaseStripeClientInterface.php b/htdocs/includes/stripe/stripe-php/lib/BaseStripeClientInterface.php new file mode 100644 index 00000000000..6b004573fc0 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/BaseStripeClientInterface.php @@ -0,0 +1,44 @@ +overriden when creating the session. + * @property \Stripe\StripeObject $features + * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $login_page + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/BillingPortal/Session.php b/htdocs/includes/stripe/stripe-php/lib/BillingPortal/Session.php index ec01275ac4f..7ff9be943a1 100644 --- a/htdocs/includes/stripe/stripe-php/lib/BillingPortal/Session.php +++ b/htdocs/includes/stripe/stripe-php/lib/BillingPortal/Session.php @@ -5,24 +5,34 @@ namespace Stripe\BillingPortal; /** - * A session describes the instantiation of the customer portal for a particular - * customer. By visiting the session's URL, the customer can manage their - * subscriptions and billing details. For security reasons, sessions are + * The Billing customer portal is a Stripe-hosted UI for subscription and billing + * management. + * + * A portal configuration describes the functionality and features that you want to + * provide to your customers through the portal. + * + * A portal session describes the instantiation of the customer portal for a + * particular customer. By visiting the session's URL, the customer can manage + * their subscriptions and billing details. For security reasons, sessions are * short-lived and will expire if the customer does not visit the URL. Create * sessions on-demand when customers intend to manage their subscriptions and * billing details. * - * Integration guide: Billing - * customer portal. + * Learn more in the integration + * guide. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $customer The ID of the customer for this session. + * @property null|\Stripe\StripeObject $flow Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $return_url The URL to which Stripe should send customers when they click on the link to return to your website. - * @property string $url The short-lived URL of the session giving customers access to the customer portal. + * @property null|string $locale The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s preferred_locales or browser’s locale is used. + * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. + * @property null|string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. + * @property string $url The short-lived URL of the session that gives customers access to the customer portal. */ class Session extends \Stripe\ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/BitcoinReceiver.php b/htdocs/includes/stripe/stripe-php/lib/BitcoinReceiver.php deleted file mode 100644 index 208610a0f12..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/BitcoinReceiver.php +++ /dev/null @@ -1,71 +0,0 @@ -currency that you are collecting as payment. - * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. - * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. - * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. - * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. - * @property null|string $customer The customer ID of the bitcoin receiver. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email The customer's email address, set by the API call that creates the receiver. - * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. - * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. - * @property null|string $refund_address The refund address of this bitcoin receiver. - * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. - * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. - * @property null|bool $used_for_payment Indicate if this source is used for payment. - */ -class BitcoinReceiver extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_receiver'; - - use ApiOperations\All; - use ApiOperations\Retrieve; - - /** - * @return string The class URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public static function classUrl() - { - return '/v1/bitcoin/receivers'; - } - - /** - * @return string The instance URL for this resource. It needs to be special - * cased because it doesn't fit into the standard resource pattern. - */ - public function instanceUrl() - { - if ($this['customer']) { - $base = Customer::classUrl(); - $parent = $this['customer']; - $path = 'sources'; - $parentExtn = \urlencode(Util\Util::utf8($parent)); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$parentExtn}/{$path}/{$extn}"; - } - - $base = BitcoinReceiver::classUrl(); - $extn = \urlencode(Util\Util::utf8($this['id'])); - - return "{$base}/{$extn}"; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/BitcoinTransaction.php b/htdocs/includes/stripe/stripe-php/lib/BitcoinTransaction.php deleted file mode 100644 index 3aa7118504a..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/BitcoinTransaction.php +++ /dev/null @@ -1,19 +0,0 @@ -currency that the transaction was converted to in real-time. - * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. - * @property string $receiver The receiver to which this transaction was sent. - */ -class BitcoinTransaction extends ApiResource -{ - const OBJECT_NAME = 'bitcoin_transaction'; -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Capability.php b/htdocs/includes/stripe/stripe-php/lib/Capability.php index 3580df60b7f..201b3be50c3 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Capability.php +++ b/htdocs/includes/stripe/stripe-php/lib/Capability.php @@ -14,9 +14,10 @@ namespace Stripe; * @property string $id The identifier for the capability. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property string|\Stripe\Account $account The account for which the capability enables functionality. + * @property null|\Stripe\StripeObject $future_requirements * @property bool $requested Whether the capability has been requested. * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $requirements * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. */ class Capability extends ApiResource diff --git a/htdocs/includes/stripe/stripe-php/lib/Card.php b/htdocs/includes/stripe/stripe-php/lib/Card.php index 106cd1811a8..939523b14ad 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Card.php +++ b/htdocs/includes/stripe/stripe-php/lib/Card.php @@ -33,12 +33,12 @@ namespace Stripe; * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. * @property int $exp_month Two-digit number representing the card's expiration month. * @property int $exp_year Four-digit number representing the card's expiration year. - * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + * @property null|string $fingerprint

Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.

* @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. * @property string $last4 The last four digits of the card. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name Cardholder name. - * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. + * @property null|string $status For external accounts, possible values are new and errored. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated. * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. */ class Card extends ApiResource @@ -91,12 +91,8 @@ class Card extends ApiResource $base = Account::classUrl(); $parent = $this['account']; $path = 'external_accounts'; - } elseif ($this['recipient']) { - $base = Recipient::classUrl(); - $parent = $this['recipient']; - $path = 'cards'; } else { - $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; + $msg = 'Cards cannot be accessed without a customer ID, or account ID.'; throw new Exception\UnexpectedValueException($msg); } diff --git a/htdocs/includes/stripe/stripe-php/lib/CashBalance.php b/htdocs/includes/stripe/stripe-php/lib/CashBalance.php new file mode 100644 index 00000000000..3e7396157f3 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/CashBalance.php @@ -0,0 +1,66 @@ +Cash balance represents real funds. Customers can add + * funds to their cash balance by sending a bank transfer. These funds can be used + * for payment and can eventually be paid out to your bank account. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the smallest currency unit. + * @property string $customer The ID of the customer whose cash balance this object represents. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $settings + */ +class CashBalance extends ApiResource +{ + const OBJECT_NAME = 'cash_balance'; + + /** + * @return string the API URL for this balance transaction + */ + public function instanceUrl() + { + $customer = $this['customer']; + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + + return "{$base}/{$customerExtn}/cash_balance"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Customer Cash Balance cannot be retrieved without a ' . + 'customer ID. Retrieve a Customer Cash Balance using ' . + "`Customer::retrieveCashBalance('customer_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Customer Cash Balance cannot be updated without a ' . + 'customer ID. Retrieve a Customer Cash Balance using ' . + "`Customer::updateCashBalance('customer_id')`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Charge.php b/htdocs/includes/stripe/stripe-php/lib/Charge.php index 799bede85cf..b7beb6d7a46 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Charge.php +++ b/htdocs/includes/stripe/stripe-php/lib/Charge.php @@ -15,12 +15,14 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $alternate_statement_descriptors * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. + * @property null|string $authorization_code Authorization code on the charge. * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). * @property \Stripe\StripeObject $billing_details * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. @@ -32,32 +34,34 @@ namespace Stripe; * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. * @property bool $disputed Whether the charge has been disputed. - * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). * @property null|string $failure_message Message to user further explaining reason for charge failure if available. * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. + * @property null|\Stripe\StripeObject $level3 * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. - * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. * @property null|string $payment_method ID of the payment method used in this charge. * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. + * @property null|\Stripe\StripeObject $radar_options Options to configure Radar. See Radar Session for more information. * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. - * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge. + * @property null|\Stripe\Collection<\Stripe\Refund> $refunds A list of refunds that have been applied to the charge. * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. - * @property null|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. + * @property null|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. * @property string $status The status of the payment is either succeeded, pending, or failed. - * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). + * @property null|string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. */ @@ -68,6 +72,7 @@ class Charge extends ApiResource use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const STATUS_FAILED = 'failed'; @@ -133,7 +138,7 @@ class Charge extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Charge the captured charge + * @return \Stripe\Charge the captured charge */ public function capture($params = null, $opts = null) { @@ -143,4 +148,19 @@ class Charge extends ApiResource return $this; } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the charge search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/charges/search'; + + return self::_searchResource($url, $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Checkout/Session.php b/htdocs/includes/stripe/stripe-php/lib/Checkout/Session.php index 464a2b9a5cc..acfecef13e9 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Checkout/Session.php +++ b/htdocs/includes/stripe/stripe-php/lib/Checkout/Session.php @@ -7,8 +7,9 @@ namespace Stripe\Checkout; /** * A Checkout Session represents your customer's session as they pay for one-time * purchases or subscriptions through Checkout. We recommend - * creating a new Session each time your customer attempts to pay. + * href="https://stripe.com/docs/payments/checkout">Checkout or Payment Links. We + * recommend creating a new Session each time your customer attempts to pay. * * Once payment is successful, the Checkout Session will contain a reference to the * Customer, and either the @@ -16,38 +17,60 @@ namespace Stripe\Checkout; * href="https://stripe.com/docs/api/payment_intents">PaymentIntent or an * active Subscription. * - * You can create a Checkout Session on your server and pass its ID to the client - * to begin Checkout. + * You can create a Checkout Session on your server and redirect to its URL to + * begin Checkout. * - * Related guide: Checkout - * Server Quickstart. + * Related guide: Checkout + * Quickstart. * - * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. + * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $after_expiration When set, provides configuration for actions to take if this Checkout Session expires. * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. * @property null|int $amount_total Total of all items after discounts and taxes are applied. + * @property \Stripe\StripeObject $automatic_tax * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. - * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. - * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. + * @property null|string $cancel_url If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. + * @property null|\Stripe\StripeObject $consent Results of consent_collection for this session. + * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration for the Checkout Session to gather active consent from customers. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The ID of the customer for this session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the session unless an existing customer was provided when the session was created. - * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the customer attribute. - * @property \Stripe\Collection $line_items The line items purchased by the customer. + * @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 2 fields are supported. + * @property \Stripe\StripeObject $custom_text + * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. + * @property null|string $customer_creation Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in setup mode. + * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. + * @property int $expires_at The timestamp at which the Checkout Session will expire. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice created by the Checkout Session, if it exists. + * @property null|\Stripe\StripeObject $invoice_creation Details on the state of invoice creation for the Checkout Session. + * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items The line items purchased by the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $mode The mode of the Checkout Session. * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. + * @property null|string|\Stripe\PaymentLink $payment_link The ID of the Payment Link that created this Session. + * @property null|string $payment_method_collection Configure whether a Checkout Session should collect a payment method. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. + * @property null|\Stripe\StripeObject $phone_number_collection + * @property null|string $recovered_from The ID of the original expired Checkout Session that triggered the recovery flow. * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. - * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. + * @property null|\Stripe\StripeObject $shipping_cost The details of the customer cost of shipping, including the customer chosen ShippingRate. + * @property null|\Stripe\StripeObject $shipping_details Shipping information for this Checkout Session. + * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to this Session. + * @property null|string $status The status of the Checkout Session, one of open, complete, or expired. * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. + * @property null|\Stripe\StripeObject $tax_id_collection * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + * @property null|string $url The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using Custom Domains, the URL will use your subdomain. Otherwise, it’ll use checkout.stripe.com. This value is only present when the session is active. */ class Session extends \Stripe\ApiResource { @@ -55,34 +78,67 @@ class Session extends \Stripe\ApiResource use \Stripe\ApiOperations\All; use \Stripe\ApiOperations\Create; - use \Stripe\ApiOperations\NestedResource; use \Stripe\ApiOperations\Retrieve; const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + const CUSTOMER_CREATION_ALWAYS = 'always'; + const CUSTOMER_CREATION_IF_REQUIRED = 'if_required'; + + const MODE_PAYMENT = 'payment'; + const MODE_SETUP = 'setup'; + const MODE_SUBSCRIPTION = 'subscription'; + + const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always'; + const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required'; + const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; const PAYMENT_STATUS_PAID = 'paid'; const PAYMENT_STATUS_UNPAID = 'unpaid'; + const STATUS_COMPLETE = 'complete'; + const STATUS_EXPIRED = 'expired'; + const STATUS_OPEN = 'open'; + const SUBMIT_TYPE_AUTO = 'auto'; const SUBMIT_TYPE_BOOK = 'book'; const SUBMIT_TYPE_DONATE = 'donate'; const SUBMIT_TYPE_PAY = 'pay'; - const PATH_LINE_ITEMS = '/line_items'; - /** - * @param string $id the ID of the session on which to retrieve the items * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of items + * @return \Stripe\Checkout\Session the expired session + */ + public function expire($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/expire'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems */ public static function allLineItems($id, $params = null, $opts = null) { - return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); + $url = static::resourceUrl($id) . '/line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Collection.php b/htdocs/includes/stripe/stripe-php/lib/Collection.php index 899299d3dad..67da085d385 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Collection.php +++ b/htdocs/includes/stripe/stripe-php/lib/Collection.php @@ -5,10 +5,13 @@ namespace Stripe; /** * Class Collection. * + * @template TStripeObject of StripeObject + * @template-implements \IteratorAggregate + * * @property string $object * @property string $url * @property bool $has_more - * @property \Stripe\StripeObject[] $data + * @property TStripeObject[] $data */ class Collection extends StripeObject implements \Countable, \IteratorAggregate { @@ -47,6 +50,10 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate $this->filters = $filters; } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($k) { if (\is_string($k)) { @@ -60,6 +67,14 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate throw new Exception\InvalidArgumentException($msg); } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return Collection + */ public function all($params = null, $opts = null) { self::_validateParams($params); @@ -77,6 +92,14 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate return $obj; } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return TStripeObject + */ public function create($params = null, $opts = null) { self::_validateParams($params); @@ -87,6 +110,15 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate return Util\Util::convertToStripeObject($response, $opts); } + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return TStripeObject + */ public function retrieve($id, $params = null, $opts = null) { self::_validateParams($params); @@ -107,6 +139,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * @return int the number of objects in the current page */ + #[\ReturnTypeWillChange] public function count() { return \count($this->data); @@ -116,6 +149,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @return \ArrayIterator an iterator that can be used to iterate * across objects in the current page */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->data); @@ -131,7 +165,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate } /** - * @return \Generator|StripeObject[] A generator that can be used to + * @return \Generator|TStripeObject[] A generator that can be used to * iterate across all objects across all pages. As page boundaries are * encountered, the next page will be fetched automatically for * continued iteration. @@ -194,7 +228,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @return Collection + * @return Collection */ public function nextPage($params = null, $opts = null) { @@ -222,7 +256,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @param null|array $params * @param null|array|string $opts * - * @return Collection + * @return Collection */ public function previousPage($params = null, $opts = null) { @@ -244,7 +278,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * Gets the first item from the current page. Returns `null` if the current page is empty. * - * @return null|\Stripe\StripeObject + * @return null|TStripeObject */ public function first() { @@ -254,7 +288,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * Gets the last item from the current page. Returns `null` if the current page is empty. * - * @return null|\Stripe\StripeObject + * @return null|TStripeObject */ public function last() { diff --git a/htdocs/includes/stripe/stripe-php/lib/Coupon.php b/htdocs/includes/stripe/stripe-php/lib/Coupon.php index 41afdcfc9b7..52da9f1d9a4 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Coupon.php +++ b/htdocs/includes/stripe/stripe-php/lib/Coupon.php @@ -7,17 +7,21 @@ namespace Stripe; /** * A coupon contains information about a percent-off or amount-off discount you * might want to apply to a customer. Coupons may be applied to invoices or orders. Coupons do - * not work with conventional one-off charges. + * href="https://stripe.com/docs/api#subscriptions">subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not + * work with conventional one-off charges or payment intents. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. - * @property \Stripe\StripeObject $applies_to + * @property null|\Stripe\StripeObject $applies_to * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. + * @property null|\Stripe\StripeObject $currency_options Coupons defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. diff --git a/htdocs/includes/stripe/stripe-php/lib/CreditNote.php b/htdocs/includes/stripe/stripe-php/lib/CreditNote.php index cc523a9f7a6..65425e12acb 100644 --- a/htdocs/includes/stripe/stripe-php/lib/CreditNote.php +++ b/htdocs/includes/stripe/stripe-php/lib/CreditNote.php @@ -14,6 +14,7 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The integer amount in %s representing the total amount of the credit note, including tax. + * @property int $amount_shipping This is the sum of all the shipping amounts. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string|\Stripe\Customer $customer ID of the customer. @@ -21,7 +22,7 @@ namespace Stripe; * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. * @property string|\Stripe\Invoice $invoice ID of the invoice. - * @property \Stripe\Collection $lines Line items that make up the credit note + * @property \Stripe\Collection<\Stripe\CreditNoteLineItem> $lines Line items that make up the credit note * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string $memo Customer-facing text that appears on the credit note PDF. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -30,10 +31,13 @@ namespace Stripe; * @property string $pdf The link to download the PDF of the credit note. * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory * @property null|string|\Stripe\Refund $refund Refund related to this credit note. + * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied to the invoice. * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. - * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. + * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + * @property null|int $subtotal_excluding_tax The integer amount in %s representing the amount of the credit note, excluding all tax and invoice level discounts. * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. + * @property null|int $total_excluding_tax The integer amount in %s representing the total amount of the credit note, excluding tax, but including discounts. * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. * @property null|int $voided_at The time that the credit note was voided. */ @@ -70,7 +74,7 @@ class CreditNote extends ApiResource { $url = static::classUrl() . '/preview'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response->json, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; @@ -82,7 +86,25 @@ class CreditNote extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return CreditNote the voided credit note + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> list of CreditNoteLineItems + */ + public static function previewLines($params = null, $opts = null) + { + $url = static::classUrl() . '/preview/lines'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the voided credit note */ public function voidCreditNote($params = null, $opts = null) { @@ -102,7 +124,7 @@ class CreditNote extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of credit note line items + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> the list of credit note line items */ public static function allLines($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/CreditNoteLineItem.php b/htdocs/includes/stripe/stripe-php/lib/CreditNoteLineItem.php index 254886b75d7..30eb8e763fd 100644 --- a/htdocs/includes/stripe/stripe-php/lib/CreditNoteLineItem.php +++ b/htdocs/includes/stripe/stripe-php/lib/CreditNoteLineItem.php @@ -8,10 +8,11 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + * @property null|int $amount_excluding_tax The integer amount in %s representing the amount being credited for this line item, excluding all tax and discounts. * @property null|string $description Description of the item being credited. * @property int $discount_amount The integer amount in %s representing the discount being credited for this line item. * @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item - * @property string $invoice_line_item ID of the invoice line item being credited + * @property null|string $invoice_line_item ID of the invoice line item being credited * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|int $quantity The number of units of product being credited. * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item @@ -19,6 +20,7 @@ namespace Stripe; * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. * @property null|int $unit_amount The cost of each unit of product being credited. * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + * @property null|string $unit_amount_excluding_tax The amount in %s representing the unit amount being credited for this line item, excluding all tax and discounts. */ class CreditNoteLineItem extends ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/Customer.php b/htdocs/includes/stripe/stripe-php/lib/Customer.php index c3a42cd8aa1..a3351517123 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Customer.php +++ b/htdocs/includes/stripe/stripe-php/lib/Customer.php @@ -5,10 +5,8 @@ namespace Stripe; /** - * Customer objects allow you to perform recurring charges, and to - * track multiple charges, that are associated with the same customer. The API - * allows you to create, delete, and update your customers. You can retrieve - * individual customers as well as a list of all your customers. + * This object represents a customer of your business. It lets you create recurring + * charges and track payments that belong to the same customer. * * Related guide: Save a card during @@ -17,27 +15,31 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|\Stripe\StripeObject $address The customer's address. - * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + * @property null|int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + * @property null|\Stripe\CashBalance $cash_balance The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance". The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

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

+ * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

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

* @property null|bool $delinquent

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

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

* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. * @property null|string $email The customer's email address. + * @property null|\Stripe\StripeObject $invoice_credit_balance The current multi-currency balances, if any, being stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that will be added to their next invoice denominated in that currency. These balances do not refer to any unpaid invoices. They solely track amounts that have yet to be successfully applied to any invoice. A balance in a particular currency is only applied to any invoice as an invoice in that currency is finalized. * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. - * @property \Stripe\StripeObject $invoice_settings + * @property null|\Stripe\StripeObject $invoice_settings * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $name The customer's full name or business name. - * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. + * @property null|int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. * @property null|string $phone The customer's phone number. * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. - * @property \Stripe\Collection $sources The customer's payment sources, if any. - * @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any. + * @property null|\Stripe\Collection<\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> $sources The customer's payment sources, if any. + * @property null|\Stripe\Collection<\Stripe\Subscription> $subscriptions The customer's current subscriptions, if any. + * @property null|\Stripe\StripeObject $tax * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". - * @property \Stripe\Collection $tax_ids The customer's tax IDs. + * @property null|\Stripe\Collection<\Stripe\TaxId> $tax_ids The customer's tax IDs. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this customer belongs to. */ class Customer extends ApiResource { @@ -48,6 +50,7 @@ class Customer extends ApiResource use ApiOperations\Delete; use ApiOperations\NestedResource; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const TAX_EXEMPT_EXEMPT = 'exempt'; @@ -77,8 +80,94 @@ class Customer extends ApiResource $url = $this->instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); + + return $this; } + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\PaymentMethod> list of PaymentMethods + */ + public static function allPaymentMethods($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/payment_methods'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $payment_method + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer the retrieved customer + */ + public function retrievePaymentMethod($payment_method, $params = null, $opts = null) + { + $url = $this->instanceUrl() . '/payment_methods/' . $payment_method; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the customer search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/customers/search'; + + return self::_searchResource($url, $params, $opts); + } + + const PATH_CASH_BALANCE = '/cash_balance'; + + /** + * @param string $id the ID of the customer to which the cash balance belongs + * @param null|array $params + * @param null|array|string $opts + * @param mixed $cashBalanceId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CashBalance + */ + public static function retrieveCashBalance($id, $cashBalanceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the cash balance belongs + * @param null|array $params + * @param null|array|string $opts + * @param mixed $cashBalanceId + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CashBalance + */ + public static function updateCashBalance($id, $cashBalanceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_CASH_BALANCE, $params, $opts); + } const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; /** @@ -88,7 +177,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of customer balance transactions + * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> the list of customer balance transactions */ public static function allBalanceTransactions($id, $params = null, $opts = null) { @@ -138,7 +227,36 @@ class Customer extends ApiResource { return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); } + const PATH_CASH_BALANCE_TRANSACTIONS = '/cash_balance_transactions'; + /** + * @param string $id the ID of the customer on which to retrieve the customer cash balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CustomerCashBalanceTransaction> the list of customer cash balance transactions + */ + public static function allCashBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer cash balance transaction belongs + * @param string $cashBalanceTransactionId the ID of the customer cash balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerCashBalanceTransaction + */ + public static function retrieveCashBalanceTransaction($id, $cashBalanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CASH_BALANCE_TRANSACTIONS, $cashBalanceTransactionId, $params, $opts); + } const PATH_SOURCES = '/sources'; /** @@ -148,7 +266,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> the list of payment sources (BankAccount, Card or Source) */ public static function allSources($id, $params = null, $opts = null) { @@ -162,7 +280,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public static function createSource($id, $params = null, $opts = null) { @@ -177,7 +295,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public static function deleteSource($id, $sourceId, $params = null, $opts = null) { @@ -192,7 +310,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public static function retrieveSource($id, $sourceId, $params = null, $opts = null) { @@ -207,13 +325,12 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public static function updateSource($id, $sourceId, $params = null, $opts = null) { return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); } - const PATH_TAX_IDS = '/tax_ids'; /** @@ -223,7 +340,7 @@ class Customer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of tax ids + * @return \Stripe\Collection<\Stripe\TaxId> the list of tax ids */ public static function allTaxIds($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/CustomerBalanceTransaction.php b/htdocs/includes/stripe/stripe-php/lib/CustomerBalanceTransaction.php index 8c306760dbc..02cc1f4d717 100644 --- a/htdocs/includes/stripe/stripe-php/lib/CustomerBalanceTransaction.php +++ b/htdocs/includes/stripe/stripe-php/lib/CustomerBalanceTransaction.php @@ -29,7 +29,7 @@ namespace Stripe; * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. + * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. */ class CustomerBalanceTransaction extends ApiResource { @@ -39,6 +39,7 @@ class CustomerBalanceTransaction extends ApiResource const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; const TYPE_CREDIT_NOTE = 'credit_note'; const TYPE_INITIAL = 'initial'; + const TYPE_INVOICE_OVERPAID = 'invoice_overpaid'; const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; diff --git a/htdocs/includes/stripe/stripe-php/lib/CustomerCashBalanceTransaction.php b/htdocs/includes/stripe/stripe-php/lib/CustomerCashBalanceTransaction.php new file mode 100644 index 00000000000..c382522c0ac --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/CustomerCashBalanceTransaction.php @@ -0,0 +1,42 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The customer whose available cash balance changed as a result of this transaction. + * @property int $ending_balance The total available cash balance for the specified currency after this transaction was applied. Represented in the smallest currency unit. + * @property null|\Stripe\StripeObject $funded + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $net_amount The amount by which the cash balance changed, represented in the smallest currency unit. A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. + * @property null|\Stripe\StripeObject $refunded_from_payment + * @property string $type The type of the cash balance transaction. One of applied_to_payment, unapplied_from_payment, refunded_from_payment, funded, return_initiated, or return_canceled. New types may be added in future. See Customer Balance to learn more about these types. + * @property null|\Stripe\StripeObject $unapplied_from_payment + */ +class CustomerCashBalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'customer_cash_balance_transaction'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const TYPE_APPLIED_TO_PAYMENT = 'applied_to_payment'; + const TYPE_FUNDED = 'funded'; + const TYPE_FUNDING_REVERSED = 'funding_reversed'; + const TYPE_REFUNDED_FROM_PAYMENT = 'refunded_from_payment'; + const TYPE_RETURN_CANCELED = 'return_canceled'; + const TYPE_RETURN_INITIATED = 'return_initiated'; + const TYPE_UNAPPLIED_FROM_PAYMENT = 'unapplied_from_payment'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Discount.php b/htdocs/includes/stripe/stripe-php/lib/Discount.php index 18a7470d447..dbc5d4bb4ee 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Discount.php +++ b/htdocs/includes/stripe/stripe-php/lib/Discount.php @@ -5,18 +5,17 @@ namespace Stripe; /** * Class Discount. * - * @property string $object - * @property string $checkout_session The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. + * @property null|string $checkout_session The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. * @property \Stripe\Coupon $coupon Hash describing the coupon applied to create this discount. * @property string|\Stripe\Customer $customer The ID of the customer associated with this discount. - * @property int $end If the coupon has a duration of repeating, the date that this discount will end. If the coupon has a duration of once or forever, this attribute will be null. + * @property null|int $end If the coupon has a duration of repeating, the date that this discount will end. If the coupon has a duration of once or forever, this attribute will be null. * @property string $id The ID of the discount object. - * @property string $invoice The invoice that the discount’s coupon was applied to, if it was applied directly to a particular invoice. - * @property string $invoice_item The invoice item id (or invoice line item id for invoice line items of type=‘subscription’) that the discount’s coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + * @property null|string $invoice The invoice that the discount’s coupon was applied to, if it was applied directly to a particular invoice. + * @property null|string $invoice_item The invoice item id (or invoice line item id for invoice line items of type=‘subscription’) that the discount’s coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. * @property string $object String representing the object’s type. Objects of the same type share the same value. - * @property string $promotion_code The promotion code applied to create this discount. + * @property null|string $promotion_code The promotion code applied to create this discount. * @property int $start Date that the coupon was applied. - * @property string $subscription The subscription that this coupon is applied to, if it is applied to a particular subscription. + * @property null|string $subscription The subscription that this coupon is applied to, if it is applied to a particular subscription. */ class Discount extends StripeObject { diff --git a/htdocs/includes/stripe/stripe-php/lib/Dispute.php b/htdocs/includes/stripe/stripe-php/lib/Dispute.php index 5772accc531..108495e6045 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Dispute.php +++ b/htdocs/includes/stripe/stripe-php/lib/Dispute.php @@ -64,17 +64,17 @@ class Dispute extends ApiResource const STATUS_WON = 'won'; /** + * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * * @return \Stripe\Dispute the closed dispute */ - // TODO: add $params to standardize signature - public function close($opts = null) + public function close($params = null, $opts = null) { $url = $this->instanceUrl() . '/close'; - list($response, $opts) = $this->_request('post', $url, null, $opts); + list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; diff --git a/htdocs/includes/stripe/stripe-php/lib/EphemeralKey.php b/htdocs/includes/stripe/stripe-php/lib/EphemeralKey.php index 253256cfd39..45055e8ca31 100644 --- a/htdocs/includes/stripe/stripe-php/lib/EphemeralKey.php +++ b/htdocs/includes/stripe/stripe-php/lib/EphemeralKey.php @@ -10,8 +10,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $expires Time at which the key will expire. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. - * @property array $associated_objects + * @property null|string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. */ class EphemeralKey extends ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/Error/Api.php b/htdocs/includes/stripe/stripe-php/lib/Error/Api.php deleted file mode 100644 index dc7d069efde..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Error/Api.php +++ /dev/null @@ -1,7 +0,0 @@ -httpStatus = $httpStatus; - $this->httpBody = $httpBody; - $this->jsonBody = $jsonBody; - $this->httpHeaders = $httpHeaders; - $this->requestId = null; - - // TODO: make this a proper constructor argument in the next major - // release. - $this->stripeCode = isset($jsonBody["error"]["code"]) ? $jsonBody["error"]["code"] : null; - - if ($httpHeaders && isset($httpHeaders['Request-Id'])) { - $this->requestId = $httpHeaders['Request-Id']; - } - } - - public function getStripeCode() - { - return $this->stripeCode; - } - - public function getHttpStatus() - { - return $this->httpStatus; - } - - public function getHttpBody() - { - return $this->httpBody; - } - - public function getJsonBody() - { - return $this->jsonBody; - } - - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - public function getRequestId() - { - return $this->requestId; - } - - public function __toString() - { - $id = $this->requestId ? " from API request '{$this->requestId}'": ""; - $message = explode("\n", parent::__toString()); - $message[0] .= $id; - return implode("\n", $message); - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Error/Card.php b/htdocs/includes/stripe/stripe-php/lib/Error/Card.php deleted file mode 100644 index f3ff343d899..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Error/Card.php +++ /dev/null @@ -1,40 +0,0 @@ -stripeParam = $stripeParam; - - // TODO: once Error\Base accepts the error code as an argument, pass it - // in the call to parent::__construct() and stop setting it here. - $this->stripeCode = $stripeCode; - - // This one is not like the others because it was added later and we're - // trying to do our best not to change the public interface of this class' - // constructor. - // TODO: make this a proper constructor argument in the next major - // release. - $this->declineCode = isset($jsonBody["error"]["decline_code"]) ? $jsonBody["error"]["decline_code"] : null; - } - - public function getDeclineCode() - { - return $this->declineCode; - } - - public function getStripeParam() - { - return $this->stripeParam; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Error/Idempotency.php b/htdocs/includes/stripe/stripe-php/lib/Error/Idempotency.php deleted file mode 100644 index ea44d12e4ea..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Error/Idempotency.php +++ /dev/null @@ -1,7 +0,0 @@ -stripeParam = $stripeParam; - } - - public function getStripeParam() - { - return $this->stripeParam; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php b/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php deleted file mode 100644 index b47346cde5f..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php +++ /dev/null @@ -1,10 +0,0 @@ -errorCode = $code; - } - - public function getErrorCode() - { - return $this->errorCode; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php b/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php deleted file mode 100644 index 421adc99645..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php +++ /dev/null @@ -1,11 +0,0 @@ -sigHeader = $sigHeader; - } - - public function getSigHeader() - { - return $this->sigHeader; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/ErrorObject.php b/htdocs/includes/stripe/stripe-php/lib/ErrorObject.php index a9fe1a3b279..3385aac0b24 100644 --- a/htdocs/includes/stripe/stripe-php/lib/ErrorObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/ErrorObject.php @@ -26,14 +26,14 @@ namespace Stripe; * @property string $payment_method_type If the error is specific to the type * of payment method, the payment method type that had a problem. This * field is only populated for invoice-related errors. + * @property string $request_log_url A URL to the request log entry in your + * dashboard. * @property SetupIntent $setup_intent The SetupIntent object for errors * returned on a request involving a SetupIntent. * @property StripeObject $source The source object for errors returned on a * request involving a source. - * @property string $type The type of error returned. One of - * `api_connection_error`, `api_error`, `authentication_error`, - * `card_error`, `idempotency_error`, `invalid_request_error`, or - * `rate_limit_error`. + * @property string $type The type of error returned. One of `api_error`, + * `card_error`, `idempotency_error`, or `invalid_request_error`. */ class ErrorObject extends StripeObject { @@ -42,28 +42,42 @@ class ErrorObject extends StripeObject * * @see https://stripe.com/docs/error-codes */ - const CODE_ACCOUNT_ALREADY_EXISTS = 'account_already_exists'; const CODE_ACCOUNT_COUNTRY_INVALID_ADDRESS = 'account_country_invalid_address'; + const CODE_ACCOUNT_ERROR_COUNTRY_CHANGE_REQUIRES_ADDITIONAL_STEPS = 'account_error_country_change_requires_additional_steps'; + const CODE_ACCOUNT_INFORMATION_MISMATCH = 'account_information_mismatch'; const CODE_ACCOUNT_INVALID = 'account_invalid'; const CODE_ACCOUNT_NUMBER_INVALID = 'account_number_invalid'; + const CODE_ACSS_DEBIT_SESSION_INCOMPLETE = 'acss_debit_session_incomplete'; const CODE_ALIPAY_UPGRADE_REQUIRED = 'alipay_upgrade_required'; const CODE_AMOUNT_TOO_LARGE = 'amount_too_large'; const CODE_AMOUNT_TOO_SMALL = 'amount_too_small'; const CODE_API_KEY_EXPIRED = 'api_key_expired'; + const CODE_AUTHENTICATION_REQUIRED = 'authentication_required'; const CODE_BALANCE_INSUFFICIENT = 'balance_insufficient'; + const CODE_BANK_ACCOUNT_BAD_ROUTING_NUMBERS = 'bank_account_bad_routing_numbers'; + const CODE_BANK_ACCOUNT_DECLINED = 'bank_account_declined'; const CODE_BANK_ACCOUNT_EXISTS = 'bank_account_exists'; const CODE_BANK_ACCOUNT_UNUSABLE = 'bank_account_unusable'; const CODE_BANK_ACCOUNT_UNVERIFIED = 'bank_account_unverified'; + const CODE_BANK_ACCOUNT_VERIFICATION_FAILED = 'bank_account_verification_failed'; + const CODE_BILLING_INVALID_MANDATE = 'billing_invalid_mandate'; const CODE_BITCOIN_UPGRADE_REQUIRED = 'bitcoin_upgrade_required'; + const CODE_CARD_DECLINE_RATE_LIMIT_EXCEEDED = 'card_decline_rate_limit_exceeded'; const CODE_CARD_DECLINED = 'card_declined'; + const CODE_CARDHOLDER_PHONE_NUMBER_REQUIRED = 'cardholder_phone_number_required'; const CODE_CHARGE_ALREADY_CAPTURED = 'charge_already_captured'; const CODE_CHARGE_ALREADY_REFUNDED = 'charge_already_refunded'; const CODE_CHARGE_DISPUTED = 'charge_disputed'; const CODE_CHARGE_EXCEEDS_SOURCE_LIMIT = 'charge_exceeds_source_limit'; const CODE_CHARGE_EXPIRED_FOR_CAPTURE = 'charge_expired_for_capture'; + const CODE_CHARGE_INVALID_PARAMETER = 'charge_invalid_parameter'; + const CODE_CLEARING_CODE_UNSUPPORTED = 'clearing_code_unsupported'; + const CODE_COUNTRY_CODE_INVALID = 'country_code_invalid'; const CODE_COUNTRY_UNSUPPORTED = 'country_unsupported'; const CODE_COUPON_EXPIRED = 'coupon_expired'; + const CODE_CUSTOMER_MAX_PAYMENT_METHODS = 'customer_max_payment_methods'; const CODE_CUSTOMER_MAX_SUBSCRIPTIONS = 'customer_max_subscriptions'; + const CODE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; const CODE_EMAIL_INVALID = 'email_invalid'; const CODE_EXPIRED_CARD = 'expired_card'; const CODE_IDEMPOTENCY_KEY_IN_USE = 'idempotency_key_in_use'; @@ -71,8 +85,13 @@ class ErrorObject extends StripeObject const CODE_INCORRECT_CVC = 'incorrect_cvc'; const CODE_INCORRECT_NUMBER = 'incorrect_number'; const CODE_INCORRECT_ZIP = 'incorrect_zip'; + const CODE_INSTANT_PAYOUTS_LIMIT_EXCEEDED = 'instant_payouts_limit_exceeded'; const CODE_INSTANT_PAYOUTS_UNSUPPORTED = 'instant_payouts_unsupported'; + const CODE_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const CODE_INTENT_INVALID_STATE = 'intent_invalid_state'; + const CODE_INTENT_VERIFICATION_METHOD_MISSING = 'intent_verification_method_missing'; const CODE_INVALID_CARD_TYPE = 'invalid_card_type'; + const CODE_INVALID_CHARACTERS = 'invalid_characters'; const CODE_INVALID_CHARGE_AMOUNT = 'invalid_charge_amount'; const CODE_INVALID_CVC = 'invalid_cvc'; const CODE_INVALID_EXPIRY_MONTH = 'invalid_expiry_month'; @@ -80,18 +99,17 @@ class ErrorObject extends StripeObject const CODE_INVALID_NUMBER = 'invalid_number'; const CODE_INVALID_SOURCE_USAGE = 'invalid_source_usage'; const CODE_INVOICE_NO_CUSTOMER_LINE_ITEMS = 'invoice_no_customer_line_items'; + const CODE_INVOICE_NO_PAYMENT_METHOD_TYPES = 'invoice_no_payment_method_types'; const CODE_INVOICE_NO_SUBSCRIPTION_LINE_ITEMS = 'invoice_no_subscription_line_items'; const CODE_INVOICE_NOT_EDITABLE = 'invoice_not_editable'; + const CODE_INVOICE_ON_BEHALF_OF_NOT_EDITABLE = 'invoice_on_behalf_of_not_editable'; const CODE_INVOICE_PAYMENT_INTENT_REQUIRES_ACTION = 'invoice_payment_intent_requires_action'; const CODE_INVOICE_UPCOMING_NONE = 'invoice_upcoming_none'; const CODE_LIVEMODE_MISMATCH = 'livemode_mismatch'; const CODE_LOCK_TIMEOUT = 'lock_timeout'; const CODE_MISSING = 'missing'; + const CODE_NO_ACCOUNT = 'no_account'; const CODE_NOT_ALLOWED_ON_STANDARD_ACCOUNT = 'not_allowed_on_standard_account'; - const CODE_ORDER_CREATION_FAILED = 'order_creation_failed'; - const CODE_ORDER_REQUIRED_SETTINGS = 'order_required_settings'; - const CODE_ORDER_STATUS_INVALID = 'order_status_invalid'; - const CODE_ORDER_UPSTREAM_TIMEOUT = 'order_upstream_timeout'; const CODE_OUT_OF_INVENTORY = 'out_of_inventory'; const CODE_PARAMETER_INVALID_EMPTY = 'parameter_invalid_empty'; const CODE_PARAMETER_INVALID_INTEGER = 'parameter_invalid_integer'; @@ -100,38 +118,64 @@ class ErrorObject extends StripeObject const CODE_PARAMETER_MISSING = 'parameter_missing'; const CODE_PARAMETER_UNKNOWN = 'parameter_unknown'; const CODE_PARAMETERS_EXCLUSIVE = 'parameters_exclusive'; + const CODE_PAYMENT_INTENT_ACTION_REQUIRED = 'payment_intent_action_required'; const CODE_PAYMENT_INTENT_AUTHENTICATION_FAILURE = 'payment_intent_authentication_failure'; const CODE_PAYMENT_INTENT_INCOMPATIBLE_PAYMENT_METHOD = 'payment_intent_incompatible_payment_method'; const CODE_PAYMENT_INTENT_INVALID_PARAMETER = 'payment_intent_invalid_parameter'; + const CODE_PAYMENT_INTENT_KONBINI_REJECTED_CONFIRMATION_NUMBER = 'payment_intent_konbini_rejected_confirmation_number'; + const CODE_PAYMENT_INTENT_MANDATE_INVALID = 'payment_intent_mandate_invalid'; + const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_EXPIRED = 'payment_intent_payment_attempt_expired'; const CODE_PAYMENT_INTENT_PAYMENT_ATTEMPT_FAILED = 'payment_intent_payment_attempt_failed'; const CODE_PAYMENT_INTENT_UNEXPECTED_STATE = 'payment_intent_unexpected_state'; + const CODE_PAYMENT_METHOD_BANK_ACCOUNT_ALREADY_VERIFIED = 'payment_method_bank_account_already_verified'; + const CODE_PAYMENT_METHOD_BANK_ACCOUNT_BLOCKED = 'payment_method_bank_account_blocked'; + const CODE_PAYMENT_METHOD_BILLING_DETAILS_ADDRESS_MISSING = 'payment_method_billing_details_address_missing'; + const CODE_PAYMENT_METHOD_CURRENCY_MISMATCH = 'payment_method_currency_mismatch'; + const CODE_PAYMENT_METHOD_INVALID_PARAMETER = 'payment_method_invalid_parameter'; + const CODE_PAYMENT_METHOD_INVALID_PARAMETER_TESTMODE = 'payment_method_invalid_parameter_testmode'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_FAILED = 'payment_method_microdeposit_failed'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_INVALID = 'payment_method_microdeposit_verification_amounts_invalid'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_AMOUNTS_MISMATCH = 'payment_method_microdeposit_verification_amounts_mismatch'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_ATTEMPTS_EXCEEDED = 'payment_method_microdeposit_verification_attempts_exceeded'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_DESCRIPTOR_CODE_MISMATCH = 'payment_method_microdeposit_verification_descriptor_code_mismatch'; + const CODE_PAYMENT_METHOD_MICRODEPOSIT_VERIFICATION_TIMEOUT = 'payment_method_microdeposit_verification_timeout'; + const CODE_PAYMENT_METHOD_PROVIDER_DECLINE = 'payment_method_provider_decline'; + const CODE_PAYMENT_METHOD_PROVIDER_TIMEOUT = 'payment_method_provider_timeout'; const CODE_PAYMENT_METHOD_UNACTIVATED = 'payment_method_unactivated'; const CODE_PAYMENT_METHOD_UNEXPECTED_STATE = 'payment_method_unexpected_state'; + const CODE_PAYMENT_METHOD_UNSUPPORTED_TYPE = 'payment_method_unsupported_type'; const CODE_PAYOUTS_NOT_ALLOWED = 'payouts_not_allowed'; + const CODE_PLATFORM_ACCOUNT_REQUIRED = 'platform_account_required'; const CODE_PLATFORM_API_KEY_EXPIRED = 'platform_api_key_expired'; const CODE_POSTAL_CODE_INVALID = 'postal_code_invalid'; const CODE_PROCESSING_ERROR = 'processing_error'; const CODE_PRODUCT_INACTIVE = 'product_inactive'; const CODE_RATE_LIMIT = 'rate_limit'; + const CODE_REFER_TO_CUSTOMER = 'refer_to_customer'; + const CODE_REFUND_DISPUTED_PAYMENT = 'refund_disputed_payment'; const CODE_RESOURCE_ALREADY_EXISTS = 'resource_already_exists'; const CODE_RESOURCE_MISSING = 'resource_missing'; + const CODE_RETURN_INTENT_ALREADY_PROCESSED = 'return_intent_already_processed'; const CODE_ROUTING_NUMBER_INVALID = 'routing_number_invalid'; const CODE_SECRET_KEY_REQUIRED = 'secret_key_required'; const CODE_SEPA_UNSUPPORTED_ACCOUNT = 'sepa_unsupported_account'; const CODE_SETUP_ATTEMPT_FAILED = 'setup_attempt_failed'; const CODE_SETUP_INTENT_AUTHENTICATION_FAILURE = 'setup_intent_authentication_failure'; + const CODE_SETUP_INTENT_INVALID_PARAMETER = 'setup_intent_invalid_parameter'; + const CODE_SETUP_INTENT_SETUP_ATTEMPT_EXPIRED = 'setup_intent_setup_attempt_expired'; const CODE_SETUP_INTENT_UNEXPECTED_STATE = 'setup_intent_unexpected_state'; const CODE_SHIPPING_CALCULATION_FAILED = 'shipping_calculation_failed'; const CODE_SKU_INACTIVE = 'sku_inactive'; const CODE_STATE_UNSUPPORTED = 'state_unsupported'; const CODE_TAX_ID_INVALID = 'tax_id_invalid'; const CODE_TAXES_CALCULATION_FAILED = 'taxes_calculation_failed'; + const CODE_TERMINAL_LOCATION_COUNTRY_UNSUPPORTED = 'terminal_location_country_unsupported'; const CODE_TESTMODE_CHARGES_ONLY = 'testmode_charges_only'; const CODE_TLS_VERSION_UNSUPPORTED = 'tls_version_unsupported'; const CODE_TOKEN_ALREADY_USED = 'token_already_used'; const CODE_TOKEN_IN_USE = 'token_in_use'; + const CODE_TRANSFER_SOURCE_BALANCE_PARAMETERS_MISMATCH = 'transfer_source_balance_parameters_mismatch'; const CODE_TRANSFERS_NOT_ALLOWED = 'transfers_not_allowed'; - const CODE_UPSTREAM_ORDER_CREATION_FAILED = 'upstream_order_creation_failed'; const CODE_URL_INVALID = 'url_invalid'; /** diff --git a/htdocs/includes/stripe/stripe-php/lib/Event.php b/htdocs/includes/stripe/stripe-php/lib/Event.php index 518c5d41344..a146bf3a328 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Event.php +++ b/htdocs/includes/stripe/stripe-php/lib/Event.php @@ -39,9 +39,12 @@ namespace Stripe; * href="https://stripe.com/docs/api#retrieve_event">Retrieve Event API is * guaranteed only for 30 days. * + * This class includes constants for the possible string representations of + * event types. See https://stripe.com/docs/api#event_types for more details. + * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $account The connected account that originated the event. + * @property null|string $account The connected account that originated the event. * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property \Stripe\StripeObject $data @@ -57,38 +60,38 @@ class Event extends ApiResource use ApiOperations\All; use ApiOperations\Retrieve; - /** - * Possible string representations of event types. - * - * @see https://stripe.com/docs/api#event_types - */ - const ACCOUNT_UPDATED = 'account.updated'; const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated'; + const ACCOUNT_UPDATED = 'account.updated'; const APPLICATION_FEE_CREATED = 'application_fee.created'; - const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; + const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; const BALANCE_AVAILABLE = 'balance.available'; + const BILLING_PORTAL_CONFIGURATION_CREATED = 'billing_portal.configuration.created'; + const BILLING_PORTAL_CONFIGURATION_UPDATED = 'billing_portal.configuration.updated'; + const BILLING_PORTAL_SESSION_CREATED = 'billing_portal.session.created'; const CAPABILITY_UPDATED = 'capability.updated'; + const CASH_BALANCE_FUNDS_AVAILABLE = 'cash_balance.funds_available'; const CHARGE_CAPTURED = 'charge.captured'; - const CHARGE_EXPIRED = 'charge.expired'; - const CHARGE_FAILED = 'charge.failed'; - const CHARGE_PENDING = 'charge.pending'; - const CHARGE_REFUNDED = 'charge.refunded'; - const CHARGE_SUCCEEDED = 'charge.succeeded'; - const CHARGE_UPDATED = 'charge.updated'; const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; + const CHARGE_EXPIRED = 'charge.expired'; + const CHARGE_FAILED = 'charge.failed'; + const CHARGE_PENDING = 'charge.pending'; const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; + const CHARGE_REFUNDED = 'charge.refunded'; + const CHARGE_SUCCEEDED = 'charge.succeeded'; + const CHARGE_UPDATED = 'charge.updated'; const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; + const CHECKOUT_SESSION_EXPIRED = 'checkout.session.expired'; const COUPON_CREATED = 'coupon.created'; const COUPON_DELETED = 'coupon.deleted'; const COUPON_UPDATED = 'coupon.updated'; @@ -97,7 +100,6 @@ class Event extends ApiResource const CREDIT_NOTE_VOIDED = 'credit_note.voided'; const CUSTOMER_CREATED = 'customer.created'; const CUSTOMER_DELETED = 'customer.deleted'; - const CUSTOMER_UPDATED = 'customer.updated'; const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; @@ -107,14 +109,29 @@ class Event extends ApiResource const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; + const CUSTOMER_SUBSCRIPTION_PAUSED = 'customer.subscription.paused'; const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; + const CUSTOMER_SUBSCRIPTION_RESUMED = 'customer.subscription.resumed'; const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; + const CUSTOMER_UPDATED = 'customer.updated'; + const CUSTOMER_CASH_BALANCE_TRANSACTION_CREATED = 'customer_cash_balance_transaction.created'; const FILE_CREATED = 'file.created'; + const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created'; + const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated'; + const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected'; + const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated'; + const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance'; + const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled'; + const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created'; + const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing'; + const IDENTITY_VERIFICATION_SESSION_REDACTED = 'identity.verification_session.redacted'; + const IDENTITY_VERIFICATION_SESSION_REQUIRES_INPUT = 'identity.verification_session.requires_input'; + const IDENTITY_VERIFICATION_SESSION_VERIFIED = 'identity.verification_session.verified'; const INVOICE_CREATED = 'invoice.created'; const INVOICE_DELETED = 'invoice.deleted'; const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; @@ -131,7 +148,6 @@ class Event extends ApiResource const INVOICEITEM_CREATED = 'invoiceitem.created'; const INVOICEITEM_DELETED = 'invoiceitem.deleted'; const INVOICEITEM_UPDATED = 'invoiceitem.updated'; - const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; @@ -148,20 +164,18 @@ class Event extends ApiResource const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; const MANDATE_UPDATED = 'mandate.updated'; const ORDER_CREATED = 'order.created'; - const ORDER_PAYMENT_FAILED = 'order.payment_failed'; - const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; - const ORDER_UPDATED = 'order.updated'; - const ORDER_RETURN_CREATED = 'order_return.created'; const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; const PAYMENT_INTENT_CREATED = 'payment_intent.created'; + const PAYMENT_INTENT_PARTIALLY_FUNDED = 'payment_intent.partially_funded'; const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; + const PAYMENT_LINK_CREATED = 'payment_link.created'; + const PAYMENT_LINK_UPDATED = 'payment_link.updated'; const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; - const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; const PAYOUT_CANCELED = 'payout.canceled'; @@ -172,7 +186,6 @@ class Event extends ApiResource const PERSON_CREATED = 'person.created'; const PERSON_DELETED = 'person.deleted'; const PERSON_UPDATED = 'person.updated'; - const PING = 'ping'; const PLAN_CREATED = 'plan.created'; const PLAN_DELETED = 'plan.deleted'; const PLAN_UPDATED = 'plan.updated'; @@ -183,13 +196,18 @@ class Event extends ApiResource const PRODUCT_DELETED = 'product.deleted'; const PRODUCT_UPDATED = 'product.updated'; const PROMOTION_CODE_CREATED = 'promotion_code.created'; - const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; + const QUOTE_ACCEPTED = 'quote.accepted'; + const QUOTE_CANCELED = 'quote.canceled'; + const QUOTE_CREATED = 'quote.created'; + const QUOTE_FINALIZED = 'quote.finalized'; const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; const RECIPIENT_CREATED = 'recipient.created'; const RECIPIENT_DELETED = 'recipient.deleted'; const RECIPIENT_UPDATED = 'recipient.updated'; + const REFUND_CREATED = 'refund.created'; + const REFUND_UPDATED = 'refund.updated'; const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; @@ -220,6 +238,13 @@ class Event extends ApiResource const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; const TAX_RATE_CREATED = 'tax_rate.created'; const TAX_RATE_UPDATED = 'tax_rate.updated'; + const TERMINAL_READER_ACTION_FAILED = 'terminal.reader.action_failed'; + const TERMINAL_READER_ACTION_SUCCEEDED = 'terminal.reader.action_succeeded'; + const TEST_HELPERS_TEST_CLOCK_ADVANCING = 'test_helpers.test_clock.advancing'; + const TEST_HELPERS_TEST_CLOCK_CREATED = 'test_helpers.test_clock.created'; + const TEST_HELPERS_TEST_CLOCK_DELETED = 'test_helpers.test_clock.deleted'; + const TEST_HELPERS_TEST_CLOCK_INTERNAL_FAILURE = 'test_helpers.test_clock.internal_failure'; + const TEST_HELPERS_TEST_CLOCK_READY = 'test_helpers.test_clock.ready'; const TOPUP_CANCELED = 'topup.canceled'; const TOPUP_CREATED = 'topup.created'; const TOPUP_FAILED = 'topup.failed'; @@ -228,4 +253,32 @@ class Event extends ApiResource const TRANSFER_CREATED = 'transfer.created'; const TRANSFER_REVERSED = 'transfer.reversed'; const TRANSFER_UPDATED = 'transfer.updated'; + const TREASURY_CREDIT_REVERSAL_CREATED = 'treasury.credit_reversal.created'; + const TREASURY_CREDIT_REVERSAL_POSTED = 'treasury.credit_reversal.posted'; + const TREASURY_DEBIT_REVERSAL_COMPLETED = 'treasury.debit_reversal.completed'; + const TREASURY_DEBIT_REVERSAL_CREATED = 'treasury.debit_reversal.created'; + const TREASURY_DEBIT_REVERSAL_INITIAL_CREDIT_GRANTED = 'treasury.debit_reversal.initial_credit_granted'; + const TREASURY_FINANCIAL_ACCOUNT_CLOSED = 'treasury.financial_account.closed'; + const TREASURY_FINANCIAL_ACCOUNT_CREATED = 'treasury.financial_account.created'; + const TREASURY_FINANCIAL_ACCOUNT_FEATURES_STATUS_UPDATED = 'treasury.financial_account.features_status_updated'; + const TREASURY_INBOUND_TRANSFER_CANCELED = 'treasury.inbound_transfer.canceled'; + const TREASURY_INBOUND_TRANSFER_CREATED = 'treasury.inbound_transfer.created'; + const TREASURY_INBOUND_TRANSFER_FAILED = 'treasury.inbound_transfer.failed'; + const TREASURY_INBOUND_TRANSFER_SUCCEEDED = 'treasury.inbound_transfer.succeeded'; + const TREASURY_OUTBOUND_PAYMENT_CANCELED = 'treasury.outbound_payment.canceled'; + const TREASURY_OUTBOUND_PAYMENT_CREATED = 'treasury.outbound_payment.created'; + const TREASURY_OUTBOUND_PAYMENT_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_payment.expected_arrival_date_updated'; + const TREASURY_OUTBOUND_PAYMENT_FAILED = 'treasury.outbound_payment.failed'; + const TREASURY_OUTBOUND_PAYMENT_POSTED = 'treasury.outbound_payment.posted'; + const TREASURY_OUTBOUND_PAYMENT_RETURNED = 'treasury.outbound_payment.returned'; + const TREASURY_OUTBOUND_TRANSFER_CANCELED = 'treasury.outbound_transfer.canceled'; + const TREASURY_OUTBOUND_TRANSFER_CREATED = 'treasury.outbound_transfer.created'; + const TREASURY_OUTBOUND_TRANSFER_EXPECTED_ARRIVAL_DATE_UPDATED = 'treasury.outbound_transfer.expected_arrival_date_updated'; + const TREASURY_OUTBOUND_TRANSFER_FAILED = 'treasury.outbound_transfer.failed'; + const TREASURY_OUTBOUND_TRANSFER_POSTED = 'treasury.outbound_transfer.posted'; + const TREASURY_OUTBOUND_TRANSFER_RETURNED = 'treasury.outbound_transfer.returned'; + const TREASURY_RECEIVED_CREDIT_CREATED = 'treasury.received_credit.created'; + const TREASURY_RECEIVED_CREDIT_FAILED = 'treasury.received_credit.failed'; + const TREASURY_RECEIVED_CREDIT_SUCCEEDED = 'treasury.received_credit.succeeded'; + const TREASURY_RECEIVED_DEBIT_CREATED = 'treasury.received_debit.created'; } diff --git a/htdocs/includes/stripe/stripe-php/lib/File.php b/htdocs/includes/stripe/stripe-php/lib/File.php index d73bed84218..d5c14fb75f0 100644 --- a/htdocs/includes/stripe/stripe-php/lib/File.php +++ b/htdocs/includes/stripe/stripe-php/lib/File.php @@ -20,7 +20,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|int $expires_at The time at which the file expires and is no longer available in epoch seconds. * @property null|string $filename A filename for the file, suitable for saving to a filesystem. - * @property null|\Stripe\Collection $links A list of file links that point at this file. + * @property null|\Stripe\Collection<\Stripe\FileLink> $links A list of file links that point at this file. * @property string $purpose The purpose of the uploaded file. * @property int $size The size in bytes of the file object. * @property null|string $title A user friendly title for the document. @@ -34,14 +34,21 @@ class File extends ApiResource use ApiOperations\All; use ApiOperations\Retrieve; + const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; const PURPOSE_BUSINESS_ICON = 'business_icon'; const PURPOSE_BUSINESS_LOGO = 'business_logo'; const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; + const PURPOSE_DOCUMENT_PROVIDER_IDENTITY_DOCUMENT = 'document_provider_identity_document'; + const PURPOSE_FINANCE_REPORT_RUN = 'finance_report_run'; const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; + const PURPOSE_IDENTITY_DOCUMENT_DOWNLOADABLE = 'identity_document_downloadable'; const PURPOSE_PCI_DOCUMENT = 'pci_document'; + const PURPOSE_SELFIE = 'selfie'; + const PURPOSE_SIGMA_SCHEDULED_QUERY = 'sigma_scheduled_query'; const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; + const PURPOSE_TERMINAL_READER_SPLASHSCREEN = 'terminal_reader_splashscreen'; // This resource can have two different object names. In latter API // versions, only `file` is used, but since stripe-php may be used with @@ -53,11 +60,6 @@ class File extends ApiResource create as protected _create; } - public static function classUrl() - { - return '/v1/files'; - } - /** * @param null|array $params * @param null|array|string $opts diff --git a/htdocs/includes/stripe/stripe-php/lib/FileUpload.php b/htdocs/includes/stripe/stripe-php/lib/FileUpload.php deleted file mode 100644 index 1d8725b4ca4..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/FileUpload.php +++ /dev/null @@ -1,6 +0,0 @@ -subcategory. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution. + * @property string $institution_name The name of the institution that holds this account. + * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners. + * @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners. + * @property null|string[] $permissions The list of permissions granted by this account. + * @property string $status The status of the link to the account. + * @property string $subcategory

If category is cash, one of:

- checking - savings - other

If category is credit, one of:

- mortgage - line_of_credit - credit_card - other

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

+ * @property string[] $supported_payment_method_types The PaymentMethod type(s) that can be created from this account. + */ +class Account extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.account'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const CATEGORY_CASH = 'cash'; + const CATEGORY_CREDIT = 'credit'; + const CATEGORY_INVESTMENT = 'investment'; + const CATEGORY_OTHER = 'other'; + + const STATUS_ACTIVE = 'active'; + const STATUS_DISCONNECTED = 'disconnected'; + const STATUS_INACTIVE = 'inactive'; + + const SUBCATEGORY_CHECKING = 'checking'; + const SUBCATEGORY_CREDIT_CARD = 'credit_card'; + const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit'; + const SUBCATEGORY_MORTGAGE = 'mortgage'; + const SUBCATEGORY_OTHER = 'other'; + const SUBCATEGORY_SAVINGS = 'savings'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account the disconnected account + */ + public function disconnect($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/disconnect'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> list of BankConnectionsResourceOwners + */ + public static function allOwners($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/owners'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account the refreshed account + */ + public function refreshAccount($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/refresh'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php b/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php new file mode 100644 index 00000000000..53a7f1a4ceb --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/AccountOwner.php @@ -0,0 +1,20 @@ + $owners A paginated list of owners for this account. + */ +class AccountOwnership extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.account_ownership'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/Session.php b/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/Session.php new file mode 100644 index 00000000000..cb53ec7dca6 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/FinancialConnections/Session.php @@ -0,0 +1,27 @@ + $accounts The accounts that were collected as part of this Session. + * @property string $client_secret A value that will be passed to the client to launch the authentication flow. + * @property null|\Stripe\StripeObject $filters + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string[] $permissions Permissions requested for accounts collected during this session. + * @property null|string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'financial_connections.session'; + + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/FundingInstructions.php b/htdocs/includes/stripe/stripe-php/lib/FundingInstructions.php new file mode 100644 index 00000000000..af799914936 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/FundingInstructions.php @@ -0,0 +1,28 @@ +balance + * that is automatically applied to future invoices and payments using the + * customer_balance payment method. Customers can fund this balance by + * initiating a bank transfer to any account in the + * financial_addresses field. Related guide: Customer + * Balance - Funding Instructions to learn more. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $bank_transfer + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $funding_type The funding_type of the returned instructions + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + */ +class FundingInstructions extends ApiResource +{ + const OBJECT_NAME = 'funding_instructions'; + + const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/HttpClient/CurlClient.php b/htdocs/includes/stripe/stripe-php/lib/HttpClient/CurlClient.php index b824518570a..fdf421c122d 100644 --- a/htdocs/includes/stripe/stripe-php/lib/HttpClient/CurlClient.php +++ b/htdocs/includes/stripe/stripe-php/lib/HttpClient/CurlClient.php @@ -24,17 +24,17 @@ if (!\defined('CURL_HTTP_VERSION_2TLS')) { \define('CURL_HTTP_VERSION_2TLS', 4); } -class CurlClient implements ClientInterface +class CurlClient implements ClientInterface, StreamingClientInterface { - private static $instance; + protected static $instance; public static function instance() { - if (!self::$instance) { - self::$instance = new self(); + if (!static::$instance) { + static::$instance = new static(); } - return self::$instance; + return static::$instance; } protected $defaultOptions; @@ -193,7 +193,7 @@ class CurlClient implements ClientInterface // END OF USER DEFINED TIMEOUTS - public function request($method, $absUrl, $headers, $params, $hasFile) + private function constructRequest($method, $absUrl, $headers, $params, $hasFile) { $method = \strtolower($method); @@ -271,20 +271,215 @@ class CurlClient implements ClientInterface $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; } - // Stripe's API servers are only accessible over IPv4. Force IPv4 resolving to avoid - // potential issues (cf. https://github.com/stripe/stripe-php/issues/1045). - $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + // If the user didn't explicitly specify a CURLOPT_IPRESOLVE option, we + // force IPv4 resolving as Stripe's API servers are only accessible over + // IPv4 (see. https://github.com/stripe/stripe-php/issues/1045). + // We let users specify a custom option in case they need to say proxy + // through an IPv6 proxy. + if (!isset($opts[\CURLOPT_IPRESOLVE])) { + $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + } + + return [$opts, $absUrl]; + } + + public function request($method, $absUrl, $headers, $params, $hasFile) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); return [$rbody, $rcode, $rheaders]; } + public function requestStream($method, $absUrl, $headers, $params, $hasFile, $readBodyChunk) + { + list($opts, $absUrl) = $this->constructRequest($method, $absUrl, $headers, $params, $hasFile); + + $opts[\CURLOPT_RETURNTRANSFER] = false; + list($rbody, $rcode, $rheaders) = $this->executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk); + + return [$rbody, $rcode, $rheaders]; + } + + /** + * Curl permits sending \CURLOPT_HEADERFUNCTION, which is called with lines + * from the header and \CURLOPT_WRITEFUNCTION, which is called with bytes + * from the body. You usually want to handle the body differently depending + * on what was in the header. + * + * This function makes it easier to specify different callbacks depending + * on the contents of the heeder. After the header has been completely read + * and the body begins to stream, it will call $determineWriteCallback with + * the array of headers. $determineWriteCallback should, based on the + * headers it receives, return a "writeCallback" that describes what to do + * with the incoming HTTP response body. + * + * @param array $opts + * @param callable $determineWriteCallback + * + * @return array + */ + private function useHeadersToDetermineWriteCallback($opts, $determineWriteCallback) + { + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + return self::parseLineIntoHeaderArray($header_line, $rheaders); + }; + + $writeCallback = null; + $writeCallbackWrapper = function ($curl, $data) use (&$writeCallback, &$rheaders, &$determineWriteCallback) { + if (null === $writeCallback) { + $writeCallback = \call_user_func_array($determineWriteCallback, [$rheaders]); + } + + return \call_user_func_array($writeCallback, [$curl, $data]); + }; + + return [$headerCallback, $writeCallbackWrapper]; + } + + private static function parseLineIntoHeaderArray($line, &$headers) + { + if (false === \strpos($line, ':')) { + return \strlen($line); + } + list($key, $value) = \explode(':', \trim($line), 2); + $headers[\trim($key)] = \trim($value); + + return \strlen($line); + } + + /** + * Like `executeRequestWithRetries` except: + * 1. Does not buffer the body of a successful (status code < 300) + * response into memory -- instead, calls the caller-provided + * $readBodyChunk with each chunk of incoming data. + * 2. Does not retry if a network error occurs while streaming the + * body of a successful response. + * + * @param array $opts cURL options + * @param string $absUrl + * @param callable $readBodyChunk + * + * @return array + */ + public function executeStreamingRequestWithRetries($opts, $absUrl, $readBodyChunk) + { + /** @var bool */ + $shouldRetry = false; + /** @var int */ + $numRetries = 0; + + // Will contain the bytes of the body of the last request + // if it was not successful and should not be retries + /** @var null|string */ + $rbody = null; + + // Status code of the last request + /** @var null|bool */ + $rcode = null; + + // Array of headers from the last request + /** @var null|array */ + $lastRHeaders = null; + + $errno = null; + $message = null; + + $determineWriteCallback = function ($rheaders) use ( + &$readBodyChunk, + &$shouldRetry, + &$rbody, + &$numRetries, + &$rcode, + &$lastRHeaders, + &$errno + ) { + $lastRHeaders = $rheaders; + $errno = \curl_errno($this->curlHandle); + + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + + // Send the bytes from the body of a successful request to the caller-provided $readBodyChunk. + if ($rcode < 300) { + $rbody = null; + + return function ($curl, $data) use (&$readBodyChunk) { + // Don't expose the $curl handle to the user, and don't require them to + // return the length of $data. + \call_user_func_array($readBodyChunk, [$data]); + + return \strlen($data); + }; + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + // Discard the body from an unsuccessful request that should be retried. + if ($shouldRetry) { + return function ($curl, $data) { + return \strlen($data); + }; + } else { + // Otherwise, buffer the body into $rbody. It will need to be parsed to determine + // which exception to throw to the user. + $rbody = ''; + + return function ($curl, $data) use (&$rbody) { + $rbody .= $data; + + return \strlen($data); + }; + } + }; + + while (true) { + list($headerCallback, $writeCallback) = $this->useHeadersToDetermineWriteCallback($opts, $determineWriteCallback); + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + $opts[\CURLOPT_WRITEFUNCTION] = $writeCallback; + + $shouldRetry = false; + $rbody = null; + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $result = \curl_exec($this->curlHandle); + $errno = \curl_errno($this->curlHandle); + if (0 !== $errno) { + $message = \curl_error($this->curlHandle); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $lastRHeaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $lastRHeaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (0 !== $errno) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $lastRHeaders]; + } + /** * @param array $opts cURL options * @param string $absUrl */ - private function executeRequestWithRetries($opts, $absUrl) + public function executeRequestWithRetries($opts, $absUrl) { $numRetries = 0; @@ -296,14 +491,7 @@ class CurlClient implements ClientInterface // Create a callback to capture HTTP headers for the response $rheaders = new Util\CaseInsensitiveArray(); $headerCallback = function ($curl, $header_line) use (&$rheaders) { - // Ignore the HTTP request line (HTTP/1.1 200 OK) - if (false === \strpos($header_line, ':')) { - return \strlen($header_line); - } - list($key, $value) = \explode(':', \trim($header_line), 2); - $rheaders[\trim($key)] = \trim($value); - - return \strlen($header_line); + return CurlClient::parseLineIntoHeaderArray($header_line, $rheaders); }; $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; diff --git a/htdocs/includes/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php b/htdocs/includes/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php new file mode 100644 index 00000000000..482f9a1199f --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/HttpClient/StreamingClientInterface.php @@ -0,0 +1,23 @@ +type and options parameters used. You can find the + * result of each verification check performed in the appropriate sub-resource: + * document, id_number, selfie. + * + * Each VerificationReport contains a copy of any data collected by the user as + * well as reference IDs which can be used to access collected images through the + * FileUpload API. To configure and + * create VerificationReports, use the VerificationSession + * API. + * + * Related guides: Accessing + * verification results. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $document Result from a document check + * @property null|\Stripe\StripeObject $id_number Result from an id_number check + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $options + * @property null|\Stripe\StripeObject $selfie Result from a selfie check + * @property string $type Type of report. + * @property null|string $verification_session ID of the VerificationSession that created this report. + */ +class VerificationReport extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_report'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Identity/VerificationSession.php b/htdocs/includes/stripe/stripe-php/lib/Identity/VerificationSession.php new file mode 100644 index 00000000000..180e5091e53 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Identity/VerificationSession.php @@ -0,0 +1,88 @@ +verification check to perform. + * Only create one VerificationSession for each verification in your system. + * + * A VerificationSession transitions through multiple statuses throughout its + * lifetime as it progresses through the verification flow. The VerificationSession + * contains the user's verified data after verification checks are complete. + * + * Related guide: The Verification + * Sessions API + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification. + * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $options + * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + * @property string $status Status of this VerificationSession. Learn more about the lifecycle of sessions. + * @property string $type The type of verification check to be performed. + * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe. + * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data. + */ +class VerificationSession extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'identity.verification_session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_INPUT = 'requires_input'; + const STATUS_VERIFIED = 'verified'; + + const TYPE_DOCUMENT = 'document'; + const TYPE_ID_NUMBER = 'id_number'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession the canceled verification session + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession the redacted verification session + */ + public function redact($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/redact'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Invoice.php b/htdocs/includes/stripe/stripe-php/lib/Invoice.php index 706da0a632a..1849ea0625b 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Invoice.php +++ b/htdocs/includes/stripe/stripe-php/lib/Invoice.php @@ -23,7 +23,7 @@ namespace Stripe; * to finalize the invoice. * * If your invoice is configured to be billed by sending an email, then based on - * your email + * your email * settings, Stripe will email the invoice to your customer and await payment. * These emails can contain a link to a hosted page to pay the invoice. * @@ -32,34 +32,37 @@ namespace Stripe; * amount due for the invoice is less than Stripe's minimum allowed * charge per currency, the invoice is automatically marked paid, and we add - * the amount due to the customer's running account balance which is applied to the - * next invoice. + * the amount due to the customer's credit balance which is applied to the next + * invoice. * - * More details on the customer's account balance are here. + * More details on the customer's credit balance are here. * * Related guide: Send * Invoices to Customers. * - * @property string $id Unique identifier for the object. + * @property null|string $id Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See Retrieve an upcoming invoice for more details. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. * @property int $amount_paid The amount, in %s, that was paid. - * @property int $amount_remaining The amount remaining, in %s, that is due. + * @property int $amount_remaining The difference between amount_due and amount_paid, in %s. + * @property int $amount_shipping This is the sum of all the shipping amounts. + * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice. * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. - * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property null|bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property \Stripe\StripeObject $automatic_tax * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. - * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. - * @property string|\Stripe\Customer $customer The ID of the customer who will be billed. + * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed. * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. @@ -68,7 +71,7 @@ namespace Stripe; * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. @@ -76,33 +79,46 @@ namespace Stripe; * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. * @property null|string $footer Footer displayed on the invoice. + * @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the revision documentation for more details. * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. - * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. - * @property \Stripe\Collection $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. + * @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + * @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice + * @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + * @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + * @property \Stripe\StripeObject $payment_settings * @property int $period_end End of the usage period during which invoice items were added to this invoice. * @property int $period_start Start of the usage period during which invoice items were added to this invoice. * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. + * @property null|string|\Stripe\Quote $quote The quote this invoice was generated from. * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. - * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. + * @property null|\Stripe\StripeObject $rendering_options Options for invoice PDF rendering. + * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice. + * @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the shipping_details value if it is set, otherwise the PDF will render the shipping address from the customer. + * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more * @property \Stripe\StripeObject $status_transitions * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. - * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. - * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + * @property null|int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated + * @property null|int $subtotal_excluding_tax The integer amount in %s representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. - * @property \Stripe\StripeObject $threshold_reason + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to. + * @property null|\Stripe\StripeObject $threshold_reason * @property int $total Total after discounts and taxes. * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. + * @property null|int $total_excluding_tax The integer amount in %s representing the total amount of the invoice including all discounts but excluding all tax. * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. */ class Invoice extends ApiResource @@ -112,13 +128,17 @@ class Invoice extends ApiResource use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Delete; + use ApiOperations\NestedResource; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; const BILLING_SEND_INVOICE = 'send_invoice'; + const BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE = 'automatic_pending_invoice_item_invoice'; const BILLING_REASON_MANUAL = 'manual'; + const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept'; const BILLING_REASON_SUBSCRIPTION = 'subscription'; const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; @@ -136,49 +156,13 @@ class Invoice extends ApiResource const STATUS_UNCOLLECTIBLE = 'uncollectible'; const STATUS_VOID = 'void'; - use ApiOperations\NestedResource; - - const PATH_LINES = '/lines'; - /** * @param null|array $params * @param null|array|string $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Invoice the upcoming invoice - */ - public static function upcoming($params = null, $opts = null) - { - $url = static::classUrl() . '/upcoming'; - list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); - $obj = Util\Util::convertToStripeObject($response->json, $opts); - $obj->setLastResponse($response); - - return $obj; - } - - /** - * @param string $id the ID of the invoice on which to retrieve the lines - * @param null|array $params - * @param null|array|string $opts - * - * @throws StripeExceptionApiErrorException if the request fails - * - * @return \Stripe\Collection the list of lines (InvoiceLineItem) - */ - public static function allLines($id, $params = null, $opts = null) - { - return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return Invoice the finalized invoice + * @return \Stripe\Invoice the finalized invoice */ public function finalizeInvoice($params = null, $opts = null) { @@ -195,7 +179,7 @@ class Invoice extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Invoice the uncollectible invoice + * @return \Stripe\Invoice the uncollectible invoice */ public function markUncollectible($params = null, $opts = null) { @@ -212,7 +196,7 @@ class Invoice extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Invoice the paid invoice + * @return \Stripe\Invoice the paid invoice */ public function pay($params = null, $opts = null) { @@ -229,7 +213,7 @@ class Invoice extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Invoice the sent invoice + * @return \Stripe\Invoice the sent invoice */ public function sendInvoice($params = null, $opts = null) { @@ -246,7 +230,43 @@ class Invoice extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Invoice the voided invoice + * @return \Stripe\Invoice the upcoming invoice + */ + public static function upcoming($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of InvoiceLineItems + */ + public static function upcomingLines($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming/lines'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the voided invoice */ public function voidInvoice($params = null, $opts = null) { @@ -256,4 +276,35 @@ class Invoice extends ApiResource return $this; } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the invoice search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/invoices/search'; + + return self::_searchResource($url, $params, $opts); + } + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the invoice on which to retrieve the line items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> the list of line items + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/InvoiceItem.php b/htdocs/includes/stripe/stripe-php/lib/InvoiceItem.php index 6153bbf98b7..6dd1e2dcd45 100644 --- a/htdocs/includes/stripe/stripe-php/lib/InvoiceItem.php +++ b/htdocs/includes/stripe/stripe-php/lib/InvoiceItem.php @@ -5,12 +5,25 @@ namespace Stripe; /** - * Sometimes you want to add a charge or credit to a customer, but actually charge - * or credit the customer's card only at the end of a regular billing cycle. This - * is useful for combining several charges (to minimize per-transaction fees), or - * for having Stripe tabulate your usage-based billing totals. + * Invoice Items represent the component lines of an invoice. An invoice item is + * added to an invoice by creating or updating it with an invoice + * field, at which point it will be included as an invoice line item + * within invoice.lines. * - * Related guide: subscription. Sometimes you + * want to add a charge or credit to a customer, but actually charge or credit the + * customer’s card only at the end of a regular billing cycle. This is useful for + * combining several charges (to minimize per-transaction fees), or for having + * Stripe tabulate your usage-based billing totals. + * + * Related guides: Integrate with the + * Invoicing API, Subscription * Invoices. * @@ -32,8 +45,9 @@ namespace Stripe; * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. - * @property string $subscription_item The subscription item that this invoice item has been created for, if any. + * @property null|string $subscription_item The subscription item that this invoice item has been created for, if any. * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice item belongs to. * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. */ diff --git a/htdocs/includes/stripe/stripe-php/lib/InvoiceLineItem.php b/htdocs/includes/stripe/stripe-php/lib/InvoiceLineItem.php index e579afb6a8d..d70b18b107b 100644 --- a/htdocs/includes/stripe/stripe-php/lib/InvoiceLineItem.php +++ b/htdocs/includes/stripe/stripe-php/lib/InvoiceLineItem.php @@ -8,24 +8,27 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount The amount, in %s. + * @property null|int $amount_excluding_tax The integer amount in %s representing the amount for this line item, excluding all tax and discounts. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. - * @property string $invoice_item The ID of the invoice item associated with this line item if any. + * @property null|string $invoice_item The ID of the invoice item associated with this line item if any. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. * @property \Stripe\StripeObject $period * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. * @property null|\Stripe\Price $price The price of the line item. * @property bool $proration Whether this is a proration. + * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. * @property null|string $subscription The subscription that the invoice item pertains to, if any. - * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. - * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item - * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property null|string $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. + * @property null|\Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. + * @property null|string $unit_amount_excluding_tax The amount in %s representing the unit amount for this line item, excluding all tax and discounts. */ class InvoiceLineItem extends ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/IssuerFraudRecord.php b/htdocs/includes/stripe/stripe-php/lib/IssuerFraudRecord.php deleted file mode 100644 index 805dc502885..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/IssuerFraudRecord.php +++ /dev/null @@ -1,24 +0,0 @@ -ISO currency code, in lowercase. Must be a supported currency. * @property \Stripe\StripeObject $merchant_data * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $network_data Details about the authorization, such as identifiers, set by the card network. * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. - * @property \Stripe\StripeObject[] $request_history History of every time the authorization was approved/denied (whether approved/denied by you directly or by Stripe based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization or partial capture, you can look at this field to see the previous states of the authorization. + * @property \Stripe\StripeObject[] $request_history History of every time a pending_request authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. * @property string $status The current status of the authorization in its lifecycle. * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. + * @property null|\Stripe\StripeObject $treasury Treasury details related to this authorization if it was created on a FinancialAccount. * @property \Stripe\StripeObject $verification_data - * @property null|string $wallet What, if any, digital wallet was used for this authorization. One of apple_pay, google_pay, or samsung_pay. + * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. Will populate as null when no digital wallet was utilized. */ class Authorization extends \Stripe\ApiResource { @@ -51,7 +53,7 @@ class Authorization extends \Stripe\ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Authorization the approved authorization + * @return \Stripe\Issuing\Authorization the approved authorization */ public function approve($params = null, $opts = null) { @@ -68,7 +70,7 @@ class Authorization extends \Stripe\ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Authorization the declined authorization + * @return \Stripe\Issuing\Authorization the declined authorization */ public function decline($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Issuing/Card.php b/htdocs/includes/stripe/stripe-php/lib/Issuing/Card.php index e0ac774e75d..16d6e9d3d66 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Issuing/Card.php +++ b/htdocs/includes/stripe/stripe-php/lib/Issuing/Card.php @@ -14,21 +14,23 @@ namespace Stripe\Issuing; * @property null|string $cancellation_reason The reason why the card was canceled. * @property \Stripe\Issuing\Cardholder $cardholder

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

Related guide: How to create a Cardholder

* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property string $currency Three-letter ISO currency code, in lowercase. Supported currencies are usd in the US, eur in the EU, and gbp in the UK. + * @property null|string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. * @property int $exp_month The expiration month of the card. * @property int $exp_year The expiration year of the card. + * @property null|string $financial_account The financial account this card is attached to. * @property string $last4 The last 4 digits of the card number. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property null|string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. * @property null|string $replacement_reason The reason why the previous card needed to be replaced. * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. * @property \Stripe\StripeObject $spending_controls - * @property string $status Whether authorizations can be approved on this card. + * @property string $status Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to inactive. * @property string $type The type of the card. + * @property null|\Stripe\StripeObject $wallets Information relating to digital wallets (like Apple Pay and Google Pay). */ class Card extends \Stripe\ApiResource { @@ -38,22 +40,4 @@ class Card extends \Stripe\ApiResource use \Stripe\ApiOperations\Create; use \Stripe\ApiOperations\Retrieve; use \Stripe\ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card - */ - public function details($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/details'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Issuing/Cardholder.php b/htdocs/includes/stripe/stripe-php/lib/Issuing/Cardholder.php index 931b7ce8e30..1e220d23c80 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Issuing/Cardholder.php +++ b/htdocs/includes/stripe/stripe-php/lib/Issuing/Cardholder.php @@ -22,7 +22,7 @@ namespace Stripe\Issuing; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The cardholder's name. This will be printed on cards issued to them. - * @property null|string $phone_number The cardholder's phone number. + * @property null|string $phone_number The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the 3D Secure documentation for more details. * @property \Stripe\StripeObject $requirements * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. * @property string $status Specifies whether to permit authorizations on this cardholder's cards. diff --git a/htdocs/includes/stripe/stripe-php/lib/Issuing/Dispute.php b/htdocs/includes/stripe/stripe-php/lib/Issuing/Dispute.php index 5f24864b453..644831a7c38 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Issuing/Dispute.php +++ b/htdocs/includes/stripe/stripe-php/lib/Issuing/Dispute.php @@ -15,15 +15,16 @@ namespace Stripe\Issuing; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Disputed amount. Usually the amount of the disputed_transaction, but can differ (usually because of currency fluctuation). + * @property int $amount Disputed amount in the card's currency and in the smallest currency unit. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency The currency the disputed_transaction was made in. + * @property string $currency The currency the transaction was made in. * @property \Stripe\StripeObject $evidence * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $status Current status of the dispute. * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. + * @property null|\Stripe\StripeObject $treasury Treasury details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts */ class Dispute extends \Stripe\ApiResource { @@ -40,7 +41,7 @@ class Dispute extends \Stripe\ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Dispute the submited dispute + * @return \Stripe\Issuing\Dispute the submited dispute */ public function submit($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Issuing/Transaction.php b/htdocs/includes/stripe/stripe-php/lib/Issuing/Transaction.php index 3c44d7ec17a..4586b2fa104 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Issuing/Transaction.php +++ b/htdocs/includes/stripe/stripe-php/lib/Issuing/Transaction.php @@ -31,7 +31,9 @@ namespace Stripe\Issuing; * @property \Stripe\StripeObject $merchant_data * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property null|\Stripe\StripeObject $treasury Treasury details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts * @property string $type The nature of the transaction. + * @property null|string $wallet The digital wallet used for this transaction. One of apple_pay, google_pay, or samsung_pay. */ class Transaction extends \Stripe\ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/LineItem.php b/htdocs/includes/stripe/stripe-php/lib/LineItem.php index d3e55af2022..689f13a6738 100644 --- a/htdocs/includes/stripe/stripe-php/lib/LineItem.php +++ b/htdocs/includes/stripe/stripe-php/lib/LineItem.php @@ -9,18 +9,18 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|int $amount_subtotal Total before any discounts or taxes is applied. - * @property null|int $amount_total Total after discounts and taxes. + * @property int $amount_discount Total discount amount applied. If no discounts were applied, defaults to 0. + * @property int $amount_subtotal Total before any discounts or taxes are applied. + * @property int $amount_tax Total tax amount applied. If no tax was applied, defaults to 0. + * @property int $amount_total Total after discounts and taxes. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. - * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. - * @property \Stripe\Price $price

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

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

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

+ * @property null|\Stripe\StripeObject[] $discounts The discounts applied to the line item. + * @property null|\Stripe\Price $price The price used to generate the line item. * @property null|int $quantity The quantity of products being purchased. - * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. + * @property null|\Stripe\StripeObject[] $taxes The taxes applied to the line item. */ class LineItem extends ApiResource { const OBJECT_NAME = 'item'; - - use ApiOperations\All; } diff --git a/htdocs/includes/stripe/stripe-php/lib/Mandate.php b/htdocs/includes/stripe/stripe-php/lib/Mandate.php index 3452a014216..6553abb7468 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Mandate.php +++ b/htdocs/includes/stripe/stripe-php/lib/Mandate.php @@ -12,10 +12,10 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property \Stripe\StripeObject $customer_acceptance * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $multi_use + * @property null|\Stripe\StripeObject $multi_use * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. * @property \Stripe\StripeObject $payment_method_details - * @property \Stripe\StripeObject $single_use + * @property null|\Stripe\StripeObject $single_use * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. * @property string $type The type of the mandate. */ diff --git a/htdocs/includes/stripe/stripe-php/lib/Order.php b/htdocs/includes/stripe/stripe-php/lib/Order.php deleted file mode 100644 index fd3630edb8c..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Order.php +++ /dev/null @@ -1,81 +0,0 @@ -products. You can - * create, retrieve, and pay individual orders, as well as list all orders. Orders - * are identified by a unique, random ID. - * - * Related guide: Tax, Shipping, and - * Inventory. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. - * @property null|int $amount_returned The total amount that was returned to the customer. - * @property null|string $application ID of the Connect Application that created the order. - * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. - * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string|\Stripe\Customer $customer The customer used for the order. - * @property null|string $email The email address of the customer placing the order. - * @property string $external_coupon_code External coupon code to load for this order. - * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order. - * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. - * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. - * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. - * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. - * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. - * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. - */ -class Order extends ApiResource -{ - const OBJECT_NAME = 'order'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Retrieve; - use ApiOperations\Update; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn the newly created return - */ - public function returnOrder($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/returns'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - - return Util\Util::convertToStripeObject($response, $opts); - } - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return Order the paid order - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/OrderItem.php b/htdocs/includes/stripe/stripe-php/lib/OrderItem.php deleted file mode 100644 index e2e6e39a287..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/OrderItem.php +++ /dev/null @@ -1,19 +0,0 @@ -order items. Returns always - * belong to an order, and may optionally contain a refund. - * - * Related guide: Handling - * Returns. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property \Stripe\OrderItem[] $items The items included in this order return. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string|\Stripe\Order $order The order that this return includes items from. - * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. - */ -class OrderReturn extends ApiResource -{ - const OBJECT_NAME = 'order_return'; - - use ApiOperations\All; - use ApiOperations\Retrieve; -} diff --git a/htdocs/includes/stripe/stripe-php/lib/PaymentIntent.php b/htdocs/includes/stripe/stripe-php/lib/PaymentIntent.php index 2d204e9da4a..503d617a434 100644 --- a/htdocs/includes/stripe/stripe-php/lib/PaymentIntent.php +++ b/htdocs/includes/stripe/stripe-php/lib/PaymentIntent.php @@ -22,21 +22,23 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). * @property int $amount_capturable Amount that can be captured from this PaymentIntent. + * @property null|\Stripe\StripeObject $amount_details * @property int $amount_received Amount that was collected by this PaymentIntent. * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. + * @property null|\Stripe\StripeObject $automatic_payment_methods Settings to configure compatible payment methods from the Stripe Dashboard * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). * @property string $capture_method Controls when the funds will be captured from the customer's account. - * @property \Stripe\Collection $charges Charges that were created by this PaymentIntent, if any. - * @property null|string $client_secret

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

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

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

+ * @property null|string $client_secret

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

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

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

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

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

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

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

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

Indicates that you intend to make future payments with this PaymentIntent's payment method.

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

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

* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. @@ -62,6 +65,7 @@ class PaymentIntent extends ApiResource use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const STATUS_CANCELED = 'canceled'; @@ -78,7 +82,24 @@ class PaymentIntent extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return PaymentIntent the canceled payment intent + * @return \Stripe\PaymentIntent the applied payment intent + */ + public function applyCustomerBalance($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/apply_customer_balance'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the canceled payment intent */ public function cancel($params = null, $opts = null) { @@ -95,7 +116,7 @@ class PaymentIntent extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return PaymentIntent the captured payment intent + * @return \Stripe\PaymentIntent the captured payment intent */ public function capture($params = null, $opts = null) { @@ -112,7 +133,7 @@ class PaymentIntent extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return PaymentIntent the confirmed payment intent + * @return \Stripe\PaymentIntent the confirmed payment intent */ public function confirm($params = null, $opts = null) { @@ -122,4 +143,53 @@ class PaymentIntent extends ApiResource return $this; } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the incremented payment intent + */ + public function incrementAuthorization($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/increment_authorization'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent the verified payment intent + */ + public function verifyMicrodeposits($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify_microdeposits'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the payment intent search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/payment_intents/search'; + + return self::_searchResource($url, $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/PaymentLink.php b/htdocs/includes/stripe/stripe-php/lib/PaymentLink.php new file mode 100644 index 00000000000..d8a1f3f68dd --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/PaymentLink.php @@ -0,0 +1,92 @@ +checkout session to + * render the payment page. You can use checkout + * session events to track payments through payment links. + * + * Related guide: Payment Links API + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the payment link's url is active. If false, customers visiting the URL will be shown a page saying that the link has been deactivated. + * @property \Stripe\StripeObject $after_completion + * @property bool $allow_promotion_codes Whether user redeemable promotion codes are enabled. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + * @property null|float $application_fee_percent This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + * @property \Stripe\StripeObject $automatic_tax + * @property string $billing_address_collection Configuration for collecting the customer's billing address. + * @property null|\Stripe\StripeObject $consent_collection When set, provides configuration to gather active consent from customers. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject[] $custom_fields Collect additional information from your customer using custom fields. Up to 2 fields are supported. + * @property \Stripe\StripeObject $custom_text + * @property string $customer_creation Configuration for Customer creation during checkout. + * @property null|\Stripe\StripeObject $invoice_creation Configuration for creating invoice for payment mode payment links. + * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items The line items representing what is being sold. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property null|\Stripe\StripeObject $payment_intent_data Indicates the parameters to be passed to PaymentIntent creation during checkout. + * @property string $payment_method_collection Configuration for collecting a payment method during checkout. + * @property null|string[] $payment_method_types The list of payment method types that customers can use. When null, Stripe will dynamically show relevant payment methods you've enabled in your payment method settings. + * @property \Stripe\StripeObject $phone_number_collection + * @property null|\Stripe\StripeObject $shipping_address_collection Configuration for collecting the customer's shipping address. + * @property \Stripe\StripeObject[] $shipping_options The shipping rate options applied to the session. + * @property string $submit_type Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + * @property null|\Stripe\StripeObject $subscription_data When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use subscription_data. + * @property \Stripe\StripeObject $tax_id_collection + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + * @property string $url The public URL that can be shared with customers. + */ +class PaymentLink extends ApiResource +{ + const OBJECT_NAME = 'payment_link'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; + const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + + const CUSTOMER_CREATION_ALWAYS = 'always'; + const CUSTOMER_CREATION_IF_REQUIRED = 'if_required'; + + const PAYMENT_METHOD_COLLECTION_ALWAYS = 'always'; + const PAYMENT_METHOD_COLLECTION_IF_REQUIRED = 'if_required'; + + const SUBMIT_TYPE_AUTO = 'auto'; + const SUBMIT_TYPE_BOOK = 'book'; + const SUBMIT_TYPE_DONATE = 'donate'; + const SUBMIT_TYPE_PAY = 'pay'; + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems + */ + public static function allLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/PaymentMethod.php b/htdocs/includes/stripe/stripe-php/lib/PaymentMethod.php index d9c9e2b52cc..b81ee5a5631 100644 --- a/htdocs/includes/stripe/stripe-php/lib/PaymentMethod.php +++ b/htdocs/includes/stripe/stripe-php/lib/PaymentMethod.php @@ -5,11 +5,11 @@ namespace Stripe; /** - * PaymentMethod objects represent your customer's payment instruments. They can be - * used with PaymentIntents to - * collect payments or saved to Customer objects to store instrument details for - * future payments. + * collect payments or save them to Customer objects to store instrument details + * for future payments. * * Related guides: Payment Methods and @@ -18,28 +18,43 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $alipay - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bacs_debit - * @property \Stripe\StripeObject $bancontact + * @property null|\Stripe\StripeObject $acss_debit + * @property null|\Stripe\StripeObject $affirm + * @property null|\Stripe\StripeObject $afterpay_clearpay + * @property null|\Stripe\StripeObject $alipay + * @property null|\Stripe\StripeObject $au_becs_debit + * @property null|\Stripe\StripeObject $bacs_debit + * @property null|\Stripe\StripeObject $bancontact * @property \Stripe\StripeObject $billing_details - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present + * @property null|\Stripe\StripeObject $blik + * @property null|\Stripe\StripeObject $boleto + * @property null|\Stripe\StripeObject $card + * @property null|\Stripe\StripeObject $card_present * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. - * @property \Stripe\StripeObject $eps - * @property \Stripe\StripeObject $fpx - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $grabpay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $interac_present + * @property null|\Stripe\StripeObject $customer_balance + * @property null|\Stripe\StripeObject $eps + * @property null|\Stripe\StripeObject $fpx + * @property null|\Stripe\StripeObject $giropay + * @property null|\Stripe\StripeObject $grabpay + * @property null|\Stripe\StripeObject $ideal + * @property null|\Stripe\StripeObject $interac_present + * @property null|\Stripe\StripeObject $klarna + * @property null|\Stripe\StripeObject $konbini + * @property null|\Stripe\StripeObject $link * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $oxxo - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort + * @property null|\Stripe\StripeObject $oxxo + * @property null|\Stripe\StripeObject $p24 + * @property null|\Stripe\StripeObject $paynow + * @property null|\Stripe\StripeObject $pix + * @property null|\Stripe\StripeObject $promptpay + * @property null|\Stripe\StripeObject $radar_options Options to configure Radar. See Radar Session for more information. + * @property null|\Stripe\StripeObject $sepa_debit + * @property null|\Stripe\StripeObject $sofort * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + * @property null|\Stripe\StripeObject $us_bank_account + * @property null|\Stripe\StripeObject $wechat_pay */ class PaymentMethod extends ApiResource { @@ -56,7 +71,7 @@ class PaymentMethod extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return PaymentMethod the attached payment method + * @return \Stripe\PaymentMethod the attached payment method */ public function attach($params = null, $opts = null) { @@ -73,7 +88,7 @@ class PaymentMethod extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return PaymentMethod the detached payment method + * @return \Stripe\PaymentMethod the detached payment method */ public function detach($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Payout.php b/htdocs/includes/stripe/stripe-php/lib/Payout.php index 46f86181e4b..f3d20f79654 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Payout.php +++ b/htdocs/includes/stripe/stripe-php/lib/Payout.php @@ -53,7 +53,9 @@ class Payout extends ApiResource const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; const FAILURE_DECLINED = 'declined'; + const FAILURE_INCORRECT_ACCOUNT_HOLDER_ADDRESS = 'incorrect_account_holder_address'; const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; + const FAILURE_INCORRECT_ACCOUNT_HOLDER_TAX_ID = 'incorrect_account_holder_tax_id'; const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; const FAILURE_INVALID_CURRENCY = 'invalid_currency'; @@ -78,7 +80,7 @@ class Payout extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Payout the canceled payout + * @return \Stripe\Payout the canceled payout */ public function cancel($params = null, $opts = null) { @@ -95,7 +97,7 @@ class Payout extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Payout the reversed payout + * @return \Stripe\Payout the reversed payout */ public function reverse($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Person.php b/htdocs/includes/stripe/stripe-php/lib/Person.php index 151870a86f7..1a54b2919d4 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Person.php +++ b/htdocs/includes/stripe/stripe-php/lib/Person.php @@ -7,35 +7,48 @@ namespace Stripe; /** * This is an object representing a person associated with a Stripe account. * + * A platform cannot access a Standard or Express account's persons after the + * account starts onboarding, such as after generating an account link for the + * account. See the Standard onboarding + * or Express onboarding + * documentation for information about platform pre-filling and account + * onboarding steps. + * * Related guide: Handling * Identity Verification with the API. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $account The account the person is associated with. - * @property \Stripe\StripeObject $address + * @property null|string $account The account the person is associated with. + * @property null|\Stripe\StripeObject $address * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property \Stripe\StripeObject $dob + * @property null|\Stripe\StripeObject $dob * @property null|string $email The person's email address. * @property null|string $first_name The person's first name. * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). + * @property null|string[] $full_name_aliases A list of alternate names or aliases that the person is known by. + * @property null|\Stripe\StripeObject $future_requirements Information about the upcoming new requirements for this person, including what information needs to be collected, and by when. * @property null|string $gender The person's gender (International regulations require either "male" or "female"). - * @property bool $id_number_provided Whether the person's id_number was provided. + * @property null|bool $id_number_provided Whether the person's id_number was provided. + * @property null|bool $id_number_secondary_provided Whether the person's id_number_secondary was provided. * @property null|string $last_name The person's last name. * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). * @property null|string $maiden_name The person's maiden name. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nationality The country where the person is a national. * @property null|string $phone The person's phone number. - * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - * @property \Stripe\StripeObject $relationship + * @property null|string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + * @property null|\Stripe\StripeObject $registered_address + * @property null|\Stripe\StripeObject $relationship * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. - * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). - * @property \Stripe\StripeObject $verification + * @property null|bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). + * @property null|\Stripe\StripeObject $verification */ class Person extends ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/Plan.php b/htdocs/includes/stripe/stripe-php/lib/Plan.php index bff735d78a5..59cb7662dd2 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Plan.php +++ b/htdocs/includes/stripe/stripe-php/lib/Plan.php @@ -22,14 +22,14 @@ namespace Stripe; * Related guides: Set up * a subscription and more about products and prices. + * href="https://stripe.com/docs/products-prices/overview">products and prices. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the plan can be used for new purchases. * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. - * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. - * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. + * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. @@ -39,7 +39,7 @@ namespace Stripe; * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|string $nickname A brief description of the plan, hidden from customers. * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. diff --git a/htdocs/includes/stripe/stripe-php/lib/Price.php b/htdocs/includes/stripe/stripe-php/lib/Price.php index 9d3c5540e44..72714d4920b 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Price.php +++ b/htdocs/includes/stripe/stripe-php/lib/Price.php @@ -20,8 +20,8 @@ namespace Stripe; * href="https://stripe.com/docs/billing/subscriptions/set-up-subscription">Set up * a subscription, create an invoice, - * and more about products - * and prices. + * and more about products and prices. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. @@ -29,18 +29,21 @@ namespace Stripe; * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|\Stripe\StripeObject $currency_options Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency. + * @property null|\Stripe\StripeObject $custom_unit_amount When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. + * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string $nickname A brief description of the plan, hidden from customers. + * @property null|string $nickname A brief description of the price, hidden from customers. * @property string|\Stripe\Product $product The ID of the product this price is associated with. * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. - * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tax_behavior Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed. + * @property null|\Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. - * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. + * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. */ class Price extends ApiResource { @@ -49,14 +52,34 @@ class Price extends ApiResource use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const BILLING_SCHEME_PER_UNIT = 'per_unit'; const BILLING_SCHEME_TIERED = 'tiered'; + const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; + const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; + const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; + const TIERS_MODE_GRADUATED = 'graduated'; const TIERS_MODE_VOLUME = 'volume'; const TYPE_ONE_TIME = 'one_time'; const TYPE_RECURRING = 'recurring'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the price search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/prices/search'; + + return self::_searchResource($url, $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Product.php b/htdocs/includes/stripe/stripe-php/lib/Product.php index 5afe1f1373e..8f8d8ad315a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Product.php +++ b/htdocs/includes/stripe/stripe-php/lib/Product.php @@ -9,14 +9,16 @@ namespace Stripe; * For example, you might offer a Standard and Premium version of your goods or * service; each version would be a separate Product. They can be used in * conjunction with Prices to - * configure pricing in Checkout and Subscriptions. + * configure pricing in Payment Links, Checkout, and Subscriptions. * * Related guides: Set up - * a subscription or accept one-time - * payments with Checkout and more about Products and Prices + * a subscription, share a Payment + * Link, accept + * payments with Checkout, and more about Products and Prices * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. @@ -24,19 +26,21 @@ namespace Stripe; * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. + * @property null|string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. + * @property null|string|\Stripe\Price $default_price The ID of the Price object that is the default price for this product. * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $name The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own package_dimensions. Only applicable to products of type=good. - * @property null|bool $shippable Whether this product is a shipped good. Only applicable to products of type=good. + * @property string $name The product's name, meant to be displayable to the customer. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. + * @property null|bool $shippable Whether this product is shipped (i.e., physical goods). * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. + * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. - * @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions. + * @property null|string $unit_label A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - * @property null|string $url A URL of a publicly-accessible webpage for this product. Only applicable to products of type=good. + * @property null|string $url A URL of a publicly-accessible webpage for this product. */ class Product extends ApiResource { @@ -46,8 +50,24 @@ class Product extends ApiResource use ApiOperations\Create; use ApiOperations\Delete; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const TYPE_GOOD = 'good'; const TYPE_SERVICE = 'service'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the product search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/products/search'; + + return self::_searchResource($url, $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/PromotionCode.php b/htdocs/includes/stripe/stripe-php/lib/PromotionCode.php index f4bb0f4f106..7eb0c407427 100644 --- a/htdocs/includes/stripe/stripe-php/lib/PromotionCode.php +++ b/htdocs/includes/stripe/stripe-php/lib/PromotionCode.php @@ -5,14 +5,15 @@ namespace Stripe; /** - * A Promotion Code represents a customer-redeemable code for a coupon. It can be - * used to create multiple codes for a single coupon. + * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create + * multiple codes for a single coupon. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. * @property string $code The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. - * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to invoices or orders. Coupons do not work with conventional one-off charges. + * @property \Stripe\Coupon $coupon A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. diff --git a/htdocs/includes/stripe/stripe-php/lib/Quote.php b/htdocs/includes/stripe/stripe-php/lib/Quote.php new file mode 100644 index 00000000000..2f933beca51 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Quote.php @@ -0,0 +1,171 @@ +charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. Defaults to charge_automatically. + * @property \Stripe\StripeObject $computed + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + * @property null|(string|\Stripe\TaxRate)[] $default_tax_rates The tax rates applied to this quote. + * @property null|string $description A description that will be displayed on the quote PDF. + * @property (string|\Stripe\Discount)[] $discounts The discounts applied to this quote. + * @property int $expires_at The date on which the quote will be canceled if in open or draft status. Measured in seconds since the Unix epoch. + * @property null|string $footer A footer that will be displayed on the quote PDF. + * @property null|\Stripe\StripeObject $from_quote Details of the quote that was cloned. See the cloning documentation for more details. + * @property null|string $header A header that will be displayed on the quote PDF. + * @property null|string|\Stripe\Invoice $invoice The invoice that was created from this quote. + * @property null|\Stripe\StripeObject $invoice_settings All invoices will be billed using the specified settings. + * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $number A unique number that identifies this particular quote. This number is assigned once the quote is finalized. + * @property null|string|\Stripe\Account $on_behalf_of The account on behalf of which to charge. See the Connect documentation for details. + * @property string $status The status of the quote. + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Subscription $subscription The subscription that was created or updated from this quote. + * @property \Stripe\StripeObject $subscription_data + * @property null|string|\Stripe\SubscriptionSchedule $subscription_schedule The subscription schedule that was created or updated from this quote. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this quote belongs to. + * @property \Stripe\StripeObject $total_details + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + */ +class Quote extends ApiResource +{ + const OBJECT_NAME = 'quote'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; + + const STATUS_ACCEPTED = 'accepted'; + const STATUS_CANCELED = 'canceled'; + const STATUS_DRAFT = 'draft'; + const STATUS_OPEN = 'open'; + + /** + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function pdf($readBodyChunkCallable, $params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (null === $opts->apiBase) { + $opts->apiBase = Stripe::$apiUploadBase; + } + + $url = $this->instanceUrl() . '/pdf'; + $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the accepted quote + */ + public function accept($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/accept'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the canceled quote + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote the finalized quote + */ + public function finalizeQuote($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems + */ + public static function allComputedUpfrontLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/computed_upfront_line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> list of LineItems + */ + public static function allLineItems($id, $params = null, $opts = null) + { + $url = static::resourceUrl($id) . '/line_items'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php b/htdocs/includes/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php index eb1b351c6be..1a00aaf4b3c 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php +++ b/htdocs/includes/stripe/stripe-php/lib/Radar/EarlyFraudWarning.php @@ -19,6 +19,7 @@ namespace Stripe\Radar; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the Payment Intent this early fraud warning is for, optionally expanded. */ class EarlyFraudWarning extends \Stripe\ApiResource { diff --git a/htdocs/includes/stripe/stripe-php/lib/Radar/ValueList.php b/htdocs/includes/stripe/stripe-php/lib/Radar/ValueList.php index bcbef74cd4a..8cd62236f77 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Radar/ValueList.php +++ b/htdocs/includes/stripe/stripe-php/lib/Radar/ValueList.php @@ -17,8 +17,8 @@ namespace Stripe\Radar; * @property string $alias The name of the value list for use in rules. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $created_by The name or email address of the user who created this value list. - * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, or case_sensitive_string. - * @property \Stripe\Collection $list_items List of items contained within this value list. + * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, case_sensitive_string, or customer_id. + * @property \Stripe\Collection<\Stripe\Radar\ValueListItem> $list_items List of items contained within this value list. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $name The name of the value list. diff --git a/htdocs/includes/stripe/stripe-php/lib/Recipient.php b/htdocs/includes/stripe/stripe-php/lib/Recipient.php deleted file mode 100644 index 8d5ad4c0a71..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Recipient.php +++ /dev/null @@ -1,44 +0,0 @@ -Recipient objects, you can transfer money from your Stripe - * account to a third-party bank account or debit card. The API allows you to - * create, delete, and update your recipients. You can retrieve individual - * recipients as well as a list of all your recipients. - * - * Recipient objects have been deprecated in favor of Connect, specifically Connect's much - * more powerful Account objects. - * Stripe accounts that don't already use recipients can no longer begin doing so. - * Please use Account objects instead. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. - * @property null|\Stripe\Collection $cards - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. - * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|string $email - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|string|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. - * @property null|string $name Full, legal name of the recipient. - * @property string|\Stripe\Account $rolled_back_from - * @property string $type Type of the recipient, one of individual or corporation. - * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future - */ -class Recipient extends ApiResource -{ - const OBJECT_NAME = 'recipient'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Refund.php b/htdocs/includes/stripe/stripe-php/lib/Refund.php index f5e975fd83f..8692f03a44b 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Refund.php +++ b/htdocs/includes/stripe/stripe-php/lib/Refund.php @@ -18,15 +18,17 @@ namespace Stripe; * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) - * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. - * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + * @property null|string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, charge_for_pending_refund_disputed, insufficient_funds, declined, merchant_request or unknown. + * @property null|string $instructions_email Email to which refund instructions, if required, are sent to. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $next_action * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. - * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. + * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, requires_action, succeeded, failed, or canceled. Refer to our refunds documentation for more details. * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. */ class Refund extends ApiResource @@ -43,16 +45,30 @@ class Refund extends ApiResource const FAILURE_REASON_UNKNOWN = 'unknown'; const REASON_DUPLICATE = 'duplicate'; + const REASON_EXPIRED_UNCAPTURED_CHARGE = 'expired_uncaptured_charge'; const REASON_FRAUDULENT = 'fraudulent'; const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; const STATUS_CANCELED = 'canceled'; const STATUS_FAILED = 'failed'; const STATUS_PENDING = 'pending'; + const STATUS_REQUIRES_ACTION = 'requires_action'; const STATUS_SUCCEEDED = 'succeeded'; /** - * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund the canceled refund */ - const FAILURE_REASON = 'expired_or_canceled_card'; + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportRun.php b/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportRun.php index 458cbed6cd8..7c3d2a993ae 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportRun.php +++ b/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportRun.php @@ -12,15 +12,15 @@ namespace Stripe\Reporting; * href="https://stripe.com/docs/reporting/statements/api">API Access to * Reports. * - * Note that reports can only be run based on your live-mode data (not test-mode - * data), and thus related requests must be made with a live-mode API key. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). - * @property bool $livemode Always true: reports can only be run on live-mode data. + * @property bool $livemode true if the report is run on live mode data and false if it is run on test mode data. * @property \Stripe\StripeObject $parameters * @property string $report_type The ID of the report type to run, such as "balance.summary.1". * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). diff --git a/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportType.php b/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportType.php index cf753012a45..4725656e49a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportType.php +++ b/htdocs/includes/stripe/stripe-php/lib/Reporting/ReportType.php @@ -12,8 +12,8 @@ namespace Stripe\Reporting; * documentation for those Report Type IDs, along with required and optional * parameters. * - * Note that reports can only be run based on your live-mode data (not test-mode - * data), and thus related requests must be made with a live-mode API key. * * @property string $id The ID of the Report Type, such as balance.summary.1. @@ -21,6 +21,7 @@ namespace Stripe\Reporting; * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property string $name Human-readable name of the Report Type * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. diff --git a/htdocs/includes/stripe/stripe-php/lib/Review.php b/htdocs/includes/stripe/stripe-php/lib/Review.php index 606b41054d4..8833f810870 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Review.php +++ b/htdocs/includes/stripe/stripe-php/lib/Review.php @@ -15,15 +15,15 @@ namespace Stripe; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable. * @property null|string|\Stripe\Charge $charge The charge associated with this review. - * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, or disputed. + * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, disputed, or redacted. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $ip_address The IP address where the payment originated. * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property bool $open If true, the review needs action. * @property string $opened_reason The reason the review was opened. One of rule or manual. - * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. - * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, or disputed. + * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. + * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, disputed, or redacted. * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. */ class Review extends ApiResource @@ -53,7 +53,7 @@ class Review extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Review the approved review + * @return \Stripe\Review the approved review */ public function approve($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/SKU.php b/htdocs/includes/stripe/stripe-php/lib/SKU.php deleted file mode 100644 index b418c6c5df7..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/SKU.php +++ /dev/null @@ -1,44 +0,0 @@ -stock keeping units. - * SKUs describe specific product variations, taking into account any combination - * of: attributes, currency, and cost. For example, a product may be a T-shirt, - * whereas a specific SKU represents the size: large, color: - * red version of that shirt. - * - * Can also be used to manage inventory. - * - * Related guide: Tax, Shipping, and - * Inventory. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property bool $active Whether the SKU is available for purchase. - * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. - * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. - * @property \Stripe\StripeObject $inventory - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. - * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. - * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ -class SKU extends ApiResource -{ - const OBJECT_NAME = 'sku'; - - use ApiOperations\All; - use ApiOperations\Create; - use ApiOperations\Delete; - use ApiOperations\Retrieve; - use ApiOperations\Update; -} diff --git a/htdocs/includes/stripe/stripe-php/lib/SearchResult.php b/htdocs/includes/stripe/stripe-php/lib/SearchResult.php new file mode 100644 index 00000000000..b6005314625 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/SearchResult.php @@ -0,0 +1,237 @@ +Collection in that they both wrap + * around a list of objects and provide pagination. However the + * SearchResult object paginates by relying on a + * next_page token included in the response rather than using + * object IDs and a starting_before/ending_after + * parameter. Thus, SearchResult only supports forwards pagination. + * + * The {@see $total_count} property is only available when + * the `expand` parameter contains `total_count`. + * + * @template TStripeObject of StripeObject + * @template-implements \IteratorAggregate + * + * @property string $object + * @property string $url + * @property string $next_page + * @property int $total_count + * @property bool $has_more + * @property TStripeObject[] $data + */ +class SearchResult extends StripeObject implements \Countable, \IteratorAggregate +{ + const OBJECT_NAME = 'search_result'; + + use ApiOperations\Request; + + /** @var array */ + protected $filters = []; + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * Returns the filters. + * + * @return array the filters + */ + public function getFilters() + { + return $this->filters; + } + + /** + * Sets the filters, removing paging options. + * + * @param array $filters the filters + */ + public function setFilters($filters) + { + $this->filters = $filters; + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($k) + { + if (\is_string($k)) { + return parent::offsetGet($k); + } + $msg = "You tried to access the {$k} index, but SearchResult " . + 'types only support string keys. (HINT: Search calls ' . + 'return an object with a `data` (which is the data ' . + "array). You likely want to call ->data[{$k}])"; + + throw new Exception\InvalidArgumentException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws Exception\ApiErrorException + * + * @return SearchResult + */ + public function all($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + if (!($obj instanceof \Stripe\SearchResult)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\SearchResult::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @return int the number of objects in the current page + */ + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * across objects in the current page + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * @return \Generator|TStripeObject[] A generator that can be used to + * iterate across all objects across all pages. As page boundaries are + * encountered, the next page will be fetched automatically for + * continued iteration. + */ + public function autoPagingIterator() + { + $page = $this; + + while (true) { + foreach ($page as $item) { + yield $item; + } + $page = $page->nextPage(); + + if ($page->isEmpty()) { + break; + } + } + } + + /** + * Returns an empty set of search results. This is returned from + * {@see nextPage()} when we know that there isn't a next page in order to + * replicate the behavior of the API when it attempts to return a page + * beyond the last. + * + * @param null|array|string $opts + * + * @return SearchResult + */ + public static function emptySearchResult($opts = null) + { + return SearchResult::constructFrom(['data' => []], $opts); + } + + /** + * Returns true if the page object contains no element. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->data); + } + + /** + * Fetches the next page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return SearchResult + */ + public function nextPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptySearchResult($opts); + } + + $params = \array_merge( + $this->filters ?: [], + ['page' => $this->next_page], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Gets the first item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function first() + { + return \count($this->data) > 0 ? $this->data[0] : null; + } + + /** + * Gets the last item from the current page. Returns `null` if the current page is empty. + * + * @return null|TStripeObject + */ + public function last() + { + return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; + } + + private function extractPathAndUpdateParams($params) + { + $url = \parse_url($this->url); + + if (!isset($url['path'])) { + throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = []; + \parse_str($url['query'], $query); + $params = \array_merge($params ?: [], $query); + } + + return [$url['path'], $params]; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/AbstractService.php b/htdocs/includes/stripe/stripe-php/lib/Service/AbstractService.php index ed092c8b84e..145af675990 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/AbstractService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/AbstractService.php @@ -12,6 +12,11 @@ abstract class AbstractService */ protected $client; + /** + * @var \Stripe\StripeStreamingClientInterface + */ + protected $streamingClient; + /** * Initializes a new instance of the {@link AbstractService} class. * @@ -20,6 +25,7 @@ abstract class AbstractService public function __construct($client) { $this->client = $client; + $this->streamingClient = $client; } /** @@ -32,6 +38,16 @@ abstract class AbstractService return $this->client; } + /** + * Gets the client used by this service to send requests. + * + * @return \Stripe\StripeStreamingClientInterface + */ + public function getStreamingClient() + { + return $this->streamingClient; + } + /** * Translate null values to empty strings. For service methods, * we interpret null as a request to unset the field, which @@ -59,11 +75,21 @@ abstract class AbstractService return $this->getClient()->request($method, $path, static::formatParams($params), $opts); } + protected function requestStream($method, $path, $readBodyChunkCallable, $params, $opts) + { + return $this->getStreamingClient()->requestStream($method, $path, $readBodyChunkCallable, static::formatParams($params), $opts); + } + protected function requestCollection($method, $path, $params, $opts) { return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); } + protected function requestSearchResult($method, $path, $params, $opts) + { + return $this->getClient()->requestSearchResult($method, $path, static::formatParams($params), $opts); + } + protected function buildPath($basePath, ...$ids) { foreach ($ids as $id) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/AbstractServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/AbstractServiceFactory.php index 4aca6868693..9c04244f757 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/AbstractServiceFactory.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/AbstractServiceFactory.php @@ -42,6 +42,16 @@ abstract class AbstractServiceFactory * @return null|AbstractService|AbstractServiceFactory */ public function __get($name) + { + return $this->getService($name); + } + + /** + * @param string $name + * + * @return null|AbstractService|AbstractServiceFactory + */ + public function getService($name) { $serviceClass = $this->getServiceClass($name); if (null !== $serviceClass) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/AccountService.php b/htdocs/includes/stripe/stripe-php/lib/Service/AccountService.php index c731e475e01..aad2272688f 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/AccountService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/AccountService.php @@ -15,7 +15,7 @@ class AccountService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Account> */ public function all($params = null, $opts = null) { @@ -33,7 +33,7 @@ class AccountService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Capability> */ public function allCapabilities($parentId, $params = null, $opts = null) { @@ -49,7 +49,7 @@ class AccountService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card> */ public function allExternalAccounts($parentId, $params = null, $opts = null) { @@ -67,7 +67,7 @@ class AccountService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Person> */ public function allPersons($parentId, $params = null, $opts = null) { @@ -80,6 +80,12 @@ class AccountService extends \Stripe\Service\AbstractService * href="https://dashboard.stripe.com/account/applications/settings">register your * platform. * + * If you’ve already collected information for your connected accounts, you can pre-fill that information + * when creating the account. Connect Onboarding won’t ask for the pre-filled + * information during account onboarding. You can pre-fill any information on the + * account. + * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * @@ -146,11 +152,12 @@ class AccountService extends \Stripe\Service\AbstractService } /** - * With Connect, you can delete Custom or Express - * accounts you manage. + * With Connect, you can delete accounts you manage. * - * Accounts created using test-mode keys can be deleted at any time. Accounts - * created using live-mode keys can only be deleted once all balances are zero. + * Accounts created using test-mode keys can be deleted at any time. Standard + * accounts created using live-mode keys cannot be deleted. Custom or Express + * accounts created using live-mode keys can only be deleted once all balances are + * zero. * * If you want to delete your own account, use the account information tab in your @@ -278,11 +285,15 @@ class AccountService extends \Stripe\Service\AbstractService } /** - * Updates a connected Express or Custom - * account by setting the values of the parameters passed. Any parameters not - * provided are left unchanged. Most parameters can be changed only for Custom - * accounts. (These are marked Custom Only below.) Parameters - * marked Custom and Express are supported by both account types. + * Updates a connected account by setting the + * values of the parameters passed. Any parameters not provided are left unchanged. + * + * For Custom accounts, you can update any information on the account. For other + * accounts, you can update all information until that account has started to go + * through Connect Onboarding. Once you create an Account Link for a Standard or Express + * account, some parameters can no longer be changed. These are marked as + * Custom Only or Custom and Express below. * * To update your own account, use the Dashboard. Refer to our Custom - * account, and optionally sets it as the default for its currency. Other bank - * account details are not editable by design. + * Updates the metadata, account holder name, account holder type of a bank account + * belonging to a Custom account, and + * optionally sets it as the default for its currency. Other bank account details + * are not editable by design. * * You can re-enable a disabled bank account by performing an update call without * providing any arguments or changes. diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ApplePayDomainService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ApplePayDomainService.php index 6577b6b62a5..3a076f472bf 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ApplePayDomainService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ApplePayDomainService.php @@ -14,7 +14,7 @@ class ApplePayDomainService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\ApplePayDomain> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ApplicationFeeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ApplicationFeeService.php index c05c3cd5977..138c3794e59 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ApplicationFeeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ApplicationFeeService.php @@ -15,7 +15,7 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\ApplicationFee> */ public function all($params = null, $opts = null) { @@ -35,7 +35,7 @@ class ApplicationFeeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\ApplicationFeeRefund> */ public function allRefunds($parentId, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Apps/AppsServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/Apps/AppsServiceFactory.php new file mode 100644 index 00000000000..39f37345dc3 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Apps/AppsServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'secrets' => SecretService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Apps/SecretService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Apps/SecretService.php new file mode 100644 index 00000000000..8c9c74b4877 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Apps/SecretService.php @@ -0,0 +1,68 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/apps/secrets', $params, $opts); + } + + /** + * Create or replace a secret in the secret store. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Apps\Secret + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/apps/secrets', $params, $opts); + } + + /** + * Deletes a secret from the secret store by name and scope. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Apps\Secret + */ + public function deleteWhere($params = null, $opts = null) + { + return $this->request('post', '/v1/apps/secrets/delete', $params, $opts); + } + + /** + * Finds a secret in the secret store by name and scope. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Apps\Secret + */ + public function find($params = null, $opts = null) + { + return $this->request('get', '/v1/apps/secrets/find', $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/BalanceTransactionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/BalanceTransactionService.php index fb1da501823..9e6d37c0421 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/BalanceTransactionService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/BalanceTransactionService.php @@ -19,7 +19,7 @@ class BalanceTransactionService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\BalanceTransaction> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php index 756ae176903..23a4d30b2bb 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/BillingPortalServiceFactory.php @@ -7,6 +7,7 @@ namespace Stripe\Service\BillingPortal; /** * Service factory class for API resources in the BillingPortal namespace. * + * @property ConfigurationService $configurations * @property SessionService $sessions */ class BillingPortalServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -15,6 +16,7 @@ class BillingPortalServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'configurations' => ConfigurationService::class, 'sessions' => SessionService::class, ]; diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php b/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php new file mode 100644 index 00000000000..11d1a5a3a9e --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/BillingPortal/ConfigurationService.php @@ -0,0 +1,73 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Creates a configuration that describes the functionality and behavior of a + * PortalSession. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Retrieves a configuration that describes the functionality of the customer + * portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } + + /** + * Updates a configuration that describes the functionality of the customer portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ChargeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ChargeService.php index f5321b8ac9d..0bde02792db 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ChargeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ChargeService.php @@ -15,7 +15,7 @@ class ChargeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Charge> */ public function all($params = null, $opts = null) { @@ -27,9 +27,10 @@ class ChargeService extends \Stripe\Service\AbstractService * of the two-step payment flow, where first you created a * charge with the capture option set to false. * - * Uncaptured payments expire exactly seven days after they are created. If they - * are not captured by that point in time, they will be marked as refunded and will - * no longer be capturable. + * Uncaptured payments expire a set number of days after they are created (7 by default). If they are not captured + * by that point in time, they will be marked as refunded and will no longer be + * capturable. * * @param string $id * @param null|array $params @@ -82,6 +83,26 @@ class ChargeService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); } + /** + * Search for charges you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Charge> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/charges/search', $params, $opts); + } + /** * Updates the specified charge by setting the values of the parameters passed. Any * parameters not provided will be left unchanged. diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Checkout/SessionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Checkout/SessionService.php index 9da37887844..2291ccd5032 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Checkout/SessionService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Checkout/SessionService.php @@ -14,7 +14,7 @@ class SessionService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Checkout\Session> */ public function all($params = null, $opts = null) { @@ -27,17 +27,17 @@ class SessionService extends \Stripe\Service\AbstractService * items. There is also a URL where you can retrieve the full (paginated) list of * line items. * - * @param string $parentId + * @param string $id * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\LineItem> */ - public function allLineItems($parentId, $params = null, $opts = null) + public function allLineItems($id, $params = null, $opts = null) { - return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); + return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $id), $params, $opts); } /** @@ -55,6 +55,25 @@ class SessionService extends \Stripe\Service\AbstractService return $this->request('post', '/v1/checkout/sessions', $params, $opts); } + /** + * A Session can be expired when it is in one of these statuses: open. + * + * After it expires, a customer can’t complete a Session and customers loading the + * Session see a message saying the Session is expired. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/checkout/sessions/%s/expire', $id), $params, $opts); + } + /** * Retrieves a Session object. * diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/CoreServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/CoreServiceFactory.php index e0109591d3d..351f6913e87 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/CoreServiceFactory.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/CoreServiceFactory.php @@ -11,6 +11,7 @@ namespace Stripe\Service; * @property AccountService $accounts * @property ApplePayDomainService $applePayDomains * @property ApplicationFeeService $applicationFees + * @property Apps\AppsServiceFactory $apps * @property BalanceService $balance * @property BalanceTransactionService $balanceTransactions * @property BillingPortal\BillingPortalServiceFactory $billingPortal @@ -26,37 +27,42 @@ namespace Stripe\Service; * @property ExchangeRateService $exchangeRates * @property FileLinkService $fileLinks * @property FileService $files + * @property FinancialConnections\FinancialConnectionsServiceFactory $financialConnections + * @property Identity\IdentityServiceFactory $identity * @property InvoiceItemService $invoiceItems * @property InvoiceService $invoices * @property Issuing\IssuingServiceFactory $issuing * @property MandateService $mandates * @property OAuthService $oauth - * @property OrderReturnService $orderReturns - * @property OrderService $orders * @property PaymentIntentService $paymentIntents + * @property PaymentLinkService $paymentLinks * @property PaymentMethodService $paymentMethods * @property PayoutService $payouts * @property PlanService $plans * @property PriceService $prices * @property ProductService $products * @property PromotionCodeService $promotionCodes + * @property QuoteService $quotes * @property Radar\RadarServiceFactory $radar * @property RefundService $refunds * @property Reporting\ReportingServiceFactory $reporting * @property ReviewService $reviews * @property SetupAttemptService $setupAttempts * @property SetupIntentService $setupIntents + * @property ShippingRateService $shippingRates * @property Sigma\SigmaServiceFactory $sigma - * @property SkuService $skus * @property SourceService $sources * @property SubscriptionItemService $subscriptionItems * @property SubscriptionService $subscriptions * @property SubscriptionScheduleService $subscriptionSchedules + * @property TaxCodeService $taxCodes * @property TaxRateService $taxRates * @property Terminal\TerminalServiceFactory $terminal + * @property TestHelpers\TestHelpersServiceFactory $testHelpers * @property TokenService $tokens * @property TopupService $topups * @property TransferService $transfers + * @property Treasury\TreasuryServiceFactory $treasury * @property WebhookEndpointService $webhookEndpoints */ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory @@ -69,6 +75,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'accounts' => AccountService::class, 'applePayDomains' => ApplePayDomainService::class, 'applicationFees' => ApplicationFeeService::class, + 'apps' => Apps\AppsServiceFactory::class, 'balance' => BalanceService::class, 'balanceTransactions' => BalanceTransactionService::class, 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, @@ -84,37 +91,42 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory 'exchangeRates' => ExchangeRateService::class, 'fileLinks' => FileLinkService::class, 'files' => FileService::class, + 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, + 'identity' => Identity\IdentityServiceFactory::class, 'invoiceItems' => InvoiceItemService::class, 'invoices' => InvoiceService::class, 'issuing' => Issuing\IssuingServiceFactory::class, 'mandates' => MandateService::class, 'oauth' => OAuthService::class, - 'orderReturns' => OrderReturnService::class, - 'orders' => OrderService::class, 'paymentIntents' => PaymentIntentService::class, + 'paymentLinks' => PaymentLinkService::class, 'paymentMethods' => PaymentMethodService::class, 'payouts' => PayoutService::class, 'plans' => PlanService::class, 'prices' => PriceService::class, 'products' => ProductService::class, 'promotionCodes' => PromotionCodeService::class, + 'quotes' => QuoteService::class, 'radar' => Radar\RadarServiceFactory::class, 'refunds' => RefundService::class, 'reporting' => Reporting\ReportingServiceFactory::class, 'reviews' => ReviewService::class, 'setupAttempts' => SetupAttemptService::class, 'setupIntents' => SetupIntentService::class, + 'shippingRates' => ShippingRateService::class, 'sigma' => Sigma\SigmaServiceFactory::class, - 'skus' => SkuService::class, 'sources' => SourceService::class, 'subscriptionItems' => SubscriptionItemService::class, 'subscriptions' => SubscriptionService::class, 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'taxCodes' => TaxCodeService::class, 'taxRates' => TaxRateService::class, 'terminal' => Terminal\TerminalServiceFactory::class, + 'testHelpers' => TestHelpers\TestHelpersServiceFactory::class, 'tokens' => TokenService::class, 'topups' => TopupService::class, 'transfers' => TransferService::class, + 'treasury' => Treasury\TreasuryServiceFactory::class, 'webhookEndpoints' => WebhookEndpointService::class, ]; diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/CountrySpecService.php b/htdocs/includes/stripe/stripe-php/lib/Service/CountrySpecService.php index 573444fd3f4..8f3869fee85 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/CountrySpecService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/CountrySpecService.php @@ -14,7 +14,7 @@ class CountrySpecService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\CountrySpec> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/CouponService.php b/htdocs/includes/stripe/stripe-php/lib/Service/CouponService.php index 82a880f5361..89eb2c7d111 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/CouponService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/CouponService.php @@ -14,7 +14,7 @@ class CouponService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Coupon> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/CreditNoteService.php b/htdocs/includes/stripe/stripe-php/lib/Service/CreditNoteService.php index 39807dc11a4..a00f010aa43 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/CreditNoteService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/CreditNoteService.php @@ -14,7 +14,7 @@ class CreditNoteService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\CreditNote> */ public function all($params = null, $opts = null) { @@ -32,7 +32,7 @@ class CreditNoteService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> */ public function allLines($parentId, $params = null, $opts = null) { @@ -98,11 +98,11 @@ class CreditNoteService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\CreditNote + * @return \Stripe\Collection<\Stripe\CreditNoteLineItem> */ public function previewLines($params = null, $opts = null) { - return $this->request('get', '/v1/credit_notes/preview/lines', $params, $opts); + return $this->requestCollection('get', '/v1/credit_notes/preview/lines', $params, $opts); } /** diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/CustomerService.php b/htdocs/includes/stripe/stripe-php/lib/Service/CustomerService.php index fdc6a596062..5cb7910a222 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/CustomerService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/CustomerService.php @@ -15,7 +15,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Customer> */ public function all($params = null, $opts = null) { @@ -32,13 +32,46 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\CustomerBalanceTransaction> */ public function allBalanceTransactions($parentId, $params = null, $opts = null) { return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); } + /** + * Returns a list of transactions that modified the customer’s cash balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\CustomerCashBalanceTransaction> + */ + public function allCashBalanceTransactions($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/cash_balance_transactions', $parentId), $params, $opts); + } + + /** + * Returns a list of PaymentMethods for a given Customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\PaymentMethod> + */ + public function allPaymentMethods($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/payment_methods', $id), $params, $opts); + } + /** * List sources for a specified customer. * @@ -48,7 +81,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\BankAccount|\Stripe\Card|\Stripe\Source> */ public function allSources($parentId, $params = null, $opts = null) { @@ -64,7 +97,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\TaxId> */ public function allTaxIds($parentId, $params = null, $opts = null) { @@ -103,6 +136,26 @@ class CustomerService extends \Stripe\Service\AbstractService return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); } + /** + * Retrieve funding instructions for a customer cash balance. If funding + * instructions do not yet exist for the customer, new funding instructions will be + * created. If funding instructions have already been created for a given customer, + * the same funding instructions will be retrieved. In other words, we will return + * the same funding instructions each time. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function createFundingInstructions($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/funding_instructions', $id), $params, $opts); + } + /** * When you create a new credit card, you must specify a customer or recipient on * which to create it. @@ -118,7 +171,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public function createSource($parentId, $params = null, $opts = null) { @@ -182,7 +235,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public function deleteSource($parentId, $id, $params = null, $opts = null) { @@ -207,8 +260,7 @@ class CustomerService extends \Stripe\Service\AbstractService } /** - * Retrieves the details of an existing customer. You need only supply the unique - * customer identifier that was returned upon customer creation. + * Retrieves a Customer object. * * @param string $id * @param null|array $params @@ -241,6 +293,57 @@ class CustomerService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); } + /** + * Retrieves a customer’s cash balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CashBalance + */ + public function retrieveCashBalance($parentId, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); + } + + /** + * Retrieves a specific cash balance transaction, which updated the customer’s cash balance. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerCashBalanceTransaction + */ + public function retrieveCashBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/cash_balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves a PaymentMethod object for a given Customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function retrievePaymentMethod($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/payment_methods/%s', $parentId, $id), $params, $opts); + } + /** * Retrieve a specified source for a given customer. * @@ -251,7 +354,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public function retrieveSource($parentId, $id, $params = null, $opts = null) { @@ -275,6 +378,26 @@ class CustomerService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); } + /** + * Search for customers you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Customer> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/customers/search', $params, $opts); + } + /** * Updates the specified customer by setting the values of the parameters passed. * Any parameters not provided will be left unchanged. For example, if you pass the @@ -321,6 +444,22 @@ class CustomerService extends \Stripe\Service\AbstractService return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); } + /** + * Changes the settings on a customer’s cash balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CashBalance + */ + public function updateCashBalance($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/cash_balance', $parentId), $params, $opts); + } + /** * @param string $parentId * @param string $id @@ -329,7 +468,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public function updateSource($parentId, $id, $params = null, $opts = null) { @@ -344,7 +483,7 @@ class CustomerService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + * @return \Stripe\BankAccount|\Stripe\Card|\Stripe\Source */ public function verifySource($parentId, $id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/DisputeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/DisputeService.php index 4eb1542bf44..86d3584a094 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/DisputeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/DisputeService.php @@ -14,7 +14,7 @@ class DisputeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Dispute> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/EventService.php b/htdocs/includes/stripe/stripe-php/lib/Service/EventService.php index 430b35abf7c..9e779dd9ac0 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/EventService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/EventService.php @@ -18,7 +18,7 @@ class EventService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Event> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ExchangeRateService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ExchangeRateService.php index fc78410c78a..fe010b00d04 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ExchangeRateService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ExchangeRateService.php @@ -15,7 +15,7 @@ class ExchangeRateService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\ExchangeRate> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/FileLinkService.php b/htdocs/includes/stripe/stripe-php/lib/Service/FileLinkService.php index 7a3a435dd26..06929a9c60d 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/FileLinkService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/FileLinkService.php @@ -14,7 +14,7 @@ class FileLinkService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\FileLink> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/FileService.php b/htdocs/includes/stripe/stripe-php/lib/Service/FileService.php index 1484288496d..82ef0e5004a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/FileService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/FileService.php @@ -16,7 +16,7 @@ class FileService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\File> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php new file mode 100644 index 00000000000..213d1727136 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/AccountService.php @@ -0,0 +1,89 @@ +Account objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\FinancialConnections\Account> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/financial_connections/accounts', $params, $opts); + } + + /** + * Lists all owners for a given Account. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> + */ + public function allOwners($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/financial_connections/accounts/%s/owners', $id), $params, $opts); + } + + /** + * Disables your access to a Financial Connections Account. You will + * no longer be able to access data associated with the account (e.g. balances, + * transactions). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function disconnect($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/disconnect', $id), $params, $opts); + } + + /** + * Refreshes the data associated with a Financial Connections Account. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function refresh($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/financial_connections/accounts/%s/refresh', $id), $params, $opts); + } + + /** + * Retrieves the details of an Financial Connections Account. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Account + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/financial_connections/accounts/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php new file mode 100644 index 00000000000..7dd826341eb --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'accounts' => AccountService::class, + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php new file mode 100644 index 00000000000..eab589cdad5 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/FinancialConnections/SessionService.php @@ -0,0 +1,41 @@ +Session. The session’s client_secret can be used to + * launch the flow using Stripe.js. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Session + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/financial_connections/sessions', $params, $opts); + } + + /** + * Retrieves the details of a Financial Connections Session. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FinancialConnections\Session + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/financial_connections/sessions/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php new file mode 100644 index 00000000000..cf6314628a6 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php new file mode 100644 index 00000000000..9289d9dfd99 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php @@ -0,0 +1,39 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/identity/verification_reports', $params, $opts); + } + + /** + * Retrieves an existing VerificationReport. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationReport + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php new file mode 100644 index 00000000000..24bb4e06399 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php @@ -0,0 +1,146 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * A VerificationSession object can be canceled when it is in + * requires_input status. + * + * Once canceled, future submission attempts are disabled. This cannot be undone. + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a VerificationSession object. + * + * After the VerificationSession is created, display a verification modal using the + * session client_secret or send your users to the session’s + * url. + * + * If your API key is in test mode, verification checks won’t actually process, + * though everything else will occur as if in live mode. + * + * Related guide: Verify your + * users’ identity documents. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * Redact a VerificationSession to remove all collected information from Stripe. + * This will redact the VerificationSession and all objects related to it, + * including VerificationReports, Events, request logs, etc. + * + * A VerificationSession object can be redacted when it is in + * requires_input or verified status. Redacting a + * VerificationSession in requires_action state will automatically + * cancel it. + * + * The redaction process may take up to four days. When the redaction process is in + * progress, the VerificationSession’s redaction.status field will be + * set to processing; when the process is finished, it will change to + * redacted and an identity.verification_session.redacted + * event will be emitted. + * + * Redaction is irreversible. Redacted objects are still accessible in the Stripe + * API, but all the fields that contain personal data will be replaced by the + * string [redacted] or a similar placeholder. The + * metadata field will also be erased. Redacted objects cannot be + * updated or used for any purpose. + * + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function redact($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + * When the session status is requires_input, you can use this method + * to retrieve a valid client_secret or url to allow + * re-submission. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } + + /** + * Updates a VerificationSession object. + * + * When the session status is requires_input, you can use this method + * to update the verification check and options. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceItemService.php b/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceItemService.php index 0f0b9e91f08..45e207218fe 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceItemService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceItemService.php @@ -15,7 +15,7 @@ class InvoiceItemService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\InvoiceItem> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceService.php b/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceService.php index f647b28f6cb..cc61a320a92 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/InvoiceService.php @@ -16,7 +16,7 @@ class InvoiceService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Invoice> */ public function all($params = null, $opts = null) { @@ -35,7 +35,7 @@ class InvoiceService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\InvoiceLineItem> */ public function allLines($parentId, $params = null, $opts = null) { @@ -43,12 +43,10 @@ class InvoiceService extends \Stripe\Service\AbstractService } /** - * This endpoint creates a draft invoice for a given customer. The draft invoice - * created pulls in all pending invoice items on that customer, including - * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to - * your customers. + * This endpoint creates a draft invoice for a given customer. The invoice remains + * a draft until you finalize the invoice, which + * allows you to pay or send + * the invoice to your customers. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts @@ -152,6 +150,26 @@ class InvoiceService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); } + /** + * Search for invoices you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Invoice> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/invoices/search', $params, $opts); + } + /** * Stripe will automatically send invoices to customers according to your subscriptions @@ -221,11 +239,11 @@ class InvoiceService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Invoice + * @return \Stripe\Collection<\Stripe\InvoiceLineItem> */ public function upcomingLines($params = null, $opts = null) { - return $this->request('get', '/v1/invoices/upcoming/lines', $params, $opts); + return $this->requestCollection('get', '/v1/invoices/upcoming/lines', $params, $opts); } /** diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php index 6fff70e7e92..d36f48ed928 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/AuthorizationService.php @@ -16,7 +16,7 @@ class AuthorizationService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Issuing\Authorization> */ public function all($params = null, $opts = null) { @@ -27,7 +27,9 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Approves a pending Issuing Authorization object. This request * should be made within the timeout window of the real-time - * authorization flow. + * authorization flow. You can also respond directly to the webhook request to + * approve an authorization (preferred). More details can be found here. * * @param string $id * @param null|array $params @@ -46,7 +48,9 @@ class AuthorizationService extends \Stripe\Service\AbstractService * Declines a pending Issuing Authorization object. This request * should be made within the timeout window of the real time - * authorization flow. + * authorization flow. You can also respond directly to the webhook request to + * decline an authorization (preferred). More details can be found here. * * @param string $id * @param null|array $params diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardService.php index 346d54afae3..22b7e5412fe 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardService.php @@ -16,7 +16,7 @@ class CardService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Issuing\Card> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardholderService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardholderService.php index 5731b1bf14c..65e675b36a0 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardholderService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/CardholderService.php @@ -16,7 +16,7 @@ class CardholderService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Issuing\Cardholder> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/DisputeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/DisputeService.php index ab5df5f3e79..45c25288802 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/DisputeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/DisputeService.php @@ -16,7 +16,7 @@ class DisputeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Issuing\Dispute> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/TransactionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/TransactionService.php index 8fb0ee2ac64..dd83b182034 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/TransactionService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Issuing/TransactionService.php @@ -16,7 +16,7 @@ class TransactionService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Issuing\Transaction> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/OrderReturnService.php b/htdocs/includes/stripe/stripe-php/lib/Service/OrderReturnService.php deleted file mode 100644 index 6183166c52e..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Service/OrderReturnService.php +++ /dev/null @@ -1,42 +0,0 @@ -requestCollection('get', '/v1/order_returns', $params, $opts); - } - - /** - * Retrieves the details of an existing order return. Supply the unique order ID - * from either an order return creation request or the order return list, and - * Stripe will return the corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\OrderReturn - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/OrderService.php b/htdocs/includes/stripe/stripe-php/lib/Service/OrderService.php deleted file mode 100644 index fa658fa7ba5..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/Service/OrderService.php +++ /dev/null @@ -1,109 +0,0 @@ -requestCollection('get', '/v1/orders', $params, $opts); - } - - /** - * Creates a new order object. - * - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function create($params = null, $opts = null) - { - return $this->request('post', '/v1/orders', $params, $opts); - } - - /** - * Pay an order by providing a source to create a payment. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function pay($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); - } - - /** - * Retrieves the details of an existing order. Supply the unique order ID from - * either an order creation request or the order list, and Stripe will return the - * corresponding order information. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function retrieve($id, $params = null, $opts = null) - { - return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } - - /** - * Return all or part of an order. The order must have a status of - * paid or fulfilled before it can be returned. Once all - * items have been returned, the order will become canceled or - * returned depending on which status the order started in. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function returnOrder($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); - } - - /** - * Updates the specific order by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Order - */ - public function update($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PaymentIntentService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentIntentService.php index 43aba46d858..f3f81d5cfce 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PaymentIntentService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentIntentService.php @@ -14,23 +14,44 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\PaymentIntent> */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/payment_intents', $params, $opts); } + /** + * Manually reconcile the remaining amount for a customer_balance PaymentIntent. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function applyCustomerBalance($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/apply_customer_balance', $id), $params, $opts); + } + /** * A PaymentIntent object can be canceled when it is in one of these statuses: * requires_payment_method, requires_capture, - * requires_confirmation, or requires_action. + * requires_confirmation, requires_action or, in rare cases, processing. * * Once canceled, no additional charges will be made by the PaymentIntent and any * operations on the PaymentIntent will fail with an error. For PaymentIntents with * status=’requires_capture’, the remaining * amount_capturable will automatically be refunded. * + * You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session + * instead. + * * @param string $id * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts @@ -48,8 +69,8 @@ class PaymentIntentService extends \Stripe\Service\AbstractService * Capture the funds of an existing uncaptured PaymentIntent when its status is * requires_capture. * - * Uncaptured PaymentIntents will be canceled exactly seven days after they are - * created. + * Uncaptured PaymentIntents will be canceled a set number of days after they are + * created (7 by default). * * Learn more about separate authorization * and capture. @@ -70,29 +91,25 @@ class PaymentIntentService extends \Stripe\Service\AbstractService /** * Confirm that your customer intends to pay with current or provided payment * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - * * If the selected payment method requires additional authentication steps, the * PaymentIntent will transition to the requires_action status and * suggest additional actions via next_action. If payment fails, the * PaymentIntent will transition to the requires_payment_method * status. If payment succeeds, the PaymentIntent will transition to the * succeeded status (or requires_capture, if - * capture_method is set to manual). - * - * If the confirmation_method is automatic, payment may - * be attempted using our capture_method is set to manual). If the + * confirmation_method is automatic, payment may be + * attempted using our client SDKs and * the PaymentIntent’s client_secret. After * next_actions are handled by the client, no additional confirmation - * is required to complete the payment. - * - * If the confirmation_method is manual, all payment - * attempts must be initiated using a secret key. If any actions are required for - * the payment, the PaymentIntent will return to the - * requires_confirmation state after those actions are completed. Your - * server needs to then explicitly re-confirm the PaymentIntent to initiate the - * next payment attempt. Read the confirmation_method is + * manual, all payment attempts must be initiated using a secret key. + * If any actions are required for the payment, the PaymentIntent will return to + * the requires_confirmation state after those actions are completed. + * Your server needs to then explicitly re-confirm the PaymentIntent to initiate + * the next payment attempt. Read the expanded documentation to * learn more about manual confirmation. * @@ -134,6 +151,47 @@ class PaymentIntentService extends \Stripe\Service\AbstractService return $this->request('post', '/v1/payment_intents', $params, $opts); } + /** + * Perform an incremental authorization on an eligible PaymentIntent. To be eligible, the + * PaymentIntent’s status must be requires_capture and incremental_authorization_supported + * must be true. + * + * Incremental authorizations attempt to increase the authorized amount on your + * customer’s card to the new, higher amount provided. As with the + * initial authorization, incremental authorizations may be declined. A single + * PaymentIntent can call this endpoint multiple times to further increase the + * authorized amount. + * + * If the incremental authorization succeeds, the PaymentIntent object is returned + * with the updated amount. + * If the incremental authorization fails, a card_declined error is returned, and + * no fields on the PaymentIntent or Charge are updated. The PaymentIntent object + * remains capturable for the previously authorized amount. + * + * Each PaymentIntent can have a maximum of 10 incremental authorization attempts, + * including declines. Once captured, a PaymentIntent can no longer be incremented. + * + * Learn more about incremental + * authorizations. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function incrementAuthorization($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/increment_authorization', $id), $params, $opts); + } + /** * Retrieves the details of a PaymentIntent that has previously been created. * @@ -157,6 +215,26 @@ class PaymentIntentService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); } + /** + * Search for PaymentIntents you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\PaymentIntent> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/payment_intents/search', $params, $opts); + } + /** * Updates properties on a PaymentIntent object without confirming. * @@ -178,4 +256,20 @@ class PaymentIntentService extends \Stripe\Service\AbstractService { return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); } + + /** + * Verifies microdeposits on a PaymentIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function verifyMicrodeposits($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/verify_microdeposits', $id), $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PaymentLinkService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentLinkService.php new file mode 100644 index 00000000000..e5008d7a8e5 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentLinkService.php @@ -0,0 +1,89 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/payment_links', $params, $opts); + } + + /** + * When retrieving a payment link, there is an includable + * line_items property containing the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> + */ + public function allLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/payment_links/%s/line_items', $id), $params, $opts); + } + + /** + * Creates a payment link. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_links', $params, $opts); + } + + /** + * Retrieve a payment link. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); + } + + /** + * Updates a payment link. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentLink + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PaymentMethodService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentMethodService.php index 7111b9ebc46..70944daa9ed 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PaymentMethodService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PaymentMethodService.php @@ -7,14 +7,17 @@ namespace Stripe\Service; class PaymentMethodService extends \Stripe\Service\AbstractService { /** - * Returns a list of PaymentMethods for a given Customer. + * Returns a list of PaymentMethods for Treasury flows. If you want to list the + * PaymentMethods attached to a Customer for payments, you should use the List a Customer’s + * PaymentMethods API instead. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\PaymentMethod> */ public function all($params = null, $opts = null) { @@ -28,10 +31,11 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * you use a SetupIntent or a PaymentIntent * with setup_future_usage. - * These approaches will perform any necessary steps to ensure that the - * PaymentMethod can be used in a future payment. Using the - * /v1/payment_methods/:id/attach endpoint does not ensure that future - * payments can be made with the attached PaymentMethod. See /v1/payment_methods/:id/attach + * endpoint without first using a SetupIntent or PaymentIntent with + * setup_future_usage does not optimize the PaymentMethod for future + * use, which makes later declines and payment friction more likely. See Optimizing cards for future * payments for more information about setting up future payments. * @@ -58,6 +62,12 @@ class PaymentMethodService extends \Stripe\Service\AbstractService * href="/docs/stripe-js/reference#stripe-create-payment-method">Stripe.js * reference to learn how to create PaymentMethods via Stripe.js. * + * Instead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a + * payment immediately or the SetupIntent API to collect payment + * method details ahead of a future payment. + * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * @@ -71,7 +81,8 @@ class PaymentMethodService extends \Stripe\Service\AbstractService } /** - * Detaches a PaymentMethod object from a Customer. + * Detaches a PaymentMethod object from a Customer. After a PaymentMethod is + * detached, it can no longer be used for a payment or re-attached to a Customer. * * @param string $id * @param null|array $params @@ -87,7 +98,10 @@ class PaymentMethodService extends \Stripe\Service\AbstractService } /** - * Retrieves a PaymentMethod object. + * Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a + * payment method attached to a Customer, you should use Retrieve a Customer’s + * PaymentMethods. * * @param string $id * @param null|array $params diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PayoutService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PayoutService.php index 547e22da6ab..4ca3561c881 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PayoutService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PayoutService.php @@ -16,7 +16,7 @@ class PayoutService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Payout> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PlanService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PlanService.php index 16625d27a9a..6c0a8d47ae8 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PlanService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PlanService.php @@ -14,7 +14,7 @@ class PlanService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Plan> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PriceService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PriceService.php index cc44f69c941..ef2b938d452 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PriceService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PriceService.php @@ -14,7 +14,7 @@ class PriceService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Price> */ public function all($params = null, $opts = null) { @@ -53,6 +53,26 @@ class PriceService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); } + /** + * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Price> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/prices/search', $params, $opts); + } + /** * Updates the specified price by setting the values of the parameters passed. Any * parameters not provided are left unchanged. diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ProductService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ProductService.php index 850cea56f74..5eb6d82cec0 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ProductService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ProductService.php @@ -15,7 +15,7 @@ class ProductService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Product> */ public function all($params = null, $opts = null) { @@ -73,6 +73,26 @@ class ProductService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); } + /** + * Search for products you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Product> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/products/search', $params, $opts); + } + /** * Updates the specific product by setting the values of the parameters passed. Any * parameters not provided will be left unchanged. diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/PromotionCodeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/PromotionCodeService.php index 1de5696da4f..17461b4bf26 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/PromotionCodeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/PromotionCodeService.php @@ -14,7 +14,7 @@ class PromotionCodeService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\PromotionCode> */ public function all($params = null, $opts = null) { @@ -38,7 +38,10 @@ class PromotionCodeService extends \Stripe\Service\AbstractService } /** - * Retrieves the promotion code with the given ID. + * Retrieves the promotion code with the given ID. In order to retrieve a promotion + * code by the customer-facing code use list with the desired + * code. * * @param string $id * @param null|array $params diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/QuoteService.php b/htdocs/includes/stripe/stripe-php/lib/Service/QuoteService.php new file mode 100644 index 00000000000..05f0dfb6673 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/QuoteService.php @@ -0,0 +1,177 @@ +request('post', $this->buildPath('/v1/quotes/%s/accept', $id), $params, $opts); + } + + /** + * Returns a list of your quotes. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\Quote> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/quotes', $params, $opts); + } + + /** + * When retrieving a quote, there is an includable computed.upfront.line_items + * property containing the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of upfront line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> + */ + public function allComputedUpfrontLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/computed_upfront_line_items', $id), $params, $opts); + } + + /** + * When retrieving a quote, there is an includable line_items + * property containing the first handful of those items. There is also a URL where + * you can retrieve the full (paginated) list of line items. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\LineItem> + */ + public function allLineItems($id, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts); + } + + /** + * Cancels the quote. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts); + } + + /** + * A quote models prices and services for a customer. Default options for + * header, description, footer, and + * expires_at can be set in the dashboard via the quote template. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/quotes', $params, $opts); + } + + /** + * Finalizes the quote. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function finalizeQuote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); + } + + /** + * Retrieves the quote with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); + } + + /** + * A quote models prices and services for a customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Quote + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts); + } + + /** + * Download the PDF for a finalized quote. + * + * @param string $id + * @param callable $readBodyChunkCallable + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + */ + public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = $this->getClient()->getFilesBase(); + } + $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php index 7b097348389..be119b4c857 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/EarlyFraudWarningService.php @@ -14,7 +14,7 @@ class EarlyFraudWarningService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Radar\EarlyFraudWarning> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php index 89eba2a7a88..b9da3dd8bfe 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListItemService.php @@ -16,7 +16,7 @@ class ValueListItemService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Radar\ValueListItem> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListService.php index 64ac2ee790c..70d9b486399 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Radar/ValueListService.php @@ -16,7 +16,7 @@ class ValueListService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Radar\ValueList> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/RefundService.php b/htdocs/includes/stripe/stripe-php/lib/Service/RefundService.php index 49b4267e40a..772c0f6e3e1 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/RefundService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/RefundService.php @@ -17,13 +17,32 @@ class RefundService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Refund> */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/refunds', $params, $opts); } + /** + * Cancels a refund with a status of requires_action. + * + * Refunds in other states cannot be canceled, and only refunds for payment methods + * that require customer action will enter the requires_action state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts); + } + /** * Create a refund. * diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php index 46e2139a2bb..b62898fdb2c 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportRunService.php @@ -7,15 +7,14 @@ namespace Stripe\Service\Reporting; class ReportRunService extends \Stripe\Service\AbstractService { /** - * Returns a list of Report Runs, with the most recent appearing first. (Requires a - * live-mode API key.). + * Returns a list of Report Runs, with the most recent appearing first. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Reporting\ReportRun> */ public function all($params = null, $opts = null) { @@ -23,8 +22,8 @@ class ReportRunService extends \Stripe\Service\AbstractService } /** - * Creates a new object and begin running the report. (Requires a live-mode API key.). + * Creates a new object and begin running the report. (Certain report types require + * a live-mode API key.). * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts @@ -39,8 +38,7 @@ class ReportRunService extends \Stripe\Service\AbstractService } /** - * Retrieves the details of an existing Report Run. (Requires a live-mode API key.). + * Retrieves the details of an existing Report Run. * * @param string $id * @param null|array $params diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php index 46f6bf83e1f..7fa503821ad 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Reporting/ReportTypeService.php @@ -7,15 +7,14 @@ namespace Stripe\Service\Reporting; class ReportTypeService extends \Stripe\Service\AbstractService { /** - * Returns a full list of Report Types. (Requires a live-mode API key.). + * Returns a full list of Report Types. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Reporting\ReportType> */ public function all($params = null, $opts = null) { @@ -23,7 +22,7 @@ class ReportTypeService extends \Stripe\Service\AbstractService } /** - * Retrieves the details of a Report Type. (Requires a live-mode API key.). * * @param string $id diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ReviewService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ReviewService.php index ea152f23e82..3bcd325b6c9 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/ReviewService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ReviewService.php @@ -16,7 +16,7 @@ class ReviewService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Review> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SetupAttemptService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SetupAttemptService.php index 7376ea13e72..8657441ec5b 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SetupAttemptService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SetupAttemptService.php @@ -14,7 +14,7 @@ class SetupAttemptService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\SetupAttempt> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SetupIntentService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SetupIntentService.php index 3cbec506f69..3dea24cbc84 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SetupIntentService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SetupIntentService.php @@ -14,7 +14,7 @@ class SetupIntentService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\SetupIntent> */ public function all($params = null, $opts = null) { @@ -124,4 +124,20 @@ class SetupIntentService extends \Stripe\Service\AbstractService { return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); } + + /** + * Verifies microdeposits on a SetupIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function verifyMicrodeposits($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/verify_microdeposits', $id), $params, $opts); + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/ShippingRateService.php b/htdocs/includes/stripe/stripe-php/lib/Service/ShippingRateService.php new file mode 100644 index 00000000000..d141e484ea1 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/ShippingRateService.php @@ -0,0 +1,70 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/shipping_rates', $params, $opts); + } + + /** + * Creates a new shipping rate object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/shipping_rates', $params, $opts); + } + + /** + * Returns the shipping rate object with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); + } + + /** + * Updates an existing shipping rate object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ShippingRate + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php index 92641751bc7..0fa8cd9ca1d 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Sigma/ScheduledQueryRunService.php @@ -14,7 +14,7 @@ class ScheduledQueryRunService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Sigma\ScheduledQueryRun> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SourceService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SourceService.php index c6cc0596467..b55717883c6 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SourceService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SourceService.php @@ -7,17 +7,19 @@ namespace Stripe\Service; class SourceService extends \Stripe\Service\AbstractService { /** + * List source transactions for a given source. + * * @param string $id * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Source + * @return \Stripe\Collection<\Stripe\SourceTransaction> */ - public function allTransactions($id, $params = null, $opts = null) + public function allSourceTransactions($id, $params = null, $opts = null) { - return $this->request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); + return $this->requestCollection('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); } /** diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionItemService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionItemService.php index 3b2aa2b1268..e18c8de4165 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionItemService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionItemService.php @@ -14,7 +14,7 @@ class SubscriptionItemService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\SubscriptionItem> */ public function all($params = null, $opts = null) { @@ -39,7 +39,7 @@ class SubscriptionItemService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\UsageRecordSummary> */ public function allUsageRecordSummaries($parentId, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php index 9eed460604e..42aaf6bbe4e 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php @@ -14,7 +14,7 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\SubscriptionSchedule> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionService.php index f3ac768c891..dcbc8e64896 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/SubscriptionService.php @@ -15,7 +15,7 @@ class SubscriptionService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Subscription> */ public function all($params = null, $opts = null) { @@ -58,6 +58,17 @@ class SubscriptionService extends \Stripe\Service\AbstractService * Creates a new subscription on an existing customer. Each customer can have up to * 500 active or scheduled subscriptions. * + * When you create a subscription with + * collection_method=charge_automatically, the first invoice is + * finalized as part of the request. The payment_behavior parameter + * determines the exact behavior of the initial payment. + * + * To start subscriptions where the first invoice always begins in a + * draft status, use subscription + * schedules instead. Schedules provide the flexibility to model more complex + * billing configurations that change over time. + * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * @@ -86,6 +97,27 @@ class SubscriptionService extends \Stripe\Service\AbstractService return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); } + /** + * Initiates resumption of a paused subscription, optionally resetting the billing + * cycle anchor and creating prorations. If a resumption invoice is generated, it + * must be paid or marked uncollectible before the subscription will be unpaused. + * If payment succeeds the subscription will become active, and if + * payment fails the subscription will be past_due. The resumption + * invoice will void automatically if not paid by the expiration date. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function resume($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscriptions/%s/resume', $id), $params, $opts); + } + /** * Retrieves the subscription with the given ID. * @@ -102,6 +134,26 @@ class SubscriptionService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); } + /** + * Search for subscriptions you’ve previously created using Stripe’s Search Query Language. Don’t use + * search in read-after-write flows where strict consistency is necessary. Under + * normal operating conditions, data is searchable in less than a minute. + * Occasionally, propagation of new or updated data can be up to an hour behind + * during outages. Search functionality is not available to merchants in India. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult<\Stripe\Subscription> + */ + public function search($params = null, $opts = null) + { + return $this->requestSearchResult('get', '/v1/subscriptions/search', $params, $opts); + } + /** * Updates an existing subscription on a customer to match the specified * parameters. When changing plans or quantities, we will optionally prorate the diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TaxCodeService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TaxCodeService.php new file mode 100644 index 00000000000..fd167a10134 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TaxCodeService.php @@ -0,0 +1,41 @@ +all tax codes + * available to add to Products in order to allow specific tax calculations. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TaxCode> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/tax_codes', $params, $opts); + } + + /** + * Retrieves the details of an existing tax code. Supply the unique tax code ID and + * Stripe will return the corresponding tax code information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TaxRateService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TaxRateService.php index 7cee1fead7b..0d67eec3377 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/TaxRateService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TaxRateService.php @@ -15,7 +15,7 @@ class TaxRateService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\TaxRate> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/SkuService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php similarity index 50% rename from htdocs/includes/stripe/stripe-php/lib/Service/SkuService.php rename to htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php index 8934f206443..97c7c27584e 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/SkuService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ConfigurationService.php @@ -2,44 +2,42 @@ // File generated from our OpenAPI spec -namespace Stripe\Service; +namespace Stripe\Service\Terminal; -class SkuService extends \Stripe\Service\AbstractService +class ConfigurationService extends \Stripe\Service\AbstractService { /** - * Returns a list of your SKUs. The SKUs are returned sorted by creation date, with - * the most recently created SKUs appearing first. + * Returns a list of Configuration objects. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Terminal\Configuration> */ public function all($params = null, $opts = null) { - return $this->requestCollection('get', '/v1/skus', $params, $opts); + return $this->requestCollection('get', '/v1/terminal/configurations', $params, $opts); } /** - * Creates a new SKU associated with a product. + * Creates a new Configuration object. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\SKU + * @return \Stripe\Terminal\Configuration */ public function create($params = null, $opts = null) { - return $this->request('post', '/v1/skus', $params, $opts); + return $this->request('post', '/v1/terminal/configurations', $params, $opts); } /** - * Delete a SKU. Deleting a SKU is only possible until it has been used in an - * order. + * Deletes a Configuration object. * * @param string $id * @param null|array $params @@ -47,17 +45,15 @@ class SkuService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\SKU + * @return \Stripe\Terminal\Configuration */ public function delete($id, $params = null, $opts = null) { - return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + return $this->request('delete', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); } /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from - * either a SKU creation request or from the product, and Stripe will return the - * corresponding SKU information. + * Retrieves a Configuration object. * * @param string $id * @param null|array $params @@ -65,20 +61,15 @@ class SkuService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\SKU + * @return \Stripe\Terminal\Configuration */ public function retrieve($id, $params = null, $opts = null) { - return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + return $this->request('get', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); } /** - * Updates the specific SKU by setting the values of the parameters passed. Any - * parameters not provided will be left unchanged. - * - * Note that a SKU’s attributes are not editable. Instead, you would - * need to deactivate the existing SKU and create a new one with the new attribute - * values. + * Updates a new Configuration object. * * @param string $id * @param null|array $params @@ -86,10 +77,10 @@ class SkuService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\SKU + * @return \Stripe\Terminal\Configuration */ public function update($id, $params = null, $opts = null) { - return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + return $this->request('post', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts); } } diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/LocationService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/LocationService.php index 8adc7a520db..74a776eb9e5 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/LocationService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/LocationService.php @@ -14,7 +14,7 @@ class LocationService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Terminal\Location> */ public function all($params = null, $opts = null) { @@ -22,7 +22,9 @@ class LocationService extends \Stripe\Service\AbstractService } /** - * Creates a new Location object. + * Creates a new Location object. For further details, including which + * address fields are required in each country, see the Manage locations guide. * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ReaderService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ReaderService.php index 765015c835f..1f40f8c2338 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ReaderService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/ReaderService.php @@ -14,13 +14,29 @@ class ReaderService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Terminal\Reader> */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); } + /** + * Cancels the current reader action. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function cancelAction($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/cancel_action', $id), $params, $opts); + } + /** * Creates a new Reader object. * @@ -52,6 +68,54 @@ class ReaderService extends \Stripe\Service\AbstractService return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); } + /** + * Initiates a payment flow on a Reader. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function processPaymentIntent($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_payment_intent', $id), $params, $opts); + } + + /** + * Initiates a setup intent flow on a Reader. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function processSetupIntent($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_setup_intent', $id), $params, $opts); + } + + /** + * Initiates a refund on a Reader. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function refundPayment($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/refund_payment', $id), $params, $opts); + } + /** * Retrieves a Reader object. * @@ -68,6 +132,22 @@ class ReaderService extends \Stripe\Service\AbstractService return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); } + /** + * Sets reader display to show cart details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function setReaderDisplay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/set_reader_display', $id), $params, $opts); + } + /** * Updates a Reader object by setting the values of the parameters * passed. Any parameters not provided will be left unchanged. diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php index c70ac873bc4..f095124c032 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Terminal/TerminalServiceFactory.php @@ -7,6 +7,7 @@ namespace Stripe\Service\Terminal; /** * Service factory class for API resources in the Terminal namespace. * + * @property ConfigurationService $configurations * @property ConnectionTokenService $connectionTokens * @property LocationService $locations * @property ReaderService $readers @@ -17,6 +18,7 @@ class TerminalServiceFactory extends \Stripe\Service\AbstractServiceFactory * @var array */ private static $classMap = [ + 'configurations' => ConfigurationService::class, 'connectionTokens' => ConnectionTokenService::class, 'locations' => LocationService::class, 'readers' => ReaderService::class, diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/CustomerService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/CustomerService.php new file mode 100644 index 00000000000..c46b5797580 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/CustomerService.php @@ -0,0 +1,24 @@ +request('post', $this->buildPath('/v1/test_helpers/customers/%s/fund_cash_balance', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php new file mode 100644 index 00000000000..01d7080a4ff --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/CardService.php @@ -0,0 +1,76 @@ +Card object to + * delivered. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function deliverCard($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/deliver', $id), $params, $opts); + } + + /** + * Updates the shipping status of the specified Issuing Card object to + * failure. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function failCard($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/fail', $id), $params, $opts); + } + + /** + * Updates the shipping status of the specified Issuing Card object to + * returned. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function returnCard($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/return', $id), $params, $opts); + } + + /** + * Updates the shipping status of the specified Issuing Card object to + * shipped. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function shipCard($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/issuing/cards/%s/shipping/ship', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php new file mode 100644 index 00000000000..a202ec33f06 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Issuing/IssuingServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'cards' => CardService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php new file mode 100644 index 00000000000..de0e4d10b25 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/RefundService.php @@ -0,0 +1,24 @@ +requires_action. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function expire($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/refunds/%s/expire', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php new file mode 100644 index 00000000000..2eb4de49689 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/ReaderService.php @@ -0,0 +1,25 @@ +request('post', $this->buildPath('/v1/test_helpers/terminal/readers/%s/present_payment_method', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php new file mode 100644 index 00000000000..153ebe0df59 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Terminal/TerminalServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'readers' => ReaderService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php new file mode 100644 index 00000000000..a4eee8c3e67 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestClockService.php @@ -0,0 +1,87 @@ +Ready. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function advance($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/test_clocks/%s/advance', $id), $params, $opts); + } + + /** + * Returns a list of your test clocks. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock> + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/test_helpers/test_clocks', $params, $opts); + } + + /** + * Creates a new test clock that can be attached to new customers and quotes. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/test_helpers/test_clocks', $params, $opts); + } + + /** + * Deletes a test clock. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); + } + + /** + * Retrieves a test clock. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php new file mode 100644 index 00000000000..cb0ee1a01aa --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/TestHelpersServiceFactory.php @@ -0,0 +1,35 @@ + + */ + private static $classMap = [ + 'customers' => CustomerService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'refunds' => RefundService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'testClocks' => TestClockService::class, + 'treasury' => Treasury\TreasuryServiceFactory::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php new file mode 100644 index 00000000000..1c8247625ac --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/InboundTransferService.php @@ -0,0 +1,62 @@ +failed + * status. The InboundTransfer must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function fail($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/fail', $id), $params, $opts); + } + + /** + * Marks the test mode InboundTransfer object as returned and links the + * InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the + * succeeded state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function returnInboundTransfer($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/return', $id), $params, $opts); + } + + /** + * Transitions a test mode created InboundTransfer to the succeeded + * status. The InboundTransfer must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function succeed($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/succeed', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php new file mode 100644 index 00000000000..4981e6852b3 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundPaymentService.php @@ -0,0 +1,62 @@ +failed + * status. The OutboundPayment must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function fail($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/fail', $id), $params, $opts); + } + + /** + * Transitions a test mode created OutboundPayment to the posted + * status. The OutboundPayment must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function post($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/post', $id), $params, $opts); + } + + /** + * Transitions a test mode created OutboundPayment to the returned + * status. The OutboundPayment must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function returnOutboundPayment($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/return', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php new file mode 100644 index 00000000000..4b26bedf229 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/OutboundTransferService.php @@ -0,0 +1,62 @@ +failed + * status. The OutboundTransfer must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function fail($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_transfers/%s/fail', $id), $params, $opts); + } + + /** + * Transitions a test mode created OutboundTransfer to the posted + * status. The OutboundTransfer must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function post($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_transfers/%s/post', $id), $params, $opts); + } + + /** + * Transitions a test mode created OutboundTransfer to the returned + * status. The OutboundTransfer must already be in the processing + * state. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function returnOutboundTransfer($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_transfers/%s/return', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php new file mode 100644 index 00000000000..a90031a32d2 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php @@ -0,0 +1,25 @@ +request('post', '/v1/test_helpers/treasury/received_credits', $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php new file mode 100644 index 00000000000..17f4c8276dd --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php @@ -0,0 +1,25 @@ +request('post', '/v1/test_helpers/treasury/received_debits', $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php new file mode 100644 index 00000000000..8329a53efb4 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TestHelpers/Treasury/TreasuryServiceFactory.php @@ -0,0 +1,33 @@ + + */ + private static $classMap = [ + 'inboundTransfers' => InboundTransferService::class, + 'outboundPayments' => OutboundPaymentService::class, + 'outboundTransfers' => OutboundTransferService::class, + 'receivedCredits' => ReceivedCreditService::class, + 'receivedDebits' => ReceivedDebitService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TopupService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TopupService.php index 059dc209064..bd486b9e2ee 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/TopupService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TopupService.php @@ -14,7 +14,7 @@ class TopupService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Topup> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/TransferService.php b/htdocs/includes/stripe/stripe-php/lib/Service/TransferService.php index 150bbf7313e..b5113e9a873 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/TransferService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/TransferService.php @@ -16,7 +16,7 @@ class TransferService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\Transfer> */ public function all($params = null, $opts = null) { @@ -36,27 +36,13 @@ class TransferService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\TransferReversal> */ public function allReversals($parentId, $params = null, $opts = null) { return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); } - /** - * @param string $id - * @param null|array $params - * @param null|array|\Stripe\Util\RequestOptions $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Transfer - */ - public function cancel($id, $params = null, $opts = null) - { - return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); - } - /** * To send funds from your Stripe account to a connected account, you create a new * transfer object. Your Stripe balance must be able to diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/CreditReversalService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/CreditReversalService.php new file mode 100644 index 00000000000..60bf900a90a --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/CreditReversalService.php @@ -0,0 +1,56 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/credit_reversals', $params, $opts); + } + + /** + * Reverses a ReceivedCredit and creates a CreditReversal object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\CreditReversal + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/credit_reversals', $params, $opts); + } + + /** + * Retrieves the details of an existing CreditReversal by passing the unique + * CreditReversal ID from either the CreditReversal creation request or + * CreditReversal list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\CreditReversal + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/credit_reversals/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/DebitReversalService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/DebitReversalService.php new file mode 100644 index 00000000000..8887ee1451d --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/DebitReversalService.php @@ -0,0 +1,54 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/debit_reversals', $params, $opts); + } + + /** + * Reverses a ReceivedDebit and creates a DebitReversal object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\DebitReversal + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/debit_reversals', $params, $opts); + } + + /** + * Retrieves a DebitReversal object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\DebitReversal + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/debit_reversals/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/FinancialAccountService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/FinancialAccountService.php new file mode 100644 index 00000000000..f273bd9c10d --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/FinancialAccountService.php @@ -0,0 +1,103 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/financial_accounts', $params, $opts); + } + + /** + * Creates a new FinancialAccount. For now, each connected account can only have + * one FinancialAccount. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/financial_accounts', $params, $opts); + } + + /** + * Retrieves the details of a FinancialAccount. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/financial_accounts/%s', $id), $params, $opts); + } + + /** + * Retrieves Features information associated with the FinancialAccount. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount + */ + public function retrieveFeatures($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/financial_accounts/%s/features', $id), $params, $opts); + } + + /** + * Updates the details of a FinancialAccount. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s', $id), $params, $opts); + } + + /** + * Updates the Features associated with a FinancialAccount. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount + */ + public function updateFeatures($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s/features', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/InboundTransferService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/InboundTransferService.php new file mode 100644 index 00000000000..49ea32ba9f2 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/InboundTransferService.php @@ -0,0 +1,70 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/inbound_transfers', $params, $opts); + } + + /** + * Cancels an InboundTransfer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/inbound_transfers/%s/cancel', $id), $params, $opts); + } + + /** + * Creates an InboundTransfer. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/inbound_transfers', $params, $opts); + } + + /** + * Retrieves the details of an existing InboundTransfer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/inbound_transfers/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundPaymentService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundPaymentService.php new file mode 100644 index 00000000000..e6108e0c155 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundPaymentService.php @@ -0,0 +1,72 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/outbound_payments', $params, $opts); + } + + /** + * Cancel an OutboundPayment. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/outbound_payments/%s/cancel', $id), $params, $opts); + } + + /** + * Creates an OutboundPayment. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/outbound_payments', $params, $opts); + } + + /** + * Retrieves the details of an existing OutboundPayment by passing the unique + * OutboundPayment ID from either the OutboundPayment creation request or + * OutboundPayment list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/outbound_payments/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundTransferService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundTransferService.php new file mode 100644 index 00000000000..f61318657df --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/OutboundTransferService.php @@ -0,0 +1,72 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/outbound_transfers', $params, $opts); + } + + /** + * An OutboundTransfer can be canceled if the funds have not yet been paid out. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/treasury/outbound_transfers/%s/cancel', $id), $params, $opts); + } + + /** + * Creates an OutboundTransfer. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/treasury/outbound_transfers', $params, $opts); + } + + /** + * Retrieves the details of an existing OutboundTransfer by passing the unique + * OutboundTransfer ID from either the OutboundTransfer creation request or + * OutboundTransfer list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/outbound_transfers/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedCreditService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedCreditService.php new file mode 100644 index 00000000000..1355deb5098 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedCreditService.php @@ -0,0 +1,40 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/received_credits', $params, $opts); + } + + /** + * Retrieves the details of an existing ReceivedCredit by passing the unique + * ReceivedCredit ID from the ReceivedCredit list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\ReceivedCredit + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/received_credits/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedDebitService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedDebitService.php new file mode 100644 index 00000000000..dfe3786b048 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/ReceivedDebitService.php @@ -0,0 +1,40 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/received_debits', $params, $opts); + } + + /** + * Retrieves the details of an existing ReceivedDebit by passing the unique + * ReceivedDebit ID from the ReceivedDebit list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\ReceivedDebit + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/received_debits/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionEntryService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionEntryService.php new file mode 100644 index 00000000000..3943de1c61a --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionEntryService.php @@ -0,0 +1,39 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/transaction_entries', $params, $opts); + } + + /** + * Retrieves a TransactionEntry object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\TransactionEntry + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/transaction_entries/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionService.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionService.php new file mode 100644 index 00000000000..232b2b1c213 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TransactionService.php @@ -0,0 +1,39 @@ + + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/treasury/transactions', $params, $opts); + } + + /** + * Retrieves the details of an existing Transaction. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\Transaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/treasury/transactions/%s', $id), $params, $opts); + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TreasuryServiceFactory.php b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TreasuryServiceFactory.php new file mode 100644 index 00000000000..a2a2622ba57 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Service/Treasury/TreasuryServiceFactory.php @@ -0,0 +1,43 @@ + + */ + private static $classMap = [ + 'creditReversals' => CreditReversalService::class, + 'debitReversals' => DebitReversalService::class, + 'financialAccounts' => FinancialAccountService::class, + 'inboundTransfers' => InboundTransferService::class, + 'outboundPayments' => OutboundPaymentService::class, + 'outboundTransfers' => OutboundTransferService::class, + 'receivedCredits' => ReceivedCreditService::class, + 'receivedDebits' => ReceivedDebitService::class, + 'transactionEntries' => TransactionEntryService::class, + 'transactions' => TransactionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Service/WebhookEndpointService.php b/htdocs/includes/stripe/stripe-php/lib/Service/WebhookEndpointService.php index 01e642249b6..baa15bd245f 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Service/WebhookEndpointService.php +++ b/htdocs/includes/stripe/stripe-php/lib/Service/WebhookEndpointService.php @@ -14,7 +14,7 @@ class WebhookEndpointService extends \Stripe\Service\AbstractService * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection + * @return \Stripe\Collection<\Stripe\WebhookEndpoint> */ public function all($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/SetupAttempt.php b/htdocs/includes/stripe/stripe-php/lib/SetupAttempt.php index 6c83b686c6c..488ce05b4dc 100644 --- a/htdocs/includes/stripe/stripe-php/lib/SetupAttempt.php +++ b/htdocs/includes/stripe/stripe-php/lib/SetupAttempt.php @@ -13,13 +13,15 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string|\Stripe\StripeObject $application The value of application on the SetupIntent at the time of this confirmation. + * @property null|bool $attach_to_self

If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. + * @property null|string[] $flow_directions

Indicates the directions of money movement for which this payment method is intended to be used.

Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

* @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. * @property \Stripe\StripeObject $payment_method_details - * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. + * @property null|\Stripe\StripeObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. diff --git a/htdocs/includes/stripe/stripe-php/lib/SetupIntent.php b/htdocs/includes/stripe/stripe-php/lib/SetupIntent.php index bf8da19cf6d..a21573685dc 100644 --- a/htdocs/includes/stripe/stripe-php/lib/SetupIntent.php +++ b/htdocs/includes/stripe/stripe-php/lib/SetupIntent.php @@ -43,12 +43,14 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. + * @property null|bool $attach_to_self

If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.

* @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. - * @property null|string $client_secret

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

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

+ * @property null|string $client_secret

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

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

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

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

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

* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. - * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. + * @property null|string[] $flow_directions

Indicates the directions of money movement for which this payment method is intended to be used.

Include inbound if you intend to use the payment method as the origin to pull funds from. Include outbound if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.

+ * @property null|\Stripe\StripeObject $last_setup_error The error encountered in the previous SetupIntent confirmation. * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. @@ -84,7 +86,7 @@ class SetupIntent extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return SetupIntent the canceled setup intent + * @return \Stripe\SetupIntent the canceled setup intent */ public function cancel($params = null, $opts = null) { @@ -101,7 +103,7 @@ class SetupIntent extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return SetupIntent the confirmed setup intent + * @return \Stripe\SetupIntent the confirmed setup intent */ public function confirm($params = null, $opts = null) { @@ -111,4 +113,21 @@ class SetupIntent extends ApiResource return $this; } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent the verified setup intent + */ + public function verifyMicrodeposits($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify_microdeposits'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/ShippingRate.php b/htdocs/includes/stripe/stripe-php/lib/ShippingRate.php new file mode 100644 index 00000000000..a292b8f1536 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/ShippingRate.php @@ -0,0 +1,41 @@ +Checkout Sessions + * and Orders to collect + * shipping costs. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the shipping rate can be used for new purchases. Defaults to true. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $delivery_estimate The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + * @property null|string $display_name The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + * @property null|\Stripe\StripeObject $fixed_amount + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $tax_behavior Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. + * @property null|string|\Stripe\TaxCode $tax_code A tax code ID. The Shipping tax code is txcd_92010001. + * @property string $type The type of calculation to use on the shipping rate. Can only be fixed_amount for now. + */ +class ShippingRate extends ApiResource +{ + const OBJECT_NAME = 'shipping_rate'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_BEHAVIOR_EXCLUSIVE = 'exclusive'; + const TAX_BEHAVIOR_INCLUSIVE = 'inclusive'; + const TAX_BEHAVIOR_UNSPECIFIED = 'unspecified'; + + const TYPE_FIXED_AMOUNT = 'fixed_amount'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php b/htdocs/includes/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php index b109dde70b7..16776508656 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php +++ b/htdocs/includes/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php @@ -15,7 +15,7 @@ namespace Stripe\Sigma; * @property string $object String representing the object's type. Objects of the same type share the same value. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. - * @property \Stripe\StripeObject $error + * @property null|\Stripe\StripeObject $error * @property null|\Stripe\File $file The file object representing the results of the query. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property int $result_available_until Time at which the result expires and is no longer available for download. diff --git a/htdocs/includes/stripe/stripe-php/lib/SingletonApiResource.php b/htdocs/includes/stripe/stripe-php/lib/SingletonApiResource.php index 704cff874bb..34dfa43f63a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/SingletonApiResource.php +++ b/htdocs/includes/stripe/stripe-php/lib/SingletonApiResource.php @@ -7,15 +7,6 @@ namespace Stripe; */ abstract class SingletonApiResource extends ApiResource { - protected static function _singletonRetrieve($options = null) - { - $opts = Util\RequestOptions::parse($options); - $instance = new static(null, $opts); - $instance->refresh(); - - return $instance; - } - /** * @return string the endpoint associated with this singleton class */ @@ -23,6 +14,8 @@ abstract class SingletonApiResource extends ApiResource { // Replace dots with slashes for namespaced resources, e.g. if the object's name is // "foo.bar", then its URL will be "/v1/foo/bar". + + /** @phpstan-ignore-next-line */ $base = \str_replace('.', '/', static::OBJECT_NAME); return "/v1/{$base}"; diff --git a/htdocs/includes/stripe/stripe-php/lib/Source.php b/htdocs/includes/stripe/stripe-php/lib/Source.php index 2262e71d42f..7ddc4a1b74a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Source.php +++ b/htdocs/includes/stripe/stripe-php/lib/Source.php @@ -10,47 +10,53 @@ namespace Stripe; * API just like a Card object: once chargeable, they can be charged, * or can be attached to customers. * + * Stripe doesn't recommend using the deprecated Sources API. We recommend that + * you adopt the PaymentMethods API. This + * newer API provides access to our latest features and payment method types. + * * Related guides: Sources API and Sources & Customers. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\StripeObject $ach_credit_transfer - * @property \Stripe\StripeObject $ach_debit - * @property \Stripe\StripeObject $acss_debit - * @property \Stripe\StripeObject $alipay + * @property null|\Stripe\StripeObject $ach_credit_transfer + * @property null|\Stripe\StripeObject $ach_debit + * @property null|\Stripe\StripeObject $acss_debit + * @property null|\Stripe\StripeObject $alipay * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. - * @property \Stripe\StripeObject $au_becs_debit - * @property \Stripe\StripeObject $bancontact - * @property \Stripe\StripeObject $card - * @property \Stripe\StripeObject $card_present + * @property null|\Stripe\StripeObject $au_becs_debit + * @property null|\Stripe\StripeObject $bancontact + * @property null|\Stripe\StripeObject $card + * @property null|\Stripe\StripeObject $card_present * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. - * @property \Stripe\StripeObject $code_verification + * @property null|\Stripe\StripeObject $code_verification * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. - * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. - * @property \Stripe\StripeObject $eps + * @property null|string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + * @property null|\Stripe\StripeObject $eps * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. - * @property \Stripe\StripeObject $giropay - * @property \Stripe\StripeObject $ideal - * @property \Stripe\StripeObject $klarna + * @property null|\Stripe\StripeObject $giropay + * @property null|\Stripe\StripeObject $ideal + * @property null|\Stripe\StripeObject $klarna * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\StripeObject $multibanco + * @property null|\Stripe\StripeObject $multibanco * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. - * @property \Stripe\StripeObject $p24 - * @property \Stripe\StripeObject $receiver - * @property \Stripe\StripeObject $redirect - * @property \Stripe\StripeObject $sepa_credit_transfer - * @property \Stripe\StripeObject $sepa_debit - * @property \Stripe\StripeObject $sofort - * @property \Stripe\StripeObject $source_order + * @property null|\Stripe\StripeObject $p24 + * @property null|\Stripe\StripeObject $receiver + * @property null|\Stripe\StripeObject $redirect + * @property null|\Stripe\StripeObject $sepa_credit_transfer + * @property null|\Stripe\StripeObject $sepa_debit + * @property null|\Stripe\StripeObject $sofort + * @property null|\Stripe\StripeObject $source_order * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. - * @property \Stripe\StripeObject $three_d_secure + * @property null|\Stripe\StripeObject $three_d_secure * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. - * @property \Stripe\StripeObject $wechat + * @property null|\Stripe\StripeObject $wechat */ class Source extends ApiResource { @@ -115,26 +121,6 @@ class Source extends ApiResource throw new Exception\UnexpectedValueException($message); } - /** - * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of source transactions - */ - public function sourceTransactions($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/source_transactions'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - /** * @param string $id * @param null|array $params @@ -142,11 +128,16 @@ class Source extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of source transactions + * @return \Stripe\Collection<\Stripe\SourceTransaction> list of SourceTransactions */ public static function allSourceTransactions($id, $params = null, $opts = null) { - return self::_allNestedResources($id, '/source_transactions', $params, $opts); + $url = static::resourceUrl($id) . '/source_transactions'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; } /** @@ -155,7 +146,7 @@ class Source extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Source the verified source + * @return \Stripe\Source the verified source */ public function verify($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Stripe.php b/htdocs/includes/stripe/stripe-php/lib/Stripe.php index 22e5db49904..db9f5d03295 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Stripe.php +++ b/htdocs/includes/stripe/stripe-php/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '7.67.0'; + const VERSION = '10.7.0'; /** * @return string the API key used for requests @@ -90,7 +90,7 @@ class Stripe } /** - * @param Util\LoggerInterface $logger the logger to which the library + * @param \Psr\Log\LoggerInterface|Util\LoggerInterface $logger the logger to which the library * will produce messages */ public static function setLogger($logger) @@ -176,7 +176,7 @@ class Stripe } /** - * @return string | null The Stripe account ID for connected account + * @return null|string The Stripe account ID for connected account * requests */ public static function getAccountId() @@ -185,7 +185,7 @@ class Stripe } /** - * @param string $accountId the Stripe account ID to set for connected + * @param null|string $accountId the Stripe account ID to set for connected * account requests */ public static function setAccountId($accountId) @@ -194,7 +194,7 @@ class Stripe } /** - * @return array | null The application's information + * @return null|array The application's information */ public static function getAppInfo() { diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeClient.php b/htdocs/includes/stripe/stripe-php/lib/StripeClient.php index 661483c5b9d..73522abc7d3 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeClient.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeClient.php @@ -11,6 +11,7 @@ namespace Stripe; * @property \Stripe\Service\AccountService $accounts * @property \Stripe\Service\ApplePayDomainService $applePayDomains * @property \Stripe\Service\ApplicationFeeService $applicationFees + * @property \Stripe\Service\Apps\AppsServiceFactory $apps * @property \Stripe\Service\BalanceService $balance * @property \Stripe\Service\BalanceTransactionService $balanceTransactions * @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal @@ -26,37 +27,42 @@ namespace Stripe; * @property \Stripe\Service\ExchangeRateService $exchangeRates * @property \Stripe\Service\FileLinkService $fileLinks * @property \Stripe\Service\FileService $files + * @property \Stripe\Service\FinancialConnections\FinancialConnectionsServiceFactory $financialConnections + * @property \Stripe\Service\Identity\IdentityServiceFactory $identity * @property \Stripe\Service\InvoiceItemService $invoiceItems * @property \Stripe\Service\InvoiceService $invoices * @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing * @property \Stripe\Service\MandateService $mandates * @property \Stripe\Service\OAuthService $oauth - * @property \Stripe\Service\OrderReturnService $orderReturns - * @property \Stripe\Service\OrderService $orders * @property \Stripe\Service\PaymentIntentService $paymentIntents + * @property \Stripe\Service\PaymentLinkService $paymentLinks * @property \Stripe\Service\PaymentMethodService $paymentMethods * @property \Stripe\Service\PayoutService $payouts * @property \Stripe\Service\PlanService $plans * @property \Stripe\Service\PriceService $prices * @property \Stripe\Service\ProductService $products * @property \Stripe\Service\PromotionCodeService $promotionCodes + * @property \Stripe\Service\QuoteService $quotes * @property \Stripe\Service\Radar\RadarServiceFactory $radar * @property \Stripe\Service\RefundService $refunds * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting * @property \Stripe\Service\ReviewService $reviews * @property \Stripe\Service\SetupAttemptService $setupAttempts * @property \Stripe\Service\SetupIntentService $setupIntents + * @property \Stripe\Service\ShippingRateService $shippingRates * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma - * @property \Stripe\Service\SkuService $skus * @property \Stripe\Service\SourceService $sources * @property \Stripe\Service\SubscriptionItemService $subscriptionItems * @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules * @property \Stripe\Service\SubscriptionService $subscriptions + * @property \Stripe\Service\TaxCodeService $taxCodes * @property \Stripe\Service\TaxRateService $taxRates * @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal + * @property \Stripe\Service\TestHelpers\TestHelpersServiceFactory $testHelpers * @property \Stripe\Service\TokenService $tokens * @property \Stripe\Service\TopupService $topups * @property \Stripe\Service\TransferService $transfers + * @property \Stripe\Service\Treasury\TreasuryServiceFactory $treasury * @property \Stripe\Service\WebhookEndpointService $webhookEndpoints */ class StripeClient extends BaseStripeClient diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeClientInterface.php b/htdocs/includes/stripe/stripe-php/lib/StripeClientInterface.php index adcef3f9aa7..d5a8806ff5a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeClientInterface.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeClientInterface.php @@ -5,43 +5,8 @@ namespace Stripe; /** * Interface for a Stripe client. */ -interface StripeClientInterface +interface StripeClientInterface extends BaseStripeClientInterface { - /** - * Gets the API key used by the client to send requests. - * - * @return null|string the API key used by the client to send requests - */ - public function getApiKey(); - - /** - * Gets the client ID used by the client in OAuth requests. - * - * @return null|string the client ID used by the client in OAuth requests - */ - public function getClientId(); - - /** - * Gets the base URL for Stripe's API. - * - * @return string the base URL for Stripe's API - */ - public function getApiBase(); - - /** - * Gets the base URL for Stripe's OAuth API. - * - * @return string the base URL for Stripe's OAuth API - */ - public function getConnectBase(); - - /** - * Gets the base URL for Stripe's Files API. - * - * @return string the base URL for Stripe's Files API - */ - public function getFilesBase(); - /** * Sends a request to Stripe's API. * diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php index eca01a00e90..844cfebd5cc 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php @@ -149,6 +149,11 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable $this->_unsavedValues->add($k); } + /** + * @param mixed $k + * + * @return bool + */ public function __isset($k) { return isset($this->_values[$k]); @@ -187,34 +192,58 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable return $nullval; } - // Magic method for var_dump output. Only works with PHP >= 5.6 + /** + * Magic method for var_dump output. Only works with PHP >= 5.6. + * + * @return array + */ public function __debugInfo() { return $this->_values; } // ArrayAccess methods + + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetSet($k, $v) { $this->{$k} = $v; } + /** + * @return bool + */ + #[\ReturnTypeWillChange] public function offsetExists($k) { return \array_key_exists($k, $this->_values); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetUnset($k) { unset($this->{$k}); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($k) { return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; } - // Countable method + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return \count($this->_values); @@ -419,6 +448,10 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray(); diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeStreamingClientInterface.php b/htdocs/includes/stripe/stripe-php/lib/StripeStreamingClientInterface.php new file mode 100644 index 00000000000..e5e34c183e3 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/StripeStreamingClientInterface.php @@ -0,0 +1,11 @@ +month or year intervals, the day of the month for subsequent invoices. + * @property \Stripe\StripeObject $automatic_tax + * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. + * @property string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as active. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. * @property int $current_period_start Start of the current period that the subscription has been invoiced for. * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. - * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|string $description The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. * @property null|int $ended_at If the subscription has ended, the date the subscription ended. - * @property \Stripe\Collection $items List of subscription items, each with an attached price. + * @property \Stripe\Collection<\Stripe\SubscriptionItem> $items List of subscription items, each with an attached price. * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. + * @property null|\Stripe\StripeObject $payment_settings Payment settings passed on to invoices created by the subscription. * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. * @property string $status

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

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

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

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

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

+ * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription belongs to. + * @property null|\Stripe\StripeObject $transfer_data The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. * @property null|int $trial_end If the subscription has a trial, the end of that trial. + * @property null|\Stripe\StripeObject $trial_settings Settings related to subscription trials. * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. */ class Subscription extends ApiResource @@ -52,9 +61,11 @@ class Subscription extends ApiResource use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; + use ApiOperations\Search; use ApiOperations\Update; const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; + const PAYMENT_BEHAVIOR_DEFAULT_INCOMPLETE = 'default_incomplete'; const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; @@ -67,6 +78,7 @@ class Subscription extends ApiResource const STATUS_INCOMPLETE = 'incomplete'; const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; const STATUS_PAST_DUE = 'past_due'; + const STATUS_PAUSED = 'paused'; const STATUS_TRIALING = 'trialing'; const STATUS_UNPAID = 'unpaid'; @@ -92,11 +104,15 @@ class Subscription extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Subscription the deleted subscription + * @return \Stripe\Subscription the updated subscription */ - public function cancel($params = null, $opts = null) + public function deleteDiscount($params = null, $opts = null) { - return $this->_delete($params, $opts); + $url = $this->instanceUrl() . '/discount'; + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom(['discount' => null], $opts, true); + + return $this; } /** @@ -105,12 +121,46 @@ class Subscription extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Subscription the updated subscription + * @return \Stripe\Subscription the canceled subscription */ - public function deleteDiscount($params = null, $opts = null) + public function cancel($params = null, $opts = null) { - $url = $this->instanceUrl() . '/discount'; + $url = $this->instanceUrl(); list($response, $opts) = $this->_request('delete', $url, $params, $opts); - $this->refreshFrom(['discount' => null], $opts, true); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the resumed subscription + */ + public function resume($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/resume'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SearchResult the subscription search results + */ + public static function search($params = null, $opts = null) + { + $url = '/v1/subscriptions/search'; + + return self::_searchResource($url, $params, $opts); } } diff --git a/htdocs/includes/stripe/stripe-php/lib/SubscriptionItem.php b/htdocs/includes/stripe/stripe-php/lib/SubscriptionItem.php index 5bd25b25200..f480eaa1a35 100644 --- a/htdocs/includes/stripe/stripe-php/lib/SubscriptionItem.php +++ b/htdocs/includes/stripe/stripe-php/lib/SubscriptionItem.php @@ -13,9 +13,9 @@ namespace Stripe; * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Plan $plan

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

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

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

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

- * @property \Stripe\Price $price

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

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

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

- * @property int $quantity The quantity of the plan to which the customer should be subscribed. + * @property \Stripe\Plan $plan

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

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

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

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

+ * @property \Stripe\Price $price

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

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

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

+ * @property null|int $quantity The quantity of the plan to which the customer should be subscribed. * @property string $subscription The subscription this subscription_item belongs to. * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. */ @@ -46,26 +46,6 @@ class SubscriptionItem extends ApiResource return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); } - /** - * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. - * - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return \Stripe\Collection the list of usage record summaries - */ - public function usageRecordSummaries($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/usage_record_summaries'; - list($response, $opts) = $this->_request('get', $url, $params, $opts); - $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); - $obj->setLastResponse($response); - - return $obj; - } - const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; /** @@ -75,7 +55,7 @@ class SubscriptionItem extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of usage record summaries + * @return \Stripe\Collection<\Stripe\UsageRecordSummary> the list of usage record summaries */ public static function allUsageRecordSummaries($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/SubscriptionSchedule.php b/htdocs/includes/stripe/stripe-php/lib/SubscriptionSchedule.php index 0f1b1563024..cc00117032d 100644 --- a/htdocs/includes/stripe/stripe-php/lib/SubscriptionSchedule.php +++ b/htdocs/includes/stripe/stripe-php/lib/SubscriptionSchedule.php @@ -14,13 +14,14 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the schedule. * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. * @property \Stripe\StripeObject $default_settings - * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. + * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release or cancel with the default being release. release will end the subscription schedule and keep the underlying subscription running.cancel will end the subscription schedule and cancel the underlying subscription. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. @@ -28,6 +29,7 @@ namespace Stripe; * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. + * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this subscription schedule belongs to. */ class SubscriptionSchedule extends ApiResource { @@ -44,7 +46,7 @@ class SubscriptionSchedule extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return SubscriptionSchedule the canceled subscription schedule + * @return \Stripe\SubscriptionSchedule the canceled subscription schedule */ public function cancel($params = null, $opts = null) { @@ -61,7 +63,7 @@ class SubscriptionSchedule extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return SubscriptionSchedule the released subscription schedule + * @return \Stripe\SubscriptionSchedule the released subscription schedule */ public function release($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/TaxCode.php b/htdocs/includes/stripe/stripe-php/lib/TaxCode.php new file mode 100644 index 00000000000..0dfc49e8a14 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/TaxCode.php @@ -0,0 +1,22 @@ +Tax codes classify + * goods and services for tax purposes. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $description A detailed description of which types of products the tax code represents. + * @property string $name A short name for the tax code. + */ +class TaxCode extends ApiResource +{ + const OBJECT_NAME = 'tax_code'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/TaxId.php b/htdocs/includes/stripe/stripe-php/lib/TaxId.php index d4188fe4045..0e2dd4acde4 100644 --- a/htdocs/includes/stripe/stripe-php/lib/TaxId.php +++ b/htdocs/includes/stripe/stripe-php/lib/TaxId.php @@ -18,7 +18,7 @@ namespace Stripe; * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string|\Stripe\Customer $customer ID of the customer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property string $type Type of the tax ID, one of ae_trn, au_abn, br_cnpj, br_cpf, ca_bn, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, hk_br, id_npwp, in_gst, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, th_vat, tw_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $type Type of the tax ID, one of ae_trn, au_abn, au_arn, bg_uic, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, eg_tin, es_cif, eu_oss_vat, eu_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ph_tin, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, th_vat, tr_tin, tw_vat, ua_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown * @property string $value Value of the tax ID. * @property null|\Stripe\StripeObject $verification Tax ID verification information. */ @@ -30,19 +30,34 @@ class TaxId extends ApiResource const TYPE_AE_TRN = 'ae_trn'; const TYPE_AU_ABN = 'au_abn'; + const TYPE_AU_ARN = 'au_arn'; + const TYPE_BG_UIC = 'bg_uic'; const TYPE_BR_CNPJ = 'br_cnpj'; const TYPE_BR_CPF = 'br_cpf'; const TYPE_CA_BN = 'ca_bn'; + const TYPE_CA_GST_HST = 'ca_gst_hst'; + const TYPE_CA_PST_BC = 'ca_pst_bc'; + const TYPE_CA_PST_MB = 'ca_pst_mb'; + const TYPE_CA_PST_SK = 'ca_pst_sk'; const TYPE_CA_QST = 'ca_qst'; const TYPE_CH_VAT = 'ch_vat'; const TYPE_CL_TIN = 'cl_tin'; + const TYPE_EG_TIN = 'eg_tin'; const TYPE_ES_CIF = 'es_cif'; + const TYPE_EU_OSS_VAT = 'eu_oss_vat'; const TYPE_EU_VAT = 'eu_vat'; + const TYPE_GB_VAT = 'gb_vat'; + const TYPE_GE_VAT = 'ge_vat'; const TYPE_HK_BR = 'hk_br'; + const TYPE_HU_TIN = 'hu_tin'; const TYPE_ID_NPWP = 'id_npwp'; + const TYPE_IL_VAT = 'il_vat'; const TYPE_IN_GST = 'in_gst'; + const TYPE_IS_VAT = 'is_vat'; const TYPE_JP_CN = 'jp_cn'; const TYPE_JP_RN = 'jp_rn'; + const TYPE_JP_TRN = 'jp_trn'; + const TYPE_KE_PIN = 'ke_pin'; const TYPE_KR_BRN = 'kr_brn'; const TYPE_LI_UID = 'li_uid'; const TYPE_MX_RFC = 'mx_rfc'; @@ -51,13 +66,17 @@ class TaxId extends ApiResource const TYPE_MY_SST = 'my_sst'; const TYPE_NO_VAT = 'no_vat'; const TYPE_NZ_GST = 'nz_gst'; + const TYPE_PH_TIN = 'ph_tin'; const TYPE_RU_INN = 'ru_inn'; const TYPE_RU_KPP = 'ru_kpp'; const TYPE_SA_VAT = 'sa_vat'; const TYPE_SG_GST = 'sg_gst'; const TYPE_SG_UEN = 'sg_uen'; + const TYPE_SI_TIN = 'si_tin'; const TYPE_TH_VAT = 'th_vat'; + const TYPE_TR_TIN = 'tr_tin'; const TYPE_TW_VAT = 'tw_vat'; + const TYPE_UA_VAT = 'ua_vat'; const TYPE_UNKNOWN = 'unknown'; const TYPE_US_EIN = 'us_ein'; const TYPE_ZA_VAT = 'za_vat'; diff --git a/htdocs/includes/stripe/stripe-php/lib/TaxRate.php b/htdocs/includes/stripe/stripe-php/lib/TaxRate.php index 2974f8383f3..fa7cc84d865 100644 --- a/htdocs/includes/stripe/stripe-php/lib/TaxRate.php +++ b/htdocs/includes/stripe/stripe-php/lib/TaxRate.php @@ -18,6 +18,7 @@ namespace Stripe; * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property bool $active Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. @@ -26,6 +27,8 @@ namespace Stripe; * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property float $percentage This represents the tax rate percent out of 100. + * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. + * @property null|string $tax_type The high-level tax type, such as vat or sales_tax. */ class TaxRate extends ApiResource { @@ -35,4 +38,14 @@ class TaxRate extends ApiResource use ApiOperations\Create; use ApiOperations\Retrieve; use ApiOperations\Update; + + const TAX_TYPE_GST = 'gst'; + const TAX_TYPE_HST = 'hst'; + const TAX_TYPE_IGST = 'igst'; + const TAX_TYPE_JCT = 'jct'; + const TAX_TYPE_PST = 'pst'; + const TAX_TYPE_QST = 'qst'; + const TAX_TYPE_RST = 'rst'; + const TAX_TYPE_SALES_TAX = 'sales_tax'; + const TAX_TYPE_VAT = 'vat'; } diff --git a/htdocs/includes/stripe/stripe-php/lib/Terminal/Configuration.php b/htdocs/includes/stripe/stripe-php/lib/Terminal/Configuration.php new file mode 100644 index 00000000000..1484c2e89d4 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Terminal/Configuration.php @@ -0,0 +1,28 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $tipping + * @property null|\Stripe\StripeObject $verifone_p400 + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Terminal/ConnectionToken.php b/htdocs/includes/stripe/stripe-php/lib/Terminal/ConnectionToken.php index e688857b04c..101f2114fb2 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Terminal/ConnectionToken.php +++ b/htdocs/includes/stripe/stripe-php/lib/Terminal/ConnectionToken.php @@ -7,12 +7,11 @@ namespace Stripe\Terminal; /** * A Connection Token is used by the Stripe Terminal SDK to connect to a reader. * - * Related guide: Fleet + * Related guide: Fleet * Management. * * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property string $location The id of the location that this connection token is scoped to. + * @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. * @property string $secret Your application should pass this token to the Stripe Terminal SDK. */ class ConnectionToken extends \Stripe\ApiResource diff --git a/htdocs/includes/stripe/stripe-php/lib/Terminal/Location.php b/htdocs/includes/stripe/stripe-php/lib/Terminal/Location.php index 5769ef358e8..5c7bf4dc574 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Terminal/Location.php +++ b/htdocs/includes/stripe/stripe-php/lib/Terminal/Location.php @@ -7,13 +7,13 @@ namespace Stripe\Terminal; /** * A Location represents a grouping of readers. * - * Related guide: Fleet + * Related guide: Fleet * Management. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. * @property \Stripe\StripeObject $address + * @property null|string $configuration_overrides The ID of a configuration that will be used to customize all readers in this location. * @property string $display_name The display name of the location. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. diff --git a/htdocs/includes/stripe/stripe-php/lib/Terminal/Reader.php b/htdocs/includes/stripe/stripe-php/lib/Terminal/Reader.php index 513b130af69..361a28e022a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Terminal/Reader.php +++ b/htdocs/includes/stripe/stripe-php/lib/Terminal/Reader.php @@ -8,17 +8,18 @@ namespace Stripe\Terminal; * A Reader represents a physical device for accepting payment details. * * Related guide: Connecting to a + * href="https://stripe.com/docs/terminal/payments/connect-reader">Connecting to a * Reader. * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $action The most recent action performed by the reader. * @property null|string $device_sw_version The current software version of the reader. - * @property string $device_type Type of reader, one of bbpos_chipper2x or verifone_P400. + * @property string $device_type Type of reader, one of bbpos_wisepad3, stripe_m2, bbpos_chipper2x, bbpos_wisepos_e, verifone_P400, or simulated_wisepos_e. * @property null|string $ip_address The local IP address of the reader. * @property string $label Custom label given to the reader for easier identification. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $location The location identifier of the reader. + * @property null|string|\Stripe\Terminal\Location $location The location identifier of the reader. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. * @property string $serial_number Serial number of the reader. * @property null|string $status The networking status of the reader. @@ -32,4 +33,89 @@ class Reader extends \Stripe\ApiResource use \Stripe\ApiOperations\Delete; use \Stripe\ApiOperations\Retrieve; use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the canceled reader + */ + public function cancelAction($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel_action'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the processed reader + */ + public function processPaymentIntent($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/process_payment_intent'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the processed reader + */ + public function processSetupIntent($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/process_setup_intent'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the refunded reader + */ + public function refundPayment($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/refund_payment'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader the seted reader + */ + public function setReaderDisplay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/set_reader_display'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } } diff --git a/htdocs/includes/stripe/stripe-php/lib/TestHelpers/TestClock.php b/htdocs/includes/stripe/stripe-php/lib/TestHelpers/TestClock.php new file mode 100644 index 00000000000..01d36ea0589 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/TestHelpers/TestClock.php @@ -0,0 +1,53 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $name The custom name supplied at creation. + * @property string $status The status of the Test Clock. + */ +class TestClock extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'test_helpers.test_clock'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_ADVANCING = 'advancing'; + const STATUS_INTERNAL_FAILURE = 'internal_failure'; + const STATUS_READY = 'ready'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TestHelpers\TestClock the advanced test clock + */ + public function advance($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/advance'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/ThreeDSecure.php b/htdocs/includes/stripe/stripe-php/lib/ThreeDSecure.php deleted file mode 100644 index 51b5691d4e7..00000000000 --- a/htdocs/includes/stripe/stripe-php/lib/ThreeDSecure.php +++ /dev/null @@ -1,37 +0,0 @@ -3D - * Secure object. Once the object has been created, you can use it to - * authenticate the cardholder and create a charge. - * - * @property string $id Unique identifier for the object. - * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property int $amount Amount of the charge that you will create when authentication completes. - * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. - * @property \Stripe\Card $card

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

Related guide: Card Payments with Sources.

- * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. - * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. - * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. - * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". - * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. - */ -class ThreeDSecure extends ApiResource -{ - const OBJECT_NAME = 'three_d_secure'; - - use ApiOperations\Create; - use ApiOperations\Retrieve; - - /** - * @return string the endpoint URL for the given class - */ - public static function classUrl() - { - return '/v1/3d_secure'; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Token.php b/htdocs/includes/stripe/stripe-php/lib/Token.php index de7988cfb5a..e3c734a99fa 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Token.php +++ b/htdocs/includes/stripe/stripe-php/lib/Token.php @@ -26,8 +26,8 @@ namespace Stripe; * href="https://stripe.com/docs/api#customers">Customer objects or Custom accounts. Note * that Radar, our integrated solution - * for automatic fraud protection, supports only integrations that use client-side - * tokenization. + * for automatic fraud protection, performs best with integrations that use + * client-side tokenization. * * Related guide: Accept @@ -35,8 +35,8 @@ namespace Stripe; * * @property string $id Unique identifier for the object. * @property string $object String representing the object's type. Objects of the same type share the same value. - * @property \Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

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

Related guide: Bank Debits and Transfers.

- * @property \Stripe\Card $card

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

Related guide: Card Payments with Sources.

+ * @property null|\Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

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

Related guide: Bank Debits and Transfers.

+ * @property null|\Stripe\Card $card

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

Related guide: Card Payments with Sources.

* @property null|string $client_ip IP address of the client that generated the token. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. diff --git a/htdocs/includes/stripe/stripe-php/lib/Topup.php b/htdocs/includes/stripe/stripe-php/lib/Topup.php index 4a4c818b214..a0ea053cd2c 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Topup.php +++ b/htdocs/includes/stripe/stripe-php/lib/Topup.php @@ -24,7 +24,7 @@ namespace Stripe; * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Source $source

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

Related guides: Sources API and Sources & Customers.

+ * @property null|\Stripe\Source $source For most Stripe users, the source of every top-up is a bank account. This hash is then the source object describing that bank account. * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. * @property null|string $transfer_group A string that identifies this top-up as part of a group. @@ -50,7 +50,7 @@ class Topup extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return Topup the canceled topup + * @return \Stripe\Topup the canceled topup */ public function cancel($params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Transfer.php b/htdocs/includes/stripe/stripe-php/lib/Transfer.php index 6b8e4ac6afa..73677664380 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Transfer.php +++ b/htdocs/includes/stripe/stripe-php/lib/Transfer.php @@ -27,10 +27,10 @@ namespace Stripe; * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. - * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + * @property null|string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property \Stripe\Collection $reversals A list of reversals that have been applied to the transfer. + * @property \Stripe\Collection<\Stripe\TransferReversal> $reversals A list of reversals that have been applied to the transfer. * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. @@ -46,27 +46,9 @@ class Transfer extends ApiResource use ApiOperations\Retrieve; use ApiOperations\Update; - const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; const SOURCE_TYPE_CARD = 'card'; - const SOURCE_TYPE_FINANCING = 'financing'; - - /** - * @param null|array $params - * @param null|array|string $opts - * - * @throws \Stripe\Exception\ApiErrorException if the request fails - * - * @return Transfer the canceled transfer - */ - public function cancel($params = null, $opts = null) - { - $url = $this->instanceUrl() . '/cancel'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - - return $this; - } + const SOURCE_TYPE_FPX = 'fpx'; const PATH_REVERSALS = '/reversals'; @@ -77,7 +59,7 @@ class Transfer extends ApiResource * * @throws \Stripe\Exception\ApiErrorException if the request fails * - * @return \Stripe\Collection the list of transfer reversals + * @return \Stripe\Collection<\Stripe\TransferReversal> the list of transfer reversals */ public static function allReversals($id, $params = null, $opts = null) { diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/CreditReversal.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/CreditReversal.php new file mode 100644 index 00000000000..e142d811dfe --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/CreditReversal.php @@ -0,0 +1,42 @@ +ReceivedCredits + * depending on their network and source flow. Reversing a ReceivedCredit leads to + * the creation of a new object known as a CreditReversal. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $financial_account The FinancialAccount to reverse funds from. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $network The rails used to reverse the funds. + * @property string $received_credit The ReceivedCredit being reversed. + * @property string $status Status of the CreditReversal + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class CreditReversal extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.credit_reversal'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + + const NETWORK_ACH = 'ach'; + const NETWORK_STRIPE = 'stripe'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_POSTED = 'posted'; + const STATUS_PROCESSING = 'processing'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/DebitReversal.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/DebitReversal.php new file mode 100644 index 00000000000..fa55033176e --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/DebitReversal.php @@ -0,0 +1,43 @@ +ReceivedDebits depending + * on their network and source flow. Reversing a ReceivedDebit leads to the + * creation of a new object known as a DebitReversal. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $financial_account The FinancialAccount to reverse funds from. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property null|\Stripe\StripeObject $linked_flows Other flows linked to a DebitReversal. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $network The rails used to reverse the funds. + * @property string $received_debit The ReceivedDebit being reversed. + * @property string $status Status of the DebitReversal + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class DebitReversal extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.debit_reversal'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + + const NETWORK_ACH = 'ach'; + const NETWORK_CARD = 'card'; + + const STATUS_FAILED = 'failed'; + const STATUS_PROCESSING = 'processing'; + const STATUS_SUCCEEDED = 'succeeded'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccount.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccount.php new file mode 100644 index 00000000000..a04bf59ae11 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccount.php @@ -0,0 +1,75 @@ +ISO 3166-1 alpha-2). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\Treasury\FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a status enum and associated status_details. Stripe or the platform can control Features via the requested field. + * @property \Stripe\StripeObject[] $financial_addresses The set of credentials that resolve to a FinancialAccount. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string[] $pending_features The array of paths to pending Features in the Features hash. + * @property null|\Stripe\StripeObject $platform_restrictions The set of functionalities that the platform can restrict on the FinancialAccount. + * @property null|string[] $restricted_features The array of paths to restricted Features in the Features hash. + * @property string $status The enum specifying what state the account is in. + * @property \Stripe\StripeObject $status_details + * @property string[] $supported_currencies The currencies the FinancialAccount can hold a balance in. Three-letter ISO currency code, in lowercase. + */ +class FinancialAccount extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.financial_account'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + const STATUS_CLOSED = 'closed'; + const STATUS_OPEN = 'open'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount the retrieved financial account + */ + public function retrieveFeatures($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/features'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\FinancialAccount the updated financial account + */ + public function updateFeatures($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/features'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccountFeatures.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccountFeatures.php new file mode 100644 index 00000000000..ba07e100b45 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/FinancialAccountFeatures.php @@ -0,0 +1,24 @@ +status enum and associated status_details. Stripe or + * the platform can control Features via the requested field. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $card_issuing Toggle settings for enabling/disabling a feature + * @property null|\Stripe\StripeObject $deposit_insurance Toggle settings for enabling/disabling a feature + * @property null|\Stripe\StripeObject $financial_addresses Settings related to Financial Addresses features on a Financial Account + * @property null|\Stripe\StripeObject $inbound_transfers InboundTransfers contains inbound transfers features for a FinancialAccount. + * @property null|\Stripe\StripeObject $intra_stripe_flows Toggle settings for enabling/disabling a feature + * @property null|\Stripe\StripeObject $outbound_payments Settings related to Outbound Payments features on a Financial Account + * @property null|\Stripe\StripeObject $outbound_transfers OutboundTransfers contains outbound transfers features for a FinancialAccount. + */ +class FinancialAccountFeatures extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.financial_account_features'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/InboundTransfer.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/InboundTransfer.php new file mode 100644 index 00000000000..bc841aa4f7b --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/InboundTransfer.php @@ -0,0 +1,65 @@ +InboundTransfers + * to add funds to your FinancialAccount via a + * PaymentMethod that is owned by you. The funds will be transferred via an ACH + * debit. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property bool $cancelable Returns true if the InboundTransfer is able to be canceled. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\StripeObject $failure_details Details about this InboundTransfer's failure. Only set when status is failed. + * @property string $financial_account The FinancialAccount that received the funds. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property \Stripe\StripeObject $linked_flows + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $origin_payment_method The origin payment method to be debited for an InboundTransfer. + * @property null|\Stripe\StripeObject $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer. + * @property null|bool $returned Returns true if the funds for an InboundTransfer were returned after the InboundTransfer went to the succeeded state. + * @property string $statement_descriptor Statement descriptor shown when funds are debited from the source. Not all payment networks support statement_descriptor. + * @property string $status Status of the InboundTransfer: processing, succeeded, failed, and canceled. An InboundTransfer is processing if it is created and pending. The status changes to succeeded once the funds have been "confirmed" and a transaction is created and posted. The status changes to failed if the transfer fails. + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class InboundTransfer extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.inbound_transfer'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PROCESSING = 'processing'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\InboundTransfer the canceled inbound transfer + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundPayment.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundPayment.php new file mode 100644 index 00000000000..3997bd30912 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundPayment.php @@ -0,0 +1,69 @@ +FinancialAccount. + * To send money to an account belonging to the same user, use an OutboundTransfer. + * + * Simulate OutboundPayment state changes with the + * /v1/test_helpers/treasury/outbound_payments endpoints. These + * methods can only be called on test mode objects. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property bool $cancelable Returns true if the object can be canceled, and false otherwise. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $customer ID of the customer to whom an OutboundPayment is sent. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $destination_payment_method The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using destination_payment_method_data. + * @property null|\Stripe\StripeObject $destination_payment_method_details Details about the PaymentMethod for an OutboundPayment. + * @property null|\Stripe\StripeObject $end_user_details Details about the end user. + * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. + * @property string $financial_account The FinancialAccount that funds were pulled from. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundPayment. Only set when the status is returned. + * @property string $statement_descriptor The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + * @property string $status Current status of the OutboundPayment: processing, failed, posted, returned, canceled. An OutboundPayment is processing if it has been created and is pending. The status changes to posted once the OutboundPayment has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundPayment fails to arrive at its destination, its status will change to returned. + * @property \Stripe\StripeObject $status_transitions + * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class OutboundPayment extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.outbound_payment'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_POSTED = 'posted'; + const STATUS_PROCESSING = 'processing'; + const STATUS_RETURNED = 'returned'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundPayment the canceled outbound payment + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundTransfer.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundTransfer.php new file mode 100644 index 00000000000..a21680bee2e --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/OutboundTransfer.php @@ -0,0 +1,69 @@ +FinancialAccount to a + * PaymentMethod belonging to the same entity. To send funds to a different party, + * use OutboundPayments + * instead. You can send funds over ACH rails or through a domestic wire transfer + * to a user's own external bank account. + * + * Simulate OutboundTransfer state changes with the + * /v1/test_helpers/treasury/outbound_transfers endpoints. These + * methods can only be called on test mode objects. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property bool $cancelable Returns true if the object can be canceled, and false otherwise. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $destination_payment_method The PaymentMethod used as the payment instrument for an OutboundTransfer. + * @property \Stripe\StripeObject $destination_payment_method_details + * @property int $expected_arrival_date The date when funds are expected to arrive in the destination account. + * @property string $financial_account The FinancialAccount that funds were pulled from. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $returned_details Details about a returned OutboundTransfer. Only set when the status is returned. + * @property string $statement_descriptor Information about the OutboundTransfer to be sent to the recipient account. + * @property string $status Current status of the OutboundTransfer: processing, failed, canceled, posted, returned. An OutboundTransfer is processing if it has been created and is pending. The status changes to posted once the OutboundTransfer has been "confirmed" and funds have left the account, or to failed or canceled. If an OutboundTransfer fails to arrive at its destination, its status will change to returned. + * @property \Stripe\StripeObject $status_transitions + * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class OutboundTransfer extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.outbound_transfer'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_POSTED = 'posted'; + const STATUS_PROCESSING = 'processing'; + const STATUS_RETURNED = 'returned'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Treasury\OutboundTransfer the canceled outbound transfer + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedCredit.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedCredit.php new file mode 100644 index 00000000000..9a72ff07404 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedCredit.php @@ -0,0 +1,48 @@ +FinancialAccount (for + * example, via ACH or wire). These money movements are not initiated from the + * FinancialAccount. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $failure_code Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. + * @property null|string $financial_account The FinancialAccount that received the funds. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property \Stripe\StripeObject $initiating_payment_method_details + * @property \Stripe\StripeObject $linked_flows + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $network The rails used to send the funds. + * @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedCredit may be reversed. + * @property string $status Status of the ReceivedCredit. ReceivedCredits are created either succeeded (approved) or failed (declined). If a ReceivedCredit is declined, the failure reason can be found in the failure_code field. + * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class ReceivedCredit extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.received_credit'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FAILURE_CODE_ACCOUNT_CLOSED = 'account_closed'; + const FAILURE_CODE_ACCOUNT_FROZEN = 'account_frozen'; + const FAILURE_CODE_OTHER = 'other'; + + const NETWORK_ACH = 'ach'; + const NETWORK_CARD = 'card'; + const NETWORK_STRIPE = 'stripe'; + const NETWORK_US_DOMESTIC_WIRE = 'us_domestic_wire'; + + const STATUS_FAILED = 'failed'; + const STATUS_SUCCEEDED = 'succeeded'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedDebit.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedDebit.php new file mode 100644 index 00000000000..62ac9215344 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/ReceivedDebit.php @@ -0,0 +1,47 @@ +FinancialAccount. + * These are not initiated from the FinancialAccount. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $failure_code Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. + * @property null|string $financial_account The FinancialAccount that funds were pulled from. + * @property null|string $hosted_regulatory_receipt_url A hosted transaction receipt URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + * @property null|\Stripe\StripeObject $initiating_payment_method_details + * @property \Stripe\StripeObject $linked_flows + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $network The network used for the ReceivedDebit. + * @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedDebit might be reversed. + * @property string $status Status of the ReceivedDebit. ReceivedDebits are created with a status of either succeeded (approved) or failed (declined). The failure reason can be found under the failure_code. + * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + */ +class ReceivedDebit extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.received_debit'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FAILURE_CODE_ACCOUNT_CLOSED = 'account_closed'; + const FAILURE_CODE_ACCOUNT_FROZEN = 'account_frozen'; + const FAILURE_CODE_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const FAILURE_CODE_OTHER = 'other'; + + const NETWORK_ACH = 'ach'; + const NETWORK_CARD = 'card'; + const NETWORK_STRIPE = 'stripe'; + + const STATUS_FAILED = 'failed'; + const STATUS_SUCCEEDED = 'succeeded'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/Transaction.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/Transaction.php new file mode 100644 index 00000000000..32168984403 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/Transaction.php @@ -0,0 +1,48 @@ +FinancialAccount's + * balance. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in cents) transferred. + * @property \Stripe\StripeObject $balance_impact Change to a FinancialAccount's balance + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\Collection<\Stripe\Treasury\TransactionEntry> $entries A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. + * @property string $financial_account The FinancialAccount associated with this object. + * @property null|string $flow ID of the flow that created the Transaction. + * @property null|\Stripe\StripeObject $flow_details Details of the flow that created the Transaction. + * @property string $flow_type Type of the flow that created the Transaction. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $status Status of the Transaction. + * @property \Stripe\StripeObject $status_transitions + */ +class Transaction extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.transaction'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FLOW_TYPE_CREDIT_REVERSAL = 'credit_reversal'; + const FLOW_TYPE_DEBIT_REVERSAL = 'debit_reversal'; + const FLOW_TYPE_INBOUND_TRANSFER = 'inbound_transfer'; + const FLOW_TYPE_ISSUING_AUTHORIZATION = 'issuing_authorization'; + const FLOW_TYPE_OTHER = 'other'; + const FLOW_TYPE_OUTBOUND_PAYMENT = 'outbound_payment'; + const FLOW_TYPE_OUTBOUND_TRANSFER = 'outbound_transfer'; + const FLOW_TYPE_RECEIVED_CREDIT = 'received_credit'; + const FLOW_TYPE_RECEIVED_DEBIT = 'received_debit'; + + const STATUS_OPEN = 'open'; + const STATUS_POSTED = 'posted'; + const STATUS_VOID = 'void'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Treasury/TransactionEntry.php b/htdocs/includes/stripe/stripe-php/lib/Treasury/TransactionEntry.php new file mode 100644 index 00000000000..e50dbad9b7e --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Treasury/TransactionEntry.php @@ -0,0 +1,62 @@ +Transaction. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $balance_impact Change to a FinancialAccount's balance + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property int $effective_at When the TransactionEntry will impact the FinancialAccount's balance. + * @property string $financial_account The FinancialAccount associated with this object. + * @property null|string $flow Token of the flow associated with the TransactionEntry. + * @property null|\Stripe\StripeObject $flow_details Details of the flow associated with the TransactionEntry. + * @property string $flow_type Type of the flow associated with the TransactionEntry. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object. + * @property string $type The specific money movement that generated the TransactionEntry. + */ +class TransactionEntry extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'treasury.transaction_entry'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FLOW_TYPE_CREDIT_REVERSAL = 'credit_reversal'; + const FLOW_TYPE_DEBIT_REVERSAL = 'debit_reversal'; + const FLOW_TYPE_INBOUND_TRANSFER = 'inbound_transfer'; + const FLOW_TYPE_ISSUING_AUTHORIZATION = 'issuing_authorization'; + const FLOW_TYPE_OTHER = 'other'; + const FLOW_TYPE_OUTBOUND_PAYMENT = 'outbound_payment'; + const FLOW_TYPE_OUTBOUND_TRANSFER = 'outbound_transfer'; + const FLOW_TYPE_RECEIVED_CREDIT = 'received_credit'; + const FLOW_TYPE_RECEIVED_DEBIT = 'received_debit'; + + const TYPE_CREDIT_REVERSAL = 'credit_reversal'; + const TYPE_CREDIT_REVERSAL_POSTING = 'credit_reversal_posting'; + const TYPE_DEBIT_REVERSAL = 'debit_reversal'; + const TYPE_INBOUND_TRANSFER = 'inbound_transfer'; + const TYPE_INBOUND_TRANSFER_RETURN = 'inbound_transfer_return'; + const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; + const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; + const TYPE_OTHER = 'other'; + const TYPE_OUTBOUND_PAYMENT = 'outbound_payment'; + const TYPE_OUTBOUND_PAYMENT_CANCELLATION = 'outbound_payment_cancellation'; + const TYPE_OUTBOUND_PAYMENT_FAILURE = 'outbound_payment_failure'; + const TYPE_OUTBOUND_PAYMENT_POSTING = 'outbound_payment_posting'; + const TYPE_OUTBOUND_PAYMENT_RETURN = 'outbound_payment_return'; + const TYPE_OUTBOUND_TRANSFER = 'outbound_transfer'; + const TYPE_OUTBOUND_TRANSFER_CANCELLATION = 'outbound_transfer_cancellation'; + const TYPE_OUTBOUND_TRANSFER_FAILURE = 'outbound_transfer_failure'; + const TYPE_OUTBOUND_TRANSFER_POSTING = 'outbound_transfer_posting'; + const TYPE_OUTBOUND_TRANSFER_RETURN = 'outbound_transfer_return'; + const TYPE_RECEIVED_CREDIT = 'received_credit'; + const TYPE_RECEIVED_DEBIT = 'received_debit'; +} diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/ApiVersion.php b/htdocs/includes/stripe/stripe-php/lib/Util/ApiVersion.php new file mode 100644 index 00000000000..9efa9d70ee6 --- /dev/null +++ b/htdocs/includes/stripe/stripe-php/lib/Util/ApiVersion.php @@ -0,0 +1,10 @@ +page = $collection; - $this->params = $params; - } - - public function rewind() - { - // Actually rewinding would require making a copy of the original page. - } - - public function current() - { - $item = current($this->page->data); - $this->lastId = $item !== false ? $item['id'] : null; - - return $item; - } - - public function key() - { - return key($this->page->data) + $this->pageOffset; - } - - public function next() - { - $item = next($this->page->data); - if ($item === false) { - // If we've run out of data on the current page, try to fetch another one - // and increase the offset the new page would start at - $this->pageOffset += count($this->page->data); - if ($this->page['has_more']) { - $this->params = array_merge( - $this->params ?: [], - ['starting_after' => $this->lastId] - ); - $this->page = $this->page->all($this->params); - } else { - return false; - } - } - } - - public function valid() - { - $key = key($this->page->data); - $valid = ($key !== null && $key !== false); - return $valid; - } -} diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index 670ab0b6a7e..5e1ac7de9d1 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -21,16 +21,28 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega $this->container = \array_change_key_case($initial_array, \CASE_LOWER); } + /** + * @return int + */ + #[\ReturnTypeWillChange] public function count() { return \count($this->container); } + /** + * @return \ArrayIterator + */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->container); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $offset = static::maybeLowercase($offset); @@ -41,6 +53,10 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega } } + /** + * @return bool + */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { $offset = static::maybeLowercase($offset); @@ -48,12 +64,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega return isset($this->container[$offset]); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { $offset = static::maybeLowercase($offset); unset($this->container[$offset]); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { $offset = static::maybeLowercase($offset); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/ObjectTypes.php b/htdocs/includes/stripe/stripe-php/lib/Util/ObjectTypes.php index 5aad2bb407f..6fa98e4075f 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/ObjectTypes.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/ObjectTypes.php @@ -12,18 +12,18 @@ class ObjectTypes const mapping = [ \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, - \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, + \Stripe\Apps\Secret::OBJECT_NAME => \Stripe\Apps\Secret::class, \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, - \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, - \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, @@ -33,6 +33,7 @@ class ObjectTypes \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\CustomerCashBalanceTransaction::OBJECT_NAME => \Stripe\CustomerCashBalanceTransaction::class, \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, @@ -41,6 +42,13 @@ class ObjectTypes \Stripe\File::OBJECT_NAME => \Stripe\File::class, \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, + \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, + \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, + \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, + \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, + \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, + \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, @@ -53,10 +61,8 @@ class ObjectTypes \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, - \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, - \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, @@ -64,34 +70,47 @@ class ObjectTypes \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, - \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, - \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, + \Stripe\SearchResult::OBJECT_NAME => \Stripe\SearchResult::class, \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, + \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class, \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, - \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, - \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, + \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, + \Stripe\Treasury\CreditReversal::OBJECT_NAME => \Stripe\Treasury\CreditReversal::class, + \Stripe\Treasury\DebitReversal::OBJECT_NAME => \Stripe\Treasury\DebitReversal::class, + \Stripe\Treasury\FinancialAccount::OBJECT_NAME => \Stripe\Treasury\FinancialAccount::class, + \Stripe\Treasury\FinancialAccountFeatures::OBJECT_NAME => \Stripe\Treasury\FinancialAccountFeatures::class, + \Stripe\Treasury\InboundTransfer::OBJECT_NAME => \Stripe\Treasury\InboundTransfer::class, + \Stripe\Treasury\OutboundPayment::OBJECT_NAME => \Stripe\Treasury\OutboundPayment::class, + \Stripe\Treasury\OutboundTransfer::OBJECT_NAME => \Stripe\Treasury\OutboundTransfer::class, + \Stripe\Treasury\ReceivedCredit::OBJECT_NAME => \Stripe\Treasury\ReceivedCredit::class, + \Stripe\Treasury\ReceivedDebit::OBJECT_NAME => \Stripe\Treasury\ReceivedDebit::class, + \Stripe\Treasury\Transaction::OBJECT_NAME => \Stripe\Treasury\Transaction::class, + \Stripe\Treasury\TransactionEntry::OBJECT_NAME => \Stripe\Treasury\TransactionEntry::class, \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/RandomGenerator.php b/htdocs/includes/stripe/stripe-php/lib/Util/RandomGenerator.php index b11e445d268..ccf023ac8e8 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/RandomGenerator.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/RandomGenerator.php @@ -28,8 +28,8 @@ class RandomGenerator public function uuid() { $arr = \array_values(\unpack('N1a/n4b/N1c', \openssl_random_pseudo_bytes(16))); - $arr[2] = ($arr[2] & 0x0fff) | 0x4000; - $arr[3] = ($arr[3] & 0x3fff) | 0x8000; + $arr[2] = ($arr[2] & 0x0FFF) | 0x4000; + $arr[3] = ($arr[3] & 0x3FFF) | 0x8000; return \vsprintf('%08x-%04x-%04x-%04x-%04x%08x', $arr); } diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/RequestOptions.php b/htdocs/includes/stripe/stripe-php/lib/Util/RequestOptions.php index 89924bb6c73..cce3a521b68 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/RequestOptions.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/RequestOptions.php @@ -93,7 +93,7 @@ class RequestOptions public static function parse($options, $strict = false) { if ($options instanceof self) { - return $options; + return clone $options; } if (null === $options) { @@ -154,8 +154,13 @@ class RequestOptions throw new \Stripe\Exception\InvalidArgumentException($message); } + /** @return string */ private function redactedApiKey() { + if (null === $this->apiKey) { + return ''; + } + $pieces = \explode('_', $this->apiKey, 3); $last = \array_pop($pieces); $redactedLast = \strlen($last) > 4 diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php index 017f9297856..aaa811d5acc 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php @@ -37,6 +37,10 @@ class Set implements IteratorAggregate return \array_keys($this->_elts); } + /** + * @return ArrayIterator + */ + #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->toArray()); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Util.php b/htdocs/includes/stripe/stripe-php/lib/Util/Util.php index 4f390500a8d..9ebc413cac0 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Util.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Util.php @@ -74,7 +74,7 @@ abstract class Util public static function utf8($value) { if (null === self::$isMbstringAvailable) { - self::$isMbstringAvailable = \function_exists('mb_detect_encoding'); + self::$isMbstringAvailable = \function_exists('mb_detect_encoding') && \function_exists('mb_convert_encoding'); if (!self::$isMbstringAvailable) { \trigger_error('It looks like the mbstring extension is not enabled. ' . @@ -85,7 +85,7 @@ abstract class Util } if (\is_string($value) && self::$isMbstringAvailable && 'UTF-8' !== \mb_detect_encoding($value, 'UTF-8', true)) { - return \utf8_encode($value); + return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); } return $value; diff --git a/htdocs/includes/stripe/stripe-php/lib/WebhookEndpoint.php b/htdocs/includes/stripe/stripe-php/lib/WebhookEndpoint.php index 96333d1324f..5f0e16ad05a 100644 --- a/htdocs/includes/stripe/stripe-php/lib/WebhookEndpoint.php +++ b/htdocs/includes/stripe/stripe-php/lib/WebhookEndpoint.php @@ -25,7 +25,7 @@ namespace Stripe; * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. + * @property null|string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. * @property string $status The status of the webhook. It can be enabled or disabled. * @property string $url The URL of the webhook endpoint. */ diff --git a/htdocs/includes/stripe/stripe-php/phpdoc.dist.xml b/htdocs/includes/stripe/stripe-php/phpdoc.dist.xml deleted file mode 100644 index b1ea92fadc4..00000000000 --- a/htdocs/includes/stripe/stripe-php/phpdoc.dist.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - build/phpdoc - - - latest - - - lib - - api - - - php - - stripe-php - - -