From 52c6cb29da78d84183548bdb20e9e642fbb80e88 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 22 Dec 2022 11:34:45 -0800 Subject: [PATCH 1/9] Codegen for openapi v216 (#1413) --- OPENAPI_VERSION | 2 +- lib/Checkout/Session.php | 2 +- lib/SubscriptionSchedule.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index de4ec3f3b..a75e729f5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v214 \ No newline at end of file +v216 \ No newline at end of file diff --git a/lib/Checkout/Session.php b/lib/Checkout/Session.php index 75382129c..f2efa5983 100644 --- a/lib/Checkout/Session.php +++ b/lib/Checkout/Session.php @@ -31,7 +31,7 @@ * @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 $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. diff --git a/lib/SubscriptionSchedule.php b/lib/SubscriptionSchedule.php index c1d4ce02f..cc0011703 100644 --- a/lib/SubscriptionSchedule.php +++ b/lib/SubscriptionSchedule.php @@ -21,7 +21,7 @@ * @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. From 417d66a5b27a5ec53a706a346b05bfe170043d52 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Thu, 22 Dec 2022 14:07:30 -0600 Subject: [PATCH 2/9] Bump version to 10.3.0 --- CHANGELOG.md | 4 ++++ VERSION | 2 +- lib/Stripe.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da38fab3b..8358f20a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 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` diff --git a/VERSION b/VERSION index 2bd6f7e39..0719d8102 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.2.0 +10.3.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index 31e5e18ee..aa5236a2a 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.2.0'; + const VERSION = '10.3.0'; /** * @return string the API key used for requests From 624d3215be379f0646a6be8a09f0f527793133fe Mon Sep 17 00:00:00 2001 From: Annie Li Date: Tue, 3 Jan 2023 11:16:44 -0800 Subject: [PATCH 3/9] Switch to mb_convert_encoding to fix utf8_encode deprecation warning --- lib/Util/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util/Util.php b/lib/Util/Util.php index 4f390500a..4cf77eb61 100644 --- a/lib/Util/Util.php +++ b/lib/Util/Util.php @@ -85,7 +85,7 @@ public static function utf8($value) } 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', mb_list_encodings()); } return $value; From 1b01c6574ed339617b04b748aeb959ea2cc265eb Mon Sep 17 00:00:00 2001 From: Annie Li Date: Tue, 3 Jan 2023 12:38:25 -0800 Subject: [PATCH 4/9] Go back to converting from Latin-1 --- lib/Util/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util/Util.php b/lib/Util/Util.php index 4cf77eb61..b1d6643cc 100644 --- a/lib/Util/Util.php +++ b/lib/Util/Util.php @@ -85,7 +85,7 @@ public static function utf8($value) } if (\is_string($value) && self::$isMbstringAvailable && 'UTF-8' !== \mb_detect_encoding($value, 'UTF-8', true)) { - return mb_convert_encoding($value, 'UTF-8', mb_list_encodings()); + return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'); } return $value; From 66eede1d26b26c97f5dfa123d8c4f33f5e37934d Mon Sep 17 00:00:00 2001 From: Annie Li Date: Tue, 3 Jan 2023 13:22:27 -0800 Subject: [PATCH 5/9] Make sure mb_convert_encoding also exists --- lib/Util/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util/Util.php b/lib/Util/Util.php index b1d6643cc..9ebc413ca 100644 --- a/lib/Util/Util.php +++ b/lib/Util/Util.php @@ -74,7 +74,7 @@ public static function convertToStripeObject($resp, $opts) 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. ' . From c6a51ff2c3e95da8b8721a7ff968124180a4e015 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 5 Jan 2023 11:43:40 -0800 Subject: [PATCH 6/9] Set version to 10.3.0 to simplify merge --- VERSION | 2 +- lib/Stripe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f2d82b25b..0719d8102 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.4.0-beta.1 +10.3.0 diff --git a/lib/Stripe.php b/lib/Stripe.php index fd13d2e2b..aa5236a2a 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.4.0-beta.1'; + const VERSION = '10.3.0'; /** * @return string the API key used for requests From 1de477d5879b1b708ee5dba8c16c34b8e4e99848 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 5 Jan 2023 11:43:40 -0800 Subject: [PATCH 7/9] Reset version to 10.4.0-beta.1 --- VERSION | 2 +- lib/Stripe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 0719d8102..f2d82b25b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.3.0 +10.4.0-beta.1 diff --git a/lib/Stripe.php b/lib/Stripe.php index aa5236a2a..fd13d2e2b 100644 --- a/lib/Stripe.php +++ b/lib/Stripe.php @@ -58,7 +58,7 @@ class Stripe /** @var float Initial delay between retries, in seconds */ private static $initialNetworkRetryDelay = 0.5; - const VERSION = '10.3.0'; + const VERSION = '10.4.0-beta.1'; /** * @return string the API key used for requests From 1090f01d0f831a8a4e0da6ea7e165efca9999485 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 5 Jan 2023 11:43:51 -0800 Subject: [PATCH 8/9] Codegen for openapi v217 --- OPENAPI_VERSION | 2 +- init.php | 1 - lib/Account.php | 8 +- lib/AccountLink.php | 1 - lib/AccountSession.php | 1 - lib/ApplePayDomain.php | 1 - lib/ApplicationFee.php | 2 +- lib/ApplicationFeeRefund.php | 2 +- lib/Apps/Secret.php | 1 - lib/Balance.php | 1 - lib/BalanceTransaction.php | 1 - lib/BankAccount.php | 1 - lib/BillingPortal/Configuration.php | 1 - lib/BillingPortal/Session.php | 1 - lib/Capability.php | 1 - lib/Capital/FinancingOffer.php | 1 - lib/Capital/FinancingSummary.php | 1 - lib/Capital/FinancingTransaction.php | 1 - lib/Card.php | 1 - lib/CashBalance.php | 2 +- lib/Charge.php | 2 - lib/Checkout/Session.php | 1 - lib/CountrySpec.php | 1 - lib/Coupon.php | 1 - lib/CreditNote.php | 2 +- lib/CreditNoteLineItem.php | 2 +- lib/Customer.php | 6 +- lib/CustomerBalanceTransaction.php | 2 +- lib/CustomerCashBalanceTransaction.php | 1 - lib/Dispute.php | 1 - lib/EphemeralKey.php | 5 +- lib/Event.php | 1 - lib/ExchangeRate.php | 1 - lib/File.php | 1 - lib/FileLink.php | 1 - lib/FinancialConnections/Account.php | 1 - lib/FinancialConnections/AccountOwner.php | 2 +- lib/FinancialConnections/AccountOwnership.php | 2 +- lib/FinancialConnections/Session.php | 1 - lib/FundingInstructions.php | 4 +- lib/GiftCards/Card.php | 1 - lib/GiftCards/Transaction.php | 1 - lib/Identity/VerificationReport.php | 1 - lib/Identity/VerificationSession.php | 1 - lib/Invoice.php | 3 +- lib/InvoiceItem.php | 1 - lib/InvoiceLineItem.php | 2 +- lib/Issuing/Authorization.php | 1 - lib/Issuing/Card.php | 1 - lib/Issuing/Cardholder.php | 1 - lib/Issuing/Dispute.php | 1 - lib/Issuing/Transaction.php | 1 - lib/LineItem.php | 2 +- lib/LoginLink.php | 2 +- lib/Mandate.php | 1 - lib/Order.php | 1 - lib/PaymentIntent.php | 4 +- lib/PaymentLink.php | 1 - lib/PaymentMethod.php | 1 - lib/Payout.php | 1 - lib/Person.php | 1 - lib/Plan.php | 1 - lib/Price.php | 2 - lib/Product.php | 4 +- lib/PromotionCode.php | 1 - lib/Quote.php | 18 +- lib/QuotePhase.php | 1 - lib/Radar/EarlyFraudWarning.php | 1 - lib/Radar/ValueList.php | 1 - lib/Radar/ValueListItem.php | 1 - lib/Refund.php | 1 - lib/Reporting/ReportRun.php | 1 - lib/Reporting/ReportType.php | 1 - lib/Review.php | 1 - lib/Service/AccountLinkService.php | 1 - lib/Service/AccountService.php | 1 - lib/Service/AccountSessionService.php | 1 - lib/Service/ApplePayDomainService.php | 1 - lib/Service/ApplicationFeeService.php | 1 - lib/Service/Apps/AppsServiceFactory.php | 3 +- lib/Service/Apps/SecretService.php | 1 - lib/Service/BalanceService.php | 1 - lib/Service/BalanceTransactionService.php | 1 - .../BillingPortalServiceFactory.php | 5 +- .../BillingPortal/ConfigurationService.php | 3 +- lib/Service/BillingPortal/SessionService.php | 1 - lib/Service/Capital/CapitalServiceFactory.php | 7 +- lib/Service/Capital/FinancingOfferService.php | 3 +- .../Capital/FinancingSummaryService.php | 1 - .../Capital/FinancingTransactionService.php | 1 - lib/Service/ChargeService.php | 1 - .../Checkout/CheckoutServiceFactory.php | 3 +- lib/Service/Checkout/SessionService.php | 3 +- lib/Service/CoreServiceFactory.php | 127 +- lib/Service/CountrySpecService.php | 1 - lib/Service/CouponService.php | 1 - lib/Service/CreditNoteService.php | 3 +- lib/Service/CustomerService.php | 3 +- lib/Service/DisputeService.php | 1 - lib/Service/EphemeralKeyService.php | 1 - lib/Service/EventService.php | 1 - lib/Service/ExchangeRateService.php | 1 - lib/Service/FileLinkService.php | 1 - lib/Service/FileService.php | 1 - .../FinancialConnections/AccountService.php | 3 +- .../FinancialConnectionsServiceFactory.php | 5 +- .../FinancialConnections/SessionService.php | 3 +- lib/Service/GiftCards/CardService.php | 7 +- .../GiftCards/GiftCardsServiceFactory.php | 5 +- lib/Service/GiftCards/TransactionService.php | 11 +- .../Identity/IdentityServiceFactory.php | 5 +- .../Identity/VerificationReportService.php | 3 +- .../Identity/VerificationSessionService.php | 3 +- lib/Service/InvoiceItemService.php | 1 - lib/Service/InvoiceService.php | 1 - lib/Service/Issuing/AuthorizationService.php | 1 - lib/Service/Issuing/CardService.php | 1 - lib/Service/Issuing/CardholderService.php | 1 - lib/Service/Issuing/DisputeService.php | 1 - lib/Service/Issuing/IssuingServiceFactory.php | 11 +- lib/Service/Issuing/TransactionService.php | 1 - lib/Service/MandateService.php | 1 - lib/Service/OrderService.php | 1 - lib/Service/PaymentIntentService.php | 1 - lib/Service/PaymentLinkService.php | 1 - lib/Service/PaymentMethodService.php | 3 +- lib/Service/PayoutService.php | 1 - lib/Service/PlanService.php | 1 - lib/Service/PriceService.php | 1 - lib/Service/ProductService.php | 1 - lib/Service/PromotionCodeService.php | 1 - lib/Service/QuotePhaseService.php | 1 - lib/Service/QuoteService.php | 29 +- .../Radar/EarlyFraudWarningService.php | 1 - lib/Service/Radar/RadarServiceFactory.php | 7 +- lib/Service/Radar/ValueListItemService.php | 1 - lib/Service/Radar/ValueListService.php | 1 - lib/Service/RefundService.php | 1 - lib/Service/Reporting/ReportRunService.php | 3 +- lib/Service/Reporting/ReportTypeService.php | 3 +- .../Reporting/ReportingServiceFactory.php | 5 +- lib/Service/ReviewService.php | 1 - lib/Service/SetupAttemptService.php | 1 - lib/Service/SetupIntentService.php | 1 - lib/Service/ShippingRateService.php | 1 - .../Sigma/ScheduledQueryRunService.php | 1 - lib/Service/Sigma/SigmaServiceFactory.php | 3 +- lib/Service/SourceService.php | 1 - lib/Service/SubscriptionItemService.php | 1 - lib/Service/SubscriptionScheduleService.php | 1 - lib/Service/SubscriptionService.php | 1 - lib/Service/Tax/CalculationService.php | 1 - lib/Service/Tax/TaxServiceFactory.php | 5 +- lib/Service/Tax/TransactionService.php | 1 - lib/Service/TaxCodeService.php | 1 - lib/Service/TaxRateService.php | 3 +- lib/Service/Terminal/ConfigurationService.php | 1 - .../Terminal/ConnectionTokenService.php | 1 - lib/Service/Terminal/LocationService.php | 1 - lib/Service/Terminal/ReaderService.php | 3 +- .../Terminal/TerminalServiceFactory.php | 9 +- lib/Service/TestHelpers/CustomerService.php | 3 +- .../TestHelpers/Issuing/CardService.php | 1 - .../Issuing/IssuingServiceFactory.php | 3 +- lib/Service/TestHelpers/RefundService.php | 1 - .../TestHelpers/Terminal/ReaderService.php | 1 - .../Terminal/TerminalServiceFactory.php | 3 +- lib/Service/TestHelpers/TestClockService.php | 1 - .../TestHelpers/TestHelpersServiceFactory.php | 13 +- .../Treasury/InboundTransferService.php | 1 - .../Treasury/OutboundPaymentService.php | 1 - .../Treasury/OutboundTransferService.php | 1 - .../Treasury/ReceivedCreditService.php | 1 - .../Treasury/ReceivedDebitService.php | 1 - .../Treasury/TreasuryServiceFactory.php | 11 +- lib/Service/TokenService.php | 1 - lib/Service/TopupService.php | 3 +- lib/Service/TransferService.php | 1 - .../Treasury/CreditReversalService.php | 3 +- lib/Service/Treasury/DebitReversalService.php | 1 - .../Treasury/FinancialAccountService.php | 1 - .../Treasury/InboundTransferService.php | 1 - .../Treasury/OutboundPaymentService.php | 1 - .../Treasury/OutboundTransferService.php | 1 - .../Treasury/ReceivedCreditService.php | 1 - lib/Service/Treasury/ReceivedDebitService.php | 3 +- .../Treasury/TransactionEntryService.php | 1 - lib/Service/Treasury/TransactionService.php | 1 - .../Treasury/TreasuryServiceFactory.php | 21 +- lib/Service/WebhookEndpointService.php | 1 - lib/SetupAttempt.php | 1 - lib/SetupIntent.php | 1 - lib/ShippingRate.php | 1 - lib/Sigma/ScheduledQueryRun.php | 1 - lib/Source.php | 1 - lib/StripeClient.php | 1 - lib/Subscription.php | 3 - lib/SubscriptionItem.php | 2 +- lib/SubscriptionSchedule.php | 1 - lib/Tax/Calculation.php | 1 - lib/Tax/Transaction.php | 1 - lib/TaxCode.php | 1 - lib/TaxId.php | 1 - lib/TaxRate.php | 1 - lib/Terminal/Configuration.php | 1 - lib/Terminal/ConnectionToken.php | 1 - lib/Terminal/Location.php | 1 - lib/Terminal/Reader.php | 1 - lib/TestHelpers/TestClock.php | 1 - lib/Token.php | 1 - lib/Topup.php | 1 - lib/Transfer.php | 2 +- lib/TransferReversal.php | 2 +- lib/Treasury/CreditReversal.php | 1 - lib/Treasury/DebitReversal.php | 1 - lib/Treasury/FinancialAccount.php | 1 - lib/Treasury/FinancialAccountFeatures.php | 2 +- lib/Treasury/InboundTransfer.php | 1 - lib/Treasury/OutboundPayment.php | 1 - lib/Treasury/OutboundTransfer.php | 1 - lib/Treasury/ReceivedCredit.php | 1 - lib/Treasury/ReceivedDebit.php | 1 - lib/Treasury/Transaction.php | 1 - lib/Treasury/TransactionEntry.php | 1 - lib/UsageRecord.php | 2 +- lib/UsageRecordSummary.php | 2 +- lib/Util/ApiVersion.php | 4 +- lib/Util/ObjectTypes.php | 240 +- lib/WebhookEndpoint.php | 1 - tests/Stripe/GeneratedExamplesTest.php | 7505 ++++++++--------- 230 files changed, 3896 insertions(+), 4458 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a75e729f5..b87b42e0c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v216 \ No newline at end of file +v217 \ No newline at end of file diff --git a/init.php b/init.php index 23cc5f941..bf79eba09 100644 --- a/init.php +++ b/init.php @@ -1,5 +1,4 @@ serializeParameters() : $v; if ([] !== $update) { - if (!$originalValue - || !\array_key_exists($i, $originalValue) - || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + if (!$originalValue || + !\array_key_exists($i, $originalValue) || + ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { $updateArr[$i] = $update; } } @@ -186,6 +185,7 @@ public function reject($params = null, $opts = null) return $this; } + const PATH_CAPABILITIES = '/capabilities'; /** diff --git a/lib/AccountLink.php b/lib/AccountLink.php index 24a9e68aa..b2d76f67e 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -1,5 +1,4 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); - return $this; } @@ -133,17 +131,16 @@ public function retrievePaymentMethod($payment_method, $params = null, $opts = n 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 * @@ -158,7 +155,6 @@ public static function retrieveCashBalance($id, $cashBalanceId, $params = null, * @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 * diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index 02cc1f4d7..9636af92c 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -1,5 +1,4 @@ financial_addresses field. Related guide: Customer - * Balance - Funding Instructions to learn more. + * 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 @@ -24,5 +23,6 @@ class FundingInstructions extends ApiResource { const OBJECT_NAME = 'funding_instructions'; + const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; } diff --git a/lib/GiftCards/Card.php b/lib/GiftCards/Card.php index 506e62985..861becc66 100644 --- a/lib/GiftCards/Card.php +++ b/lib/GiftCards/Card.php @@ -1,5 +1,4 @@ required or optional. * @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\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|\Stripe\BankAccount|\Stripe\Card|\Stripe\Account|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. @@ -193,7 +192,6 @@ public function verifyMicrodeposits($params = null, $opts = null) public static function search($params = null, $opts = null) { $url = '/v1/payment_intents/search'; - return self::_searchResource($url, $params, $opts); } } diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 5c3462e69..7d25b6e3f 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -1,5 +1,4 @@ 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. */ @@ -68,7 +67,6 @@ class Product extends ApiResource public static function search($params = null, $opts = null) { $url = '/v1/products/search'; - return self::_searchResource($url, $params, $opts); } } diff --git a/lib/PromotionCode.php b/lib/PromotionCode.php index 7eb0c4074..7b1464970 100644 --- a/lib/PromotionCode.php +++ b/lib/PromotionCode.php @@ -1,5 +1,4 @@ instanceUrl() . '/mark_stale'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param string $id * @param null|array $params diff --git a/lib/QuotePhase.php b/lib/QuotePhase.php index a518f8796..e41718bee 100644 --- a/lib/QuotePhase.php +++ b/lib/QuotePhase.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'secrets' => SecretService::class, + 'secrets' => SecretService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Apps/SecretService.php b/lib/Service/Apps/SecretService.php index 8c9c74b48..60fde5dd2 100644 --- a/lib/Service/Apps/SecretService.php +++ b/lib/Service/Apps/SecretService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'sessions' => SessionService::class, + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/BillingPortal/ConfigurationService.php b/lib/Service/BillingPortal/ConfigurationService.php index 11d1a5a3a..d0324b178 100644 --- a/lib/Service/BillingPortal/ConfigurationService.php +++ b/lib/Service/BillingPortal/ConfigurationService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'financingOffers' => FinancingOfferService::class, - 'financingSummary' => FinancingSummaryService::class, - 'financingTransactions' => FinancingTransactionService::class, + 'financingOffers' => FinancingOfferService::class, + 'financingSummary' => FinancingSummaryService::class, + 'financingTransactions' => FinancingTransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Capital/FinancingOfferService.php b/lib/Service/Capital/FinancingOfferService.php index f06f1f536..dee12fde2 100644 --- a/lib/Service/Capital/FinancingOfferService.php +++ b/lib/Service/Capital/FinancingOfferService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'sessions' => SessionService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Checkout/SessionService.php b/lib/Service/Checkout/SessionService.php index 2291ccd50..fdcb89b14 100644 --- a/lib/Service/Checkout/SessionService.php +++ b/lib/Service/Checkout/SessionService.php @@ -1,5 +1,4 @@ open. + * A Session can be expired when it is in one of these statuses: open * * After it expires, a customer can’t complete a Session and customers loading the * Session see a message saying the Session is expired. diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index bed255a11..a8644e04a 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'accountLinks' => AccountLinkService::class, - 'accounts' => AccountService::class, - 'accountSessions' => AccountSessionService::class, - 'applePayDomains' => ApplePayDomainService::class, - 'applicationFees' => ApplicationFeeService::class, - 'apps' => Apps\AppsServiceFactory::class, - 'balance' => BalanceService::class, - 'balanceTransactions' => BalanceTransactionService::class, - 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, - 'capital' => Capital\CapitalServiceFactory::class, - 'charges' => ChargeService::class, - 'checkout' => Checkout\CheckoutServiceFactory::class, - 'countrySpecs' => CountrySpecService::class, - 'coupons' => CouponService::class, - 'creditNotes' => CreditNoteService::class, - 'customers' => CustomerService::class, - 'disputes' => DisputeService::class, - 'ephemeralKeys' => EphemeralKeyService::class, - 'events' => EventService::class, - 'exchangeRates' => ExchangeRateService::class, - 'fileLinks' => FileLinkService::class, - 'files' => FileService::class, - 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, - 'giftCards' => GiftCards\GiftCardsServiceFactory::class, - 'identity' => Identity\IdentityServiceFactory::class, - 'invoiceItems' => InvoiceItemService::class, - 'invoices' => InvoiceService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'mandates' => MandateService::class, - 'oauth' => OAuthService::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, - 'quotePhases' => QuotePhaseService::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, - 'sources' => SourceService::class, - 'subscriptionItems' => SubscriptionItemService::class, - 'subscriptions' => SubscriptionService::class, - 'subscriptionSchedules' => SubscriptionScheduleService::class, - 'tax' => Tax\TaxServiceFactory::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, + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'accountSessions' => AccountSessionService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::class, + 'apps' => Apps\AppsServiceFactory::class, + 'balance' => BalanceService::class, + 'balanceTransactions' => BalanceTransactionService::class, + 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, + 'capital' => Capital\CapitalServiceFactory::class, + 'charges' => ChargeService::class, + 'checkout' => Checkout\CheckoutServiceFactory::class, + 'countrySpecs' => CountrySpecService::class, + 'coupons' => CouponService::class, + 'creditNotes' => CreditNoteService::class, + 'customers' => CustomerService::class, + 'disputes' => DisputeService::class, + 'ephemeralKeys' => EphemeralKeyService::class, + 'events' => EventService::class, + 'exchangeRates' => ExchangeRateService::class, + 'fileLinks' => FileLinkService::class, + 'files' => FileService::class, + 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, + 'giftCards' => GiftCards\GiftCardsServiceFactory::class, + 'identity' => Identity\IdentityServiceFactory::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::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, + 'quotePhases' => QuotePhaseService::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, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'tax' => Tax\TaxServiceFactory::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, ]; protected function getServiceClass($name) diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php index 8f3869fee..14499b6c7 100644 --- a/lib/Service/CountrySpecService.php +++ b/lib/Service/CountrySpecService.php @@ -1,5 +1,4 @@ status=open invoice, a credit note reduces its * amount_due. For a status=paid invoice, a credit note * does not affect its amount_due. Instead, it can result in any - * combination of the following:. + * combination of the following: * *
  • Refund: create a new refund (using refund_amount) or link * an existing refund (using refund).
  • Customer balance diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php index 5cb7910a2..c5aefb8e0 100644 --- a/lib/Service/CustomerService.php +++ b/lib/Service/CustomerService.php @@ -1,5 +1,4 @@ Account. + * Lists all owners for a given Account * * @param string $id * @param null|array $params diff --git a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php index 7dd826341..b7aefa9d9 100644 --- a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php +++ b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'accounts' => AccountService::class, - 'sessions' => SessionService::class, + 'accounts' => AccountService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/FinancialConnections/SessionService.php b/lib/Service/FinancialConnections/SessionService.php index eab589cda..58a311ae3 100644 --- a/lib/Service/FinancialConnections/SessionService.php +++ b/lib/Service/FinancialConnections/SessionService.php @@ -1,5 +1,4 @@ Session. + * Retrieves the details of a Financial Connections Session * * @param string $id * @param null|array $params diff --git a/lib/Service/GiftCards/CardService.php b/lib/Service/GiftCards/CardService.php index e2e0b1fa2..a9b224d92 100644 --- a/lib/Service/GiftCards/CardService.php +++ b/lib/Service/GiftCards/CardService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'cards' => CardService::class, - 'transactions' => TransactionService::class, + 'cards' => CardService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/GiftCards/TransactionService.php b/lib/Service/GiftCards/TransactionService.php index 8891799f0..58e6e5688 100644 --- a/lib/Service/GiftCards/TransactionService.php +++ b/lib/Service/GiftCards/TransactionService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'verificationReports' => VerificationReportService::class, - 'verificationSessions' => VerificationSessionService::class, + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Identity/VerificationReportService.php b/lib/Service/Identity/VerificationReportService.php index 9289d9dfd..83e96e584 100644 --- a/lib/Service/Identity/VerificationReportService.php +++ b/lib/Service/Identity/VerificationReportService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'authorizations' => AuthorizationService::class, - 'cardholders' => CardholderService::class, - 'cards' => CardService::class, - 'disputes' => DisputeService::class, - 'transactions' => TransactionService::class, + 'authorizations' => AuthorizationService::class, + 'cardholders' => CardholderService::class, + 'cards' => CardService::class, + 'disputes' => DisputeService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Issuing/TransactionService.php b/lib/Service/Issuing/TransactionService.php index dd83b1820..44476aa4b 100644 --- a/lib/Service/Issuing/TransactionService.php +++ b/lib/Service/Issuing/TransactionService.php @@ -1,5 +1,4 @@ Retrieve a Customer’s - * PaymentMethods. + * PaymentMethods * * @param string $id * @param null|array $params diff --git a/lib/Service/PayoutService.php b/lib/Service/PayoutService.php index 4ca3561c8..112f2b003 100644 --- a/lib/Service/PayoutService.php +++ b/lib/Service/PayoutService.php @@ -1,5 +1,4 @@ request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts); } + /** + * Converts a draft or open quote to stale. + * + * @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 markStaleQuote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_stale', $id), $params, $opts); + } + /** * Preview the invoice line items that would be generated by accepting the quote. * @@ -191,7 +206,7 @@ public function previewInvoices($id, $params = null, $opts = null) } /** - * Preview the schedules that would be generated by accepting the quote. + * Preview the schedules that would be generated by accepting the quote * * @param string $id * @param null|array $params @@ -266,10 +281,10 @@ public function update($id, $params = null, $opts = null) */ 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); + $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/lib/Service/Radar/EarlyFraudWarningService.php b/lib/Service/Radar/EarlyFraudWarningService.php index be119b4c8..c5849c4b5 100644 --- a/lib/Service/Radar/EarlyFraudWarningService.php +++ b/lib/Service/Radar/EarlyFraudWarningService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'earlyFraudWarnings' => EarlyFraudWarningService::class, - 'valueListItems' => ValueListItemService::class, - 'valueLists' => ValueListService::class, + 'earlyFraudWarnings' => EarlyFraudWarningService::class, + 'valueListItems' => ValueListItemService::class, + 'valueLists' => ValueListService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Radar/ValueListItemService.php b/lib/Service/Radar/ValueListItemService.php index b9da3dd8b..5b849a548 100644 --- a/lib/Service/Radar/ValueListItemService.php +++ b/lib/Service/Radar/ValueListItemService.php @@ -1,5 +1,4 @@ live-mode API key.). + * a live-mode API key.) * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts diff --git a/lib/Service/Reporting/ReportTypeService.php b/lib/Service/Reporting/ReportTypeService.php index 7fa503821..695ad6544 100644 --- a/lib/Service/Reporting/ReportTypeService.php +++ b/lib/Service/Reporting/ReportTypeService.php @@ -1,5 +1,4 @@ live-mode API key.). + * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key.) * * @param string $id * @param null|array $params diff --git a/lib/Service/Reporting/ReportingServiceFactory.php b/lib/Service/Reporting/ReportingServiceFactory.php index 7832e9175..dbf22098f 100644 --- a/lib/Service/Reporting/ReportingServiceFactory.php +++ b/lib/Service/Reporting/ReportingServiceFactory.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'reportRuns' => ReportRunService::class, - 'reportTypes' => ReportTypeService::class, + 'reportRuns' => ReportRunService::class, + 'reportTypes' => ReportTypeService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/ReviewService.php b/lib/Service/ReviewService.php index 3bcd325b6..b42fd04fa 100644 --- a/lib/Service/ReviewService.php +++ b/lib/Service/ReviewService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'scheduledQueryRuns' => ScheduledQueryRunService::class, + 'scheduledQueryRuns' => ScheduledQueryRunService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/SourceService.php b/lib/Service/SourceService.php index b55717883..960930d38 100644 --- a/lib/Service/SourceService.php +++ b/lib/Service/SourceService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'calculations' => CalculationService::class, - 'transactions' => TransactionService::class, + 'calculations' => CalculationService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Tax/TransactionService.php b/lib/Service/Tax/TransactionService.php index 15bd26ae1..384d34d9d 100644 --- a/lib/Service/Tax/TransactionService.php +++ b/lib/Service/Tax/TransactionService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'connectionTokens' => ConnectionTokenService::class, - 'locations' => LocationService::class, - 'readers' => ReaderService::class, + 'configurations' => ConfigurationService::class, + 'connectionTokens' => ConnectionTokenService::class, + 'locations' => LocationService::class, + 'readers' => ReaderService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/CustomerService.php b/lib/Service/TestHelpers/CustomerService.php index c46b57975..2a41070a0 100644 --- a/lib/Service/TestHelpers/CustomerService.php +++ b/lib/Service/TestHelpers/CustomerService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'cards' => CardService::class, + 'cards' => CardService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/RefundService.php b/lib/Service/TestHelpers/RefundService.php index de0e4d10b..433072f4b 100644 --- a/lib/Service/TestHelpers/RefundService.php +++ b/lib/Service/TestHelpers/RefundService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'readers' => ReaderService::class, + 'readers' => ReaderService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/TestClockService.php b/lib/Service/TestHelpers/TestClockService.php index a4eee8c3e..22c75e7d9 100644 --- a/lib/Service/TestHelpers/TestClockService.php +++ b/lib/Service/TestHelpers/TestClockService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'customers' => CustomerService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'refunds' => RefundService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'testClocks' => TestClockService::class, - 'treasury' => Treasury\TreasuryServiceFactory::class, + '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) diff --git a/lib/Service/TestHelpers/Treasury/InboundTransferService.php b/lib/Service/TestHelpers/Treasury/InboundTransferService.php index 1c8247625..51a573d21 100644 --- a/lib/Service/TestHelpers/Treasury/InboundTransferService.php +++ b/lib/Service/TestHelpers/Treasury/InboundTransferService.php @@ -1,5 +1,4 @@ */ private static $classMap = [ - 'inboundTransfers' => InboundTransferService::class, - 'outboundPayments' => OutboundPaymentService::class, - 'outboundTransfers' => OutboundTransferService::class, - 'receivedCredits' => ReceivedCreditService::class, - 'receivedDebits' => ReceivedDebitService::class, + 'inboundTransfers' => InboundTransferService::class, + 'outboundPayments' => OutboundPaymentService::class, + 'outboundTransfers' => OutboundTransferService::class, + 'receivedCredits' => ReceivedCreditService::class, + 'receivedDebits' => ReceivedDebitService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php index 1c72759f6..73131cb9b 100644 --- a/lib/Service/TokenService.php +++ b/lib/Service/TokenService.php @@ -1,5 +1,4 @@ */ 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, + '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) diff --git a/lib/Service/WebhookEndpointService.php b/lib/Service/WebhookEndpointService.php index baa15bd24..9d4ade954 100644 --- a/lib/Service/WebhookEndpointService.php +++ b/lib/Service/WebhookEndpointService.php @@ -1,5 +1,4 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); - return $this; } @@ -143,7 +141,6 @@ public function cancel($params = null, $opts = null) public static function search($params = null, $opts = null) { $url = '/v1/subscriptions/search'; - return self::_searchResource($url, $params, $opts); } } diff --git a/lib/SubscriptionItem.php b/lib/SubscriptionItem.php index 6b57588db..6c39f6f62 100644 --- a/lib/SubscriptionItem.php +++ b/lib/SubscriptionItem.php @@ -1,5 +1,4 @@ \Stripe\Account::class, - \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, - \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::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\Capability::OBJECT_NAME => \Stripe\Capability::class, - \Stripe\Capital\FinancingOffer::OBJECT_NAME => \Stripe\Capital\FinancingOffer::class, - \Stripe\Capital\FinancingSummary::OBJECT_NAME => \Stripe\Capital\FinancingSummary::class, - \Stripe\Capital\FinancingTransaction::OBJECT_NAME => \Stripe\Capital\FinancingTransaction::class, - \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, - \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, - \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, - \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, - \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, - \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, - \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, - \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, - \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, - \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, - \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, - \Stripe\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, - \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, - \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, - \Stripe\File::OBJECT_NAME => \Stripe\File::class, - \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, - \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, - \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, - \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, - \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, - \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, - \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, - \Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class, - \Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class, - \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, - \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, - \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, - \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, - \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, - \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, - \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, - \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, - \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, - \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, - \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, - \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, - \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, - \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, - \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, - \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, - \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, - \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, - \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, - \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, - \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, - \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, - \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, - \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, - \Stripe\QuotePhase::OBJECT_NAME => \Stripe\QuotePhase::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\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\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\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class, - \Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class, - \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, - \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, - \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, - \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, - \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, - \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, - \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, - \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, - \Stripe\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, - ]; + /** + * @var array Mapping from object types to resource classes + */ + const mapping = [ + \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::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\Capability::OBJECT_NAME => \Stripe\Capability::class, + \Stripe\Capital\FinancingOffer::OBJECT_NAME => \Stripe\Capital\FinancingOffer::class, + \Stripe\Capital\FinancingSummary::OBJECT_NAME => \Stripe\Capital\FinancingSummary::class, + \Stripe\Capital\FinancingTransaction::OBJECT_NAME => \Stripe\Capital\FinancingTransaction::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, + \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\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, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, + \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, + \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, + \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, + \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, + \Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class, + \Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class, + \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, + \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, + \Stripe\QuotePhase::OBJECT_NAME => \Stripe\QuotePhase::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\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\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\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class, + \Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class, + \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, + \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, + \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, + \Stripe\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/lib/WebhookEndpoint.php b/lib/WebhookEndpoint.php index 96333d132..1862f05e0 100644 --- a/lib/WebhookEndpoint.php +++ b/lib/WebhookEndpoint.php @@ -1,5 +1,4 @@ client = new \Stripe\StripeClient(['api_key' => 'sk_test_123', 'api_base' => MOCK_URL]); - } - - public function testListSecret() - { - $this->expectsRequest('get', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->all( - ['scope' => ['type' => 'account'], 'limit' => 2] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result->data[0]); - } - - public function testCreateSecret() - { - $this->expectsRequest('post', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->create( - [ - 'name' => 'sec_123', - 'payload' => 'very secret string', - 'scope' => ['type' => 'account'], - ] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - - public function testDeleteWhereSecret() - { - $this->expectsRequest('post', '/v1/apps/secrets/delete'); - $result = $this->client->apps->secrets->deleteWhere( - ['name' => 'my-api-key', 'scope' => ['type' => 'account']] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - - public function testFindSecret() - { - $this->expectsRequest('get', '/v1/apps/secrets/find'); - $result = $this->client->apps->secrets->find( - ['name' => 'sec_123', 'scope' => ['type' => 'account']] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - - public function testCreateSession() - { - $this->expectsRequest('post', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->create( - [ - 'success_url' => 'https://example.com/success', - 'cancel_url' => 'https://example.com/cancel', - 'mode' => 'payment', - 'shipping_options' => [ - ['shipping_rate' => 'shr_standard'], - [ - 'shipping_rate_data' => [ - 'display_name' => 'Standard', - 'delivery_estimate' => [ - 'minimum' => ['unit' => 'day', 'value' => 5], - 'maximum' => ['unit' => 'day', 'value' => 7], - ], - ], - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - - public function testExpireSession() - { - $this->expectsRequest('post', '/v1/checkout/sessions/sess_xyz/expire'); - $result = $this->client->checkout->sessions->expire('sess_xyz', []); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - - public function testListLineItemsSession() - { - $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); - $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); - } - - public function testRetrieveCashBalance() - { - $this->expectsRequest('get', '/v1/customers/cus_123/cash_balance'); - $result = $this->client->customers->retrieveCashBalance('cus_123', []); - static::assertInstanceOf(\Stripe\CashBalance::class, $result); - } - - public function testUpdateCashBalance() - { - $this->expectsRequest('post', '/v1/customers/cus_123/cash_balance'); - $result = $this->client->customers->updateCashBalance( - 'cus_123', - ['settings' => ['reconciliation_mode' => 'manual']] - ); - static::assertInstanceOf(\Stripe\CashBalance::class, $result); - } - - public function testCreateFundingInstructionsCustomer() - { - $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); - $result = $this->client->customers->createFundingInstructions( - 'cus_123', - [ - 'bank_transfer' => [ - 'requested_address_types' => ['zengin'], - 'type' => 'jp_bank_transfer', - ], - 'currency' => 'usd', - 'funding_type' => 'bank_transfer', - ] - ); - static::assertInstanceOf(\Stripe\FundingInstructions::class, $result); - } - - public function testListAccount() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts'); - $result = $this->client->financialConnections->accounts->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); - } - - public function testRetrieveAccount() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); - $result = $this->client->financialConnections->accounts->retrieve( - 'fca_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - - public function testDisconnectAccount() - { - $this->expectsRequest( - 'post', - '/v1/financial_connections/accounts/fca_xyz/disconnect' - ); - $result = $this->client->financialConnections->accounts->disconnect( - 'fca_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - - public function testListOwnersAccount() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xyz/owners' - ); - $result = $this->client->financialConnections->accounts->allOwners( - 'fca_xyz', - ['ownership' => 'fcaowns_xyz'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); - } - - public function testRefreshAccount() - { - $this->expectsRequest( - 'post', - '/v1/financial_connections/accounts/fca_xyz/refresh' - ); - $result = $this->client->financialConnections->accounts->refresh( - 'fca_xyz', - ['features' => ['balance']] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - - public function testCreateSession2() - { - $this->expectsRequest('post', '/v1/financial_connections/sessions'); - $result = $this->client->financialConnections->sessions->create( - [ - 'account_holder' => ['type' => 'customer', 'customer' => 'cus_123'], - 'permissions' => ['balances'], - ] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - - public function testRetrieveSession() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/sessions/fcsess_xyz' - ); - $result = $this->client->financialConnections->sessions->retrieve( - 'fcsess_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - - public function testUpcomingInvoice() - { - $this->expectsRequest('get', '/v1/invoices/upcoming'); - $result = $this->client->invoices->upcoming( - ['customer' => 'cus_9utnxg47pWjV1e'] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testCreatePaymentIntent() - { - $this->expectsRequest('post', '/v1/payment_intents'); - $result = $this->client->paymentIntents->create( - [ - 'amount' => 1099, - 'currency' => 'eur', - 'automatic_payment_methods' => ['enabled' => true], - ] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testVerifyMicrodepositsPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits' - ); - $result = $this->client->paymentIntents->verifyMicrodeposits( - 'pi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testCreatePaymentLink() - { - $this->expectsRequest('post', '/v1/payment_links'); - $result = $this->client->paymentLinks->create( - ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - - public function testRetrievePaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links/pl_xyz'); - $result = $this->client->paymentLinks->retrieve('pl_xyz', []); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - - public function testListLineItemsPaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links/pl_xyz/line_items'); - $result = $this->client->paymentLinks->allLineItems('pl_xyz', []); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); - } - - public function testCreatePrice() - { - $this->expectsRequest('post', '/v1/prices'); - $result = $this->client->prices->create( - [ - 'unit_amount' => 2000, - 'currency' => 'usd', - 'currency_options' => [ - 'uah' => ['unit_amount' => 5000], - 'eur' => ['unit_amount' => 1800], - ], - 'recurring' => ['interval' => 'month'], - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - - public function testListSetupAttempt() - { - $this->expectsRequest('get', '/v1/setup_attempts'); - $result = $this->client->setupAttempts->all( - ['limit' => 3, 'setup_intent' => 'si_xyz'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]); - } - - public function testVerifyMicrodepositsSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits' - ); - $result = $this->client->setupIntents->verifyMicrodeposits( - 'seti_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testListShippingRate() - { - $this->expectsRequest('get', '/v1/shipping_rates'); - $result = $this->client->shippingRates->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); - } - - public function testCreateShippingRate() - { - $this->expectsRequest('post', '/v1/shipping_rates'); - $result = $this->client->shippingRates->create( - [ - 'display_name' => 'Sample Shipper', - 'fixed_amount' => ['currency' => 'usd', 'amount' => 400], - 'type' => 'fixed_amount', - ] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - - public function testListConfiguration() - { - $this->expectsRequest('get', '/v1/terminal/configurations'); - $result = $this->client->terminal->configurations->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); - } - - public function testDeleteConfiguration() - { - $this->expectsRequest('delete', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->delete('uc_123', []); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testRetrieveConfiguration() - { - $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve('uc_123', []); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testUpdateConfiguration() - { - $this->expectsRequest('post', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->update( - 'uc_123', - ['tipping' => ['usd' => ['fixed_amounts' => [10]]]] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testFundCashBalanceCustomer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/customers/cus_123/fund_cash_balance' - ); - $result = $this->client->testHelpers->customers->fundCashBalance( - 'cus_123', - ['amount' => 30, 'currency' => 'eur'] - ); - static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result); - } - - public function testDeliverCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/deliver' - ); - $result = $this->client->testHelpers->issuing->cards->deliverCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testFailCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/fail' - ); - $result = $this->client->testHelpers->issuing->cards->failCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testReturnCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/return' - ); - $result = $this->client->testHelpers->issuing->cards->returnCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testShipCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/ship' - ); - $result = $this->client->testHelpers->issuing->cards->shipCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testExpireRefund() - { - $this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire'); - $result = $this->client->testHelpers->refunds->expire('re_123', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - - public function testListTestClock() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); - } - - public function testCreateTestClock() - { - $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->create( - ['frozen_time' => 123, 'name' => 'cogsworth'] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testDeleteTestClock() - { - $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testRetrieveTestClock() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testAdvanceTestClock() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/test_clocks/clock_xyz/advance' - ); - $result = $this->client->testHelpers->testClocks->advance( - 'clock_xyz', - ['frozen_time' => 142] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testFailInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->fail( - 'ibt_123', - ['failure_details' => ['code' => 'account_closed']] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testReturnInboundTransferInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/return' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->returnInboundTransfer( - 'ibt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testSucceedInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->succeed( - 'ibt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testFailOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/fail' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->fail( - 'obt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testPostOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/post' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->post( - 'obt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testReturnOutboundTransferOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/return' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->returnOutboundTransfer( - 'obt_123', - ['returned_details' => ['code' => 'account_closed']] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testCreateReceivedCredit() - { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); - $result = $this->client->testHelpers->treasury->receivedCredits->create( - [ - 'financial_account' => 'fa_123', - 'network' => 'ach', - 'amount' => 1234, - 'currency' => 'usd', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); - } - - public function testCreateReceivedDebit() - { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); - $result = $this->client->testHelpers->treasury->receivedDebits->create( - [ - 'financial_account' => 'fa_123', - 'network' => 'ach', - 'amount' => 1234, - 'currency' => 'usd', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); - } - - public function testCreateToken() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'card' => [ - 'number' => '4242424242424242', - 'exp_month' => '5', - 'exp_year' => '2023', - 'cvc' => '314', - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testCreateAccountLink() - { - $this->expectsRequest('post', '/v1/account_links'); - $result = $this->client->accountLinks->create( - [ - 'account' => 'acct_xxxxxxxxxxxxx', - 'refresh_url' => 'https://example.com/reauth', - 'return_url' => 'https://example.com/return', - 'type' => 'account_onboarding', - ] - ); - static::assertInstanceOf(\Stripe\AccountLink::class, $result); - } - - public function testListAccount2() - { - $this->expectsRequest('get', '/v1/accounts'); - $result = $this->client->accounts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Account::class, $result->data[0]); - } - - public function testCreateAccount() - { - $this->expectsRequest('post', '/v1/accounts'); - $result = $this->client->accounts->create( - [ - 'type' => 'custom', - 'country' => 'US', - 'email' => 'jenny.rosen@example.com', - 'capabilities' => [ - 'card_payments' => ['requested' => true], - 'transfers' => ['requested' => true], - ], - ] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - - public function testDeleteAccount() - { - $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - - public function testRetrieveAccount2() - { - $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->retrieve('acct_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - - public function testUpdateAccount() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->update( - 'acct_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - - public function testRejectAccount() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/reject'); - $result = $this->client->accounts->reject( - 'acct_xxxxxxxxxxxxx', - ['reason' => 'fraud'] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - - public function testListCapability() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities' - ); - $result = $this->client->accounts->allCapabilities( - 'acct_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Capability::class, $result->data[0]); - } - - public function testRetrieveCapability() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' - ); - $result = $this->client->accounts->retrieveCapability( - 'acct_xxxxxxxxxxxxx', - 'card_payments', - [] - ); - static::assertInstanceOf(\Stripe\Capability::class, $result); - } - - public function testUpdateCapability() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' - ); - $result = $this->client->accounts->updateCapability( - 'acct_xxxxxxxxxxxxx', - 'card_payments', - ['requested' => true] - ); - static::assertInstanceOf(\Stripe\Capability::class, $result); - } - - public function testCreateLoginLink() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/login_links' - ); - $result = $this->client->accounts->createLoginLink( - 'acct_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\LoginLink::class, $result); - } - - public function testListPerson() - { - $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); - $result = $this->client->accounts->allPersons( - 'acct_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Person::class, $result->data[0]); - } - - public function testCreatePerson() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); - $result = $this->client->accounts->createPerson( - 'acct_xxxxxxxxxxxxx', - ['first_name' => 'Jane', 'last_name' => 'Diaz'] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - - public function testDeletePerson() - { - $this->expectsRequest( - 'delete', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->deletePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - - public function testRetrievePerson() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->retrievePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - - public function testUpdatePerson() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->updatePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - - public function testListApplicationFee() - { - $this->expectsRequest('get', '/v1/application_fees'); - $result = $this->client->applicationFees->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ApplicationFee::class, $result->data[0]); - } - - public function testRetrieveApplicationFee() - { - $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); - } - - public function testListApplicationFeeRefund() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' - ); - $result = $this->client->applicationFees->allRefunds( - 'fee_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result->data[0]); - } - - public function testCreateApplicationFeeRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' - ); - $result = $this->client->applicationFees->createRefund( - 'fee_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - - public function testRetrieveApplicationFeeRefund() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' - ); - $result = $this->client->applicationFees->retrieveRefund( - 'fee_xxxxxxxxxxxxx', - 'fr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - - public function testUpdateApplicationFeeRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' - ); - $result = $this->client->applicationFees->updateRefund( - 'fee_xxxxxxxxxxxxx', - 'fr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - - public function testCreateSecret2() - { - $this->expectsRequest('post', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->create( - [ - 'name' => 'my-api-key', - 'payload' => 'secret_key_xxxxxx', - 'scope' => ['type' => 'account'], - ] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - - public function testListBalanceTransaction() - { - $this->expectsRequest('get', '/v1/balance_transactions'); - $result = $this->client->balanceTransactions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result->data[0]); - } - - public function testRetrieveBalanceTransaction() - { - $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); - $result = $this->client->balanceTransactions->retrieve( - 'txn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result); - } - - public function testListConfiguration2() - { - $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); - } - - public function testRetrieveConfiguration2() - { - $this->expectsRequest( - 'get', - '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' - ); - $result = $this->client->billingPortal->configurations->retrieve( - 'bpc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); - } - - public function testUpdateConfiguration2() - { - $this->expectsRequest( - 'post', - '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' - ); - $result = $this->client->billingPortal->configurations->update( - 'bpc_xxxxxxxxxxxxx', - [ - 'business_profile' => [ - 'privacy_policy_url' => 'https://example.com/privacy', - 'terms_of_service_url' => 'https://example.com/terms', - ], - ] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); - } - - public function testCreateSession3() - { - $this->expectsRequest('post', '/v1/billing_portal/sessions'); - $result = $this->client->billingPortal->sessions->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'return_url' => 'https://example.com/account', - ] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Session::class, $result); - } - - public function testListCharge() - { - $this->expectsRequest('get', '/v1/charges'); - $result = $this->client->charges->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); - } - - public function testCreateCharge() - { - $this->expectsRequest('post', '/v1/charges'); - $result = $this->client->charges->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'source' => 'tok_xxxx', - 'description' => 'My First Test Charge (created for API docs)', - ] - ); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - - public function testRetrieveCharge() - { - $this->expectsRequest('get', '/v1/charges/ch_xxxxxxxxxxxxx'); - $result = $this->client->charges->retrieve('ch_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - - public function testUpdateCharge() - { - $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx'); - $result = $this->client->charges->update( - 'ch_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - - public function testCaptureCharge() - { - $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx/capture'); - $result = $this->client->charges->capture('ch_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - - public function testSearchCharge() - { - $this->expectsRequest('get', '/v1/charges/search'); - $result = $this->client->charges->search( - ['query' => 'amount>999 AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); - } - - public function testListSession() - { - $this->expectsRequest('get', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result->data[0]); - } - - public function testCreateSession4() - { - $this->expectsRequest('post', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->create( - [ - 'success_url' => 'https://example.com/success', - 'cancel_url' => 'https://example.com/cancel', - 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], - 'mode' => 'payment', - ] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - - public function testRetrieveSession2() - { - $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); - $result = $this->client->checkout->sessions->retrieve( - 'cs_test_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - - public function testExpireSession2() - { - $this->expectsRequest( - 'post', - '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire' - ); - $result = $this->client->checkout->sessions->expire( - 'cs_test_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - - public function testListCountrySpec() - { - $this->expectsRequest('get', '/v1/country_specs'); - $result = $this->client->countrySpecs->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CountrySpec::class, $result->data[0]); - } - - public function testRetrieveCountrySpec() - { - $this->expectsRequest('get', '/v1/country_specs/US'); - $result = $this->client->countrySpecs->retrieve('US', []); - static::assertInstanceOf(\Stripe\CountrySpec::class, $result); - } - - public function testListCoupon() - { - $this->expectsRequest('get', '/v1/coupons'); - $result = $this->client->coupons->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Coupon::class, $result->data[0]); - } - - public function testCreateCoupon() - { - $this->expectsRequest('post', '/v1/coupons'); - $result = $this->client->coupons->create( - [ - 'percent_off' => 25.5, - 'duration' => 'repeating', - 'duration_in_months' => 3, - ] - ); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - - public function testDeleteCoupon() - { - $this->expectsRequest('delete', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->delete('Z4OV52SU', []); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - - public function testRetrieveCoupon() - { - $this->expectsRequest('get', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->retrieve('Z4OV52SU', []); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - - public function testUpdateCoupon() - { - $this->expectsRequest('post', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->update( - 'Z4OV52SU', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - - public function testListCreditNote() - { - $this->expectsRequest('get', '/v1/credit_notes'); - $result = $this->client->creditNotes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CreditNote::class, $result->data[0]); - } - - public function testCreateCreditNote() - { - $this->expectsRequest('post', '/v1/credit_notes'); - $result = $this->client->creditNotes->create( - [ - 'invoice' => 'in_xxxxxxxxxxxxx', - 'lines' => [ - [ - 'type' => 'invoice_line_item', - 'invoice_line_item' => 'il_xxxxxxxxxxxxx', - 'quantity' => 1, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - - public function testVoidCreditNoteCreditNote() - { - $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx/void'); - $result = $this->client->creditNotes->voidCreditNote( - 'cn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - - public function testListCreditNoteLineItem() - { - $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx/lines'); - $result = $this->client->creditNotes->allLines( - 'cn_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CreditNoteLineItem::class, $result->data[0]); - } - - public function testPreviewCreditNote() - { - $this->expectsRequest('get', '/v1/credit_notes/preview'); - $result = $this->client->creditNotes->preview( - [ - 'invoice' => 'in_xxxxxxxxxxxxx', - 'lines' => [ - [ - 'type' => 'invoice_line_item', - 'invoice_line_item' => 'il_xxxxxxxxxxxxx', - 'quantity' => 1, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - - public function testListCustomer() - { - $this->expectsRequest('get', '/v1/customers'); - $result = $this->client->customers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - - public function testListCustomer2() - { - $this->expectsRequest('get', '/v1/customers'); - $result = $this->client->customers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - - public function testCreateCustomer() - { - $this->expectsRequest('post', '/v1/customers'); - $result = $this->client->customers->create( - ['description' => 'My First Test Customer (created for API docs)'] - ); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - - public function testDeleteCustomer() - { - $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - - public function testRetrieveCustomer() - { - $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->retrieve('cus_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - - public function testUpdateCustomer() - { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->update( - 'cus_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - - public function testListCustomerBalanceTransaction() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' - ); - $result = $this->client->customers->allBalanceTransactions( - 'cus_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result->data[0]); - } - - public function testCreateCustomerBalanceTransaction() - { - $this->expectsRequest( - 'post', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' - ); - $result = $this->client->customers->createBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - ['amount' => -500, 'currency' => 'usd'] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - - public function testRetrieveCustomerBalanceTransaction() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->retrieveBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - 'cbtxn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - - public function testUpdateCustomerBalanceTransaction() - { - $this->expectsRequest( - 'post', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->updateBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - 'cbtxn_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - - public function testListTaxId() - { - $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); - $result = $this->client->customers->allTaxIds( - 'cus_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); - } - - public function testCreateTaxId() - { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); - $result = $this->client->customers->createTaxId( - 'cus_xxxxxxxxxxxxx', - ['type' => 'eu_vat', 'value' => 'DE123456789'] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - - public function testDeleteTaxId() - { - $this->expectsRequest( - 'delete', - '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->deleteTaxId( - 'cus_xxxxxxxxxxxxx', - 'txi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - - public function testRetrieveTaxId() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->retrieveTaxId( - 'cus_xxxxxxxxxxxxx', - 'txi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - - public function testSearchCustomer() - { - $this->expectsRequest('get', '/v1/customers/search'); - $result = $this->client->customers->search( - ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - - public function testSearchCustomer2() - { - $this->expectsRequest('get', '/v1/customers/search'); - $result = $this->client->customers->search( - ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - - public function testListDispute() - { - $this->expectsRequest('get', '/v1/disputes'); - $result = $this->client->disputes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Dispute::class, $result->data[0]); - } - - public function testRetrieveDispute() - { - $this->expectsRequest('get', '/v1/disputes/dp_xxxxxxxxxxxxx'); - $result = $this->client->disputes->retrieve('dp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - - public function testUpdateDispute() - { - $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx'); - $result = $this->client->disputes->update( - 'dp_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - - public function testCloseDispute() - { - $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx/close'); - $result = $this->client->disputes->close('dp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - - public function testListEvent() - { - $this->expectsRequest('get', '/v1/events'); - $result = $this->client->events->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Event::class, $result->data[0]); - } - - public function testRetrieveEvent() - { - $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx'); - $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Event::class, $result); - } - - public function testListFileLink() - { - $this->expectsRequest('get', '/v1/file_links'); - $result = $this->client->fileLinks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FileLink::class, $result->data[0]); - } - - public function testCreateFileLink() - { - $this->expectsRequest('post', '/v1/file_links'); - $result = $this->client->fileLinks->create( - ['file' => 'file_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - - public function testRetrieveFileLink() - { - $this->expectsRequest('get', '/v1/file_links/link_xxxxxxxxxxxxx'); - $result = $this->client->fileLinks->retrieve('link_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - - public function testUpdateFileLink() - { - $this->expectsRequest('post', '/v1/file_links/link_xxxxxxxxxxxxx'); - $result = $this->client->fileLinks->update( - 'link_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - - public function testListFile() - { - $this->expectsRequest('get', '/v1/files'); - $result = $this->client->files->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\File::class, $result->data[0]); - } - - public function testRetrieveFile() - { - $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx'); - $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\File::class, $result); - } - - public function testListAccount3() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts'); - $result = $this->client->financialConnections->accounts->all( - ['account_holder' => ['customer' => 'cus_xxxxxxxxxxxxx']] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); - } - - public function testRetrieveAccount3() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx' - ); - $result = $this->client->financialConnections->accounts->retrieve( - 'fca_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - - public function testListOwnersAccount2() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners' - ); - $result = $this->client->financialConnections->accounts->allOwners( - 'fca_xxxxxxxxxxxxx', - ['limit' => 3, 'ownership' => 'fcaowns_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); - } - - public function testCreateSession5() - { - $this->expectsRequest('post', '/v1/financial_connections/sessions'); - $result = $this->client->financialConnections->sessions->create( - [ - 'account_holder' => [ - 'type' => 'customer', - 'customer' => 'cus_xxxxxxxxxxxxx', - ], - 'permissions' => ['payment_method', 'balances'], - 'filters' => ['countries' => ['US']], - ] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - - public function testRetrieveSession3() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx' - ); - $result = $this->client->financialConnections->sessions->retrieve( - 'fcsess_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - - public function testListVerificationReport() - { - $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); - } - - public function testRetrieveVerificationReport() - { - $this->expectsRequest( - 'get', - '/v1/identity/verification_reports/vr_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationReports->retrieve( - 'vr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result); - } - - public function testListVerificationSession() - { - $this->expectsRequest('get', '/v1/identity/verification_sessions'); - $result = $this->client->identity->verificationSessions->all( - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result->data[0]); - } - - public function testCreateVerificationSession() - { - $this->expectsRequest('post', '/v1/identity/verification_sessions'); - $result = $this->client->identity->verificationSessions->create( - ['type' => 'document'] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - - public function testRetrieveVerificationSession() - { - $this->expectsRequest( - 'get', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationSessions->retrieve( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - - public function testUpdateVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationSessions->update( - 'vs_xxxxxxxxxxxxx', - ['type' => 'id_number'] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - - public function testCancelVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->identity->verificationSessions->cancel( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - - public function testRedactVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact' - ); - $result = $this->client->identity->verificationSessions->redact( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - - public function testListInvoiceItem() - { - $this->expectsRequest('get', '/v1/invoiceitems'); - $result = $this->client->invoiceItems->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result->data[0]); - } - - public function testCreateInvoiceItem() - { - $this->expectsRequest('post', '/v1/invoiceitems'); - $result = $this->client->invoiceItems->create( - ['customer' => 'cus_xxxxxxxxxxxxx', 'price' => 'price_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - - public function testDeleteInvoiceItem() - { - $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - - public function testRetrieveInvoiceItem() - { - $this->expectsRequest('get', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->retrieve('ii_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - - public function testUpdateInvoiceItem() - { - $this->expectsRequest('post', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->update( - 'ii_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - - public function testListInvoice() - { - $this->expectsRequest('get', '/v1/invoices'); - $result = $this->client->invoices->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); - } - - public function testCreateInvoice() - { - $this->expectsRequest('post', '/v1/invoices'); - $result = $this->client->invoices->create( - ['customer' => 'cus_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testDeleteInvoice() - { - $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testRetrieveInvoice() - { - $this->expectsRequest('get', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->retrieve('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testUpdateInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->update( - 'in_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testFinalizeInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testMarkUncollectibleInvoice() - { - $this->expectsRequest( - 'post', - '/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible' - ); - $result = $this->client->invoices->markUncollectible( - 'in_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testPayInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/pay'); - $result = $this->client->invoices->pay('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testSendInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/send'); - $result = $this->client->invoices->sendInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testVoidInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/void'); - $result = $this->client->invoices->voidInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - - public function testSearchInvoice() - { - $this->expectsRequest('get', '/v1/invoices/search'); - $result = $this->client->invoices->search( - ['query' => 'total>999 AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); - } - - public function testListAuthorization() - { - $this->expectsRequest('get', '/v1/issuing/authorizations'); - $result = $this->client->issuing->authorizations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result->data[0]); - } - - public function testRetrieveAuthorization() - { - $this->expectsRequest( - 'get', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' - ); - $result = $this->client->issuing->authorizations->retrieve( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - - public function testUpdateAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' - ); - $result = $this->client->issuing->authorizations->update( - 'iauth_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - - public function testApproveAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve' - ); - $result = $this->client->issuing->authorizations->approve( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - - public function testDeclineAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline' - ); - $result = $this->client->issuing->authorizations->decline( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - - public function testListCardholder() - { - $this->expectsRequest('get', '/v1/issuing/cardholders'); - $result = $this->client->issuing->cardholders->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result->data[0]); - } - - public function testCreateCardholder() - { - $this->expectsRequest('post', '/v1/issuing/cardholders'); - $result = $this->client->issuing->cardholders->create( - [ - 'type' => 'individual', - 'name' => 'Jenny Rosen', - 'email' => 'jenny.rosen@example.com', - 'phone_number' => '+18888675309', - 'billing' => [ - 'address' => [ - 'line1' => '1234 Main Street', - 'city' => 'San Francisco', - 'state' => 'CA', - 'country' => 'US', - 'postal_code' => '94111', - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - - public function testRetrieveCardholder() - { - $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cardholders->retrieve( - 'ich_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - - public function testUpdateCardholder() - { - $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cardholders->update( - 'ich_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - - public function testListCard() - { - $this->expectsRequest('get', '/v1/issuing/cards'); - $result = $this->client->issuing->cards->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result->data[0]); - } - - public function testCreateCard() - { - $this->expectsRequest('post', '/v1/issuing/cards'); - $result = $this->client->issuing->cards->create( - [ - 'cardholder' => 'ich_xxxxxxxxxxxxx', - 'currency' => 'usd', - 'type' => 'virtual', - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testRetrieveCard() - { - $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testUpdateCard() - { - $this->expectsRequest('post', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->update( - 'ic_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - - public function testListDispute2() - { - $this->expectsRequest('get', '/v1/issuing/disputes'); - $result = $this->client->issuing->disputes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result->data[0]); - } - - public function testCreateDispute() - { - $this->expectsRequest('post', '/v1/issuing/disputes'); - $result = $this->client->issuing->disputes->create( - [ - 'transaction' => 'ipi_xxxxxxxxxxxxx', - 'evidence' => [ - 'reason' => 'fraudulent', - 'fraudulent' => ['explanation' => 'Purchase was unrecognized.'], - ], - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - - public function testRetrieveDispute2() - { - $this->expectsRequest('get', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx'); - $result = $this->client->issuing->disputes->retrieve( - 'idp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - - public function testSubmitDispute() - { - $this->expectsRequest( - 'post', - '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' - ); - $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - - public function testListTransaction() - { - $this->expectsRequest('get', '/v1/issuing/transactions'); - $result = $this->client->issuing->transactions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result->data[0]); - } - - public function testRetrieveTransaction() - { - $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); - $result = $this->client->issuing->transactions->retrieve( - 'ipi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); - } - - public function testUpdateTransaction() - { - $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); - $result = $this->client->issuing->transactions->update( - 'ipi_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); - } - - public function testRetrieveMandate() - { - $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Mandate::class, $result); - } - - public function testListPaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents'); - $result = $this->client->paymentIntents->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); - } - - public function testCreatePaymentIntent2() - { - $this->expectsRequest('post', '/v1/payment_intents'); - $result = $this->client->paymentIntents->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'payment_method_types' => ['card'], - ] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testRetrievePaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testUpdatePaymentIntent() - { - $this->expectsRequest('post', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->update( - 'pi_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testApplyCustomerBalancePaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance' - ); - $result = $this->client->paymentIntents->applyCustomerBalance( - 'pi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testCancelPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->paymentIntents->cancel('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testCapturePaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' - ); - $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testConfirmPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm' - ); - $result = $this->client->paymentIntents->confirm( - 'pi_xxxxxxxxxxxxx', - ['payment_method' => 'pm_card_visa'] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testIncrementAuthorizationPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization' - ); - $result = $this->client->paymentIntents->incrementAuthorization( - 'pi_xxxxxxxxxxxxx', - ['amount' => 2099] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - - public function testSearchPaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents/search'); - $result = $this->client->paymentIntents->search( - ['query' => 'status:\'succeeded\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); - } - - public function testListPaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links'); - $result = $this->client->paymentLinks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result->data[0]); - } - - public function testCreatePaymentLink2() - { - $this->expectsRequest('post', '/v1/payment_links'); - $result = $this->client->paymentLinks->create( - ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - - public function testRetrievePaymentLink2() - { - $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - - public function testUpdatePaymentLink() - { - $this->expectsRequest('post', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->update( - 'plink_xxxxxxxxxxxxx', - ['active' => false] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - - public function testListPaymentMethod() - { - $this->expectsRequest('get', '/v1/payment_methods'); - $result = $this->client->paymentMethods->all( - ['customer' => 'cus_xxxxxxxxxxxxx', 'type' => 'card'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result->data[0]); - } - - public function testCreatePaymentMethod() - { - $this->expectsRequest('post', '/v1/payment_methods'); - $result = $this->client->paymentMethods->create( - [ - 'type' => 'card', - 'card' => [ - 'number' => '4242424242424242', - 'exp_month' => 5, - 'exp_year' => 2023, - 'cvc' => '314', - ], - ] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - - public function testRetrievePaymentMethod() - { - $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - - public function testUpdatePaymentMethod() - { - $this->expectsRequest('post', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->update( - 'pm_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - - public function testAttachPaymentMethod() - { - $this->expectsRequest( - 'post', - '/v1/payment_methods/pm_xxxxxxxxxxxxx/attach' - ); - $result = $this->client->paymentMethods->attach( - 'pm_xxxxxxxxxxxxx', - ['customer' => 'cus_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - - public function testDetachPaymentMethod() - { - $this->expectsRequest( - 'post', - '/v1/payment_methods/pm_xxxxxxxxxxxxx/detach' - ); - $result = $this->client->paymentMethods->detach('pm_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - - public function testListPayout() - { - $this->expectsRequest('get', '/v1/payouts'); - $result = $this->client->payouts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Payout::class, $result->data[0]); - } - - public function testCreatePayout() - { - $this->expectsRequest('post', '/v1/payouts'); - $result = $this->client->payouts->create( - ['amount' => 1100, 'currency' => 'usd'] - ); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - - public function testRetrievePayout() - { - $this->expectsRequest('get', '/v1/payouts/po_xxxxxxxxxxxxx'); - $result = $this->client->payouts->retrieve('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - - public function testUpdatePayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx'); - $result = $this->client->payouts->update( - 'po_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - - public function testCancelPayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/cancel'); - $result = $this->client->payouts->cancel('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - - public function testReversePayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/reverse'); - $result = $this->client->payouts->reverse('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - - public function testListPlan() - { - $this->expectsRequest('get', '/v1/plans'); - $result = $this->client->plans->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Plan::class, $result->data[0]); - } - - public function testCreatePlan() - { - $this->expectsRequest('post', '/v1/plans'); - $result = $this->client->plans->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'interval' => 'month', - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - - public function testDeletePlan() - { - $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - - public function testRetrievePlan() - { - $this->expectsRequest('get', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->retrieve('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - - public function testUpdatePlan() - { - $this->expectsRequest('post', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->update( - 'price_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - - public function testListPrice() - { - $this->expectsRequest('get', '/v1/prices'); - $result = $this->client->prices->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); - } - - public function testCreatePrice2() - { - $this->expectsRequest('post', '/v1/prices'); - $result = $this->client->prices->create( - [ - 'unit_amount' => 2000, - 'currency' => 'usd', - 'recurring' => ['interval' => 'month'], - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - - public function testRetrievePrice() - { - $this->expectsRequest('get', '/v1/prices/price_xxxxxxxxxxxxx'); - $result = $this->client->prices->retrieve('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - - public function testUpdatePrice() - { - $this->expectsRequest('post', '/v1/prices/price_xxxxxxxxxxxxx'); - $result = $this->client->prices->update( - 'price_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - - public function testSearchPrice() - { - $this->expectsRequest('get', '/v1/prices/search'); - $result = $this->client->prices->search( - ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); - } - - public function testListProduct() - { - $this->expectsRequest('get', '/v1/products'); - $result = $this->client->products->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); - } - - public function testCreateProduct() - { - $this->expectsRequest('post', '/v1/products'); - $result = $this->client->products->create(['name' => 'Gold Special']); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - - public function testDeleteProduct() - { - $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - - public function testRetrieveProduct() - { - $this->expectsRequest('get', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->retrieve('prod_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - - public function testUpdateProduct() - { - $this->expectsRequest('post', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->update( - 'prod_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - - public function testSearchProduct() - { - $this->expectsRequest('get', '/v1/products/search'); - $result = $this->client->products->search( - ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); - } - - public function testListPromotionCode() - { - $this->expectsRequest('get', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result->data[0]); - } - - public function testCreatePromotionCode() - { - $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - - public function testRetrievePromotionCode() - { - $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); - $result = $this->client->promotionCodes->retrieve( - 'promo_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - - public function testUpdatePromotionCode() - { - $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); - $result = $this->client->promotionCodes->update( - 'promo_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - - public function testListQuote() - { - $this->expectsRequest('get', '/v1/quotes'); - $result = $this->client->quotes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Quote::class, $result->data[0]); - } - - public function testCreateQuote() - { - $this->expectsRequest('post', '/v1/quotes'); - $result = $this->client->quotes->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], - ] - ); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testRetrieveQuote() - { - $this->expectsRequest('get', '/v1/quotes/qt_xxxxxxxxxxxxx'); - $result = $this->client->quotes->retrieve('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testUpdateQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx'); - $result = $this->client->quotes->update( - 'qt_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testAcceptQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/accept'); - $result = $this->client->quotes->accept('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testCancelQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/cancel'); - $result = $this->client->quotes->cancel('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testFinalizeQuoteQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/finalize'); - $result = $this->client->quotes->finalizeQuote('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - - public function testListEarlyFraudWarning() - { - $this->expectsRequest('get', '/v1/radar/early_fraud_warnings'); - $result = $this->client->radar->earlyFraudWarnings->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result->data[0]); - } - - public function testRetrieveEarlyFraudWarning() - { - $this->expectsRequest( - 'get', - '/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->earlyFraudWarnings->retrieve( - 'issfr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result); - } - - public function testListValueListItem() - { - $this->expectsRequest('get', '/v1/radar/value_list_items'); - $result = $this->client->radar->valueListItems->all( - ['limit' => 3, 'value_list' => 'rsl_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result->data[0]); - } - - public function testCreateValueListItem() - { - $this->expectsRequest('post', '/v1/radar/value_list_items'); - $result = $this->client->radar->valueListItems->create( - ['value_list' => 'rsl_xxxxxxxxxxxxx', 'value' => '1.2.3.4'] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - - public function testDeleteValueListItem() - { - $this->expectsRequest( - 'delete', - '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->valueListItems->delete( - 'rsli_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - - public function testRetrieveValueListItem() - { - $this->expectsRequest( - 'get', - '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->valueListItems->retrieve( - 'rsli_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - - public function testListValueList() - { - $this->expectsRequest('get', '/v1/radar/value_lists'); - $result = $this->client->radar->valueLists->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result->data[0]); - } - - public function testCreateValueList() - { - $this->expectsRequest('post', '/v1/radar/value_lists'); - $result = $this->client->radar->valueLists->create( - [ - 'alias' => 'custom_ip_xxxxxxxxxxxxx', - 'name' => 'Custom IP Blocklist', - 'item_type' => 'ip_address', - ] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - - public function testDeleteValueList() - { - $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - - public function testRetrieveValueList() - { - $this->expectsRequest('get', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->retrieve( - 'rsl_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - - public function testUpdateValueList() - { - $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->update( - 'rsl_xxxxxxxxxxxxx', - ['name' => 'Updated IP Block List'] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - - public function testListRefund() - { - $this->expectsRequest('get', '/v1/refunds'); - $result = $this->client->refunds->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Refund::class, $result->data[0]); - } - - public function testCreateRefund() - { - $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - - public function testRetrieveRefund() - { - $this->expectsRequest('get', '/v1/refunds/re_xxxxxxxxxxxxx'); - $result = $this->client->refunds->retrieve('re_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - - public function testUpdateRefund() - { - $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx'); - $result = $this->client->refunds->update( - 're_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - - public function testCancelRefund() - { - $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx/cancel'); - $result = $this->client->refunds->cancel('re_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - - public function testListReportRun() - { - $this->expectsRequest('get', '/v1/reporting/report_runs'); - $result = $this->client->reporting->reportRuns->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result->data[0]); - } - - public function testCreateReportRun() - { - $this->expectsRequest('post', '/v1/reporting/report_runs'); - $result = $this->client->reporting->reportRuns->create( - [ - 'report_type' => 'balance.summary.1', - 'parameters' => [ - 'interval_start' => 1522540800, - 'interval_end' => 1525132800, - ], - ] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); - } - - public function testRetrieveReportRun() - { - $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); - $result = $this->client->reporting->reportRuns->retrieve( - 'frr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); - } - - public function testListReportType() - { - $this->expectsRequest('get', '/v1/reporting/report_types'); - $result = $this->client->reporting->reportTypes->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result->data[0]); - } - - public function testRetrieveReportType() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_types/balance.summary.1' - ); - $result = $this->client->reporting->reportTypes->retrieve( - 'balance.summary.1', - [] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result); - } - - public function testListReview() - { - $this->expectsRequest('get', '/v1/reviews'); - $result = $this->client->reviews->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Review::class, $result->data[0]); - } - - public function testRetrieveReview() - { - $this->expectsRequest('get', '/v1/reviews/prv_xxxxxxxxxxxxx'); - $result = $this->client->reviews->retrieve('prv_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Review::class, $result); - } - - public function testApproveReview() - { - $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve'); - $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Review::class, $result); - } - - public function testListSetupIntent() - { - $this->expectsRequest('get', '/v1/setup_intents'); - $result = $this->client->setupIntents->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result->data[0]); - } - - public function testCreateSetupIntent() - { - $this->expectsRequest('post', '/v1/setup_intents'); - $result = $this->client->setupIntents->create( - ['payment_method_types' => ['card']] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testRetrieveSetupIntent() - { - $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testUpdateSetupIntent() - { - $this->expectsRequest('post', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->update( - 'seti_xxxxxxxxxxxxx', - ['metadata' => ['user_id' => '3435453']] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testCancelSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->setupIntents->cancel('seti_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testConfirmSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm' - ); - $result = $this->client->setupIntents->confirm( - 'seti_xxxxxxxxxxxxx', - ['payment_method' => 'pm_card_visa'] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - - public function testListShippingRate2() - { - $this->expectsRequest('get', '/v1/shipping_rates'); - $result = $this->client->shippingRates->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); - } - - public function testCreateShippingRate2() - { - $this->expectsRequest('post', '/v1/shipping_rates'); - $result = $this->client->shippingRates->create( - [ - 'display_name' => 'Ground shipping', - 'type' => 'fixed_amount', - 'fixed_amount' => ['amount' => 500, 'currency' => 'usd'], - ] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - - public function testRetrieveShippingRate() - { - $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - - public function testUpdateShippingRate() - { - $this->expectsRequest('post', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->update( - 'shr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - - public function testListScheduledQueryRun() - { - $this->expectsRequest('get', '/v1/sigma/scheduled_query_runs'); - $result = $this->client->sigma->scheduledQueryRuns->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result->data[0]); - } - - public function testRetrieveScheduledQueryRun() - { - $this->expectsRequest( - 'get', - '/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx' - ); - $result = $this->client->sigma->scheduledQueryRuns->retrieve( - 'sqr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result); - } - - public function testRetrieveSource() - { - $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - - public function testRetrieveSource2() - { - $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - - public function testUpdateSource() - { - $this->expectsRequest('post', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->update( - 'src_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - - public function testListSubscriptionItem() - { - $this->expectsRequest('get', '/v1/subscription_items'); - $result = $this->client->subscriptionItems->all( - ['subscription' => 'sub_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result->data[0]); - } - - public function testCreateSubscriptionItem() - { - $this->expectsRequest('post', '/v1/subscription_items'); - $result = $this->client->subscriptionItems->create( - [ - 'subscription' => 'sub_xxxxxxxxxxxxx', - 'price' => 'price_xxxxxxxxxxxxx', - 'quantity' => 2, - ] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - - public function testDeleteSubscriptionItem() - { - $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - - public function testRetrieveSubscriptionItem() - { - $this->expectsRequest('get', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->retrieve( - 'si_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - - public function testUpdateSubscriptionItem() - { - $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->update( - 'si_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - - public function testListUsageRecordSummary() - { - $this->expectsRequest( - 'get', - '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries' - ); - $result = $this->client->subscriptionItems->allUsageRecordSummaries( - 'si_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\UsageRecordSummary::class, $result->data[0]); - } - - public function testCreateUsageRecord() - { - $this->expectsRequest( - 'post', - '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records' - ); - $result = $this->client->subscriptionItems->createUsageRecord( - 'si_xxxxxxxxxxxxx', - ['quantity' => 100, 'timestamp' => 1571252444] - ); - static::assertInstanceOf(\Stripe\UsageRecord::class, $result); - } - - public function testListSubscriptionSchedule() - { - $this->expectsRequest('get', '/v1/subscription_schedules'); - $result = $this->client->subscriptionSchedules->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result->data[0]); - } - - public function testCreateSubscriptionSchedule() - { - $this->expectsRequest('post', '/v1/subscription_schedules'); - $result = $this->client->subscriptionSchedules->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'start_date' => 1652909005, - 'end_behavior' => 'release', - 'phases' => [ - [ - 'items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]], - 'iterations' => 12, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - - public function testRetrieveSubscriptionSchedule() - { - $this->expectsRequest( - 'get', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' - ); - $result = $this->client->subscriptionSchedules->retrieve( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - - public function testUpdateSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' - ); - $result = $this->client->subscriptionSchedules->update( - 'sub_sched_xxxxxxxxxxxxx', - ['end_behavior' => 'release'] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - - public function testCancelSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->subscriptionSchedules->cancel( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - - public function testReleaseSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release' - ); - $result = $this->client->subscriptionSchedules->release( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - - public function testListSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions'); - $result = $this->client->subscriptions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); - } - - public function testCreateSubscription() - { - $this->expectsRequest('post', '/v1/subscriptions'); - $result = $this->client->subscriptions->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'items' => [['price' => 'price_xxxxxxxxxxxxx']], - ] - ); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - - public function testCancelSubscription() - { - $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - - public function testRetrieveSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - - public function testUpdateSubscription() - { - $this->expectsRequest('post', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->update( - 'sub_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - - public function testSearchSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions/search'); - $result = $this->client->subscriptions->search( - ['query' => 'status:\'active\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); - } - - public function testListTaxCode() - { - $this->expectsRequest('get', '/v1/tax_codes'); - $result = $this->client->taxCodes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxCode::class, $result->data[0]); - } - - public function testRetrieveTaxCode() - { - $this->expectsRequest('get', '/v1/tax_codes/txcd_xxxxxxxxxxxxx'); - $result = $this->client->taxCodes->retrieve('txcd_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\TaxCode::class, $result); - } - - public function testListTaxRate() - { - $this->expectsRequest('get', '/v1/tax_rates'); - $result = $this->client->taxRates->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxRate::class, $result->data[0]); - } - - public function testCreateTaxRate() - { - $this->expectsRequest('post', '/v1/tax_rates'); - $result = $this->client->taxRates->create( - [ - 'display_name' => 'VAT', - 'description' => 'VAT Germany', - 'jurisdiction' => 'DE', - 'percentage' => 16, - 'inclusive' => false, - ] - ); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - - public function testRetrieveTaxRate() - { - $this->expectsRequest('get', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); - $result = $this->client->taxRates->retrieve('txr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - - public function testUpdateTaxRate() - { - $this->expectsRequest('post', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); - $result = $this->client->taxRates->update( - 'txr_xxxxxxxxxxxxx', - ['active' => false] - ); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - - public function testListConfiguration3() - { - $this->expectsRequest('get', '/v1/terminal/configurations'); - $result = $this->client->terminal->configurations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); - } - - public function testDeleteConfiguration2() - { - $this->expectsRequest( - 'delete', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->delete( - 'tmc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testRetrieveConfiguration3() - { - $this->expectsRequest( - 'get', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->retrieve( - 'tmc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testUpdateConfiguration3() - { - $this->expectsRequest( - 'post', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->update( - 'tmc_xxxxxxxxxxxxx', - ['bbpos_wisepos_e' => ['splashscreen' => 'file_xxxxxxxxxxxxx']] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - - public function testCreateConnectionToken() - { - $this->expectsRequest('post', '/v1/terminal/connection_tokens'); - $result = $this->client->terminal->connectionTokens->create([]); - static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result); - } - - public function testListLocation() - { - $this->expectsRequest('get', '/v1/terminal/locations'); - $result = $this->client->terminal->locations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result->data[0]); - } - - public function testCreateLocation() - { - $this->expectsRequest('post', '/v1/terminal/locations'); - $result = $this->client->terminal->locations->create( - [ - 'display_name' => 'My First Store', - 'address' => [ - 'line1' => '1234 Main Street', - 'city' => 'San Francisco', - 'country' => 'US', - 'postal_code' => '94111', - ], - ] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - - public function testDeleteLocation() - { - $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->delete( - 'tml_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - - public function testRetrieveLocation() - { - $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->retrieve( - 'tml_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - - public function testUpdateLocation() - { - $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->update( - 'tml_xxxxxxxxxxxxx', - ['display_name' => 'My First Store'] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - - public function testListReader() - { - $this->expectsRequest('get', '/v1/terminal/readers'); - $result = $this->client->terminal->readers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result->data[0]); - } - - public function testCreateReader() - { - $this->expectsRequest('post', '/v1/terminal/readers'); - $result = $this->client->terminal->readers->create( - [ - 'registration_code' => 'puppies-plug-could', - 'label' => 'Blue Rabbit', - 'location' => 'tml_1234', - ] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testDeleteReader() - { - $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testRetrieveReader() - { - $this->expectsRequest('get', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->retrieve( - 'tmr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testUpdateReader() - { - $this->expectsRequest('post', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->update( - 'tmr_xxxxxxxxxxxxx', - ['label' => 'Blue Rabbit'] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testCancelActionReader() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action' - ); - $result = $this->client->terminal->readers->cancelAction( - 'tmr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testProcessPaymentIntentReader() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent' - ); - $result = $this->client->terminal->readers->processPaymentIntent( - 'tmr_xxxxxxxxxxxxx', - ['payment_intent' => 'pi_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - - public function testListTestClock2() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); - } - - public function testCreateTestClock2() - { - $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->create( - ['frozen_time' => 1577836800] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testDeleteTestClock2() - { - $this->expectsRequest( - 'delete', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' - ); - $result = $this->client->testHelpers->testClocks->delete( - 'clock_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testRetrieveTestClock2() - { - $this->expectsRequest( - 'get', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' - ); - $result = $this->client->testHelpers->testClocks->retrieve( - 'clock_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testAdvanceTestClock2() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance' - ); - $result = $this->client->testHelpers->testClocks->advance( - 'clock_xxxxxxxxxxxxx', - ['frozen_time' => 1652390605] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - - public function testCreateToken2() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'bank_account' => [ - 'country' => 'US', - 'currency' => 'usd', - 'account_holder_name' => 'Jenny Rosen', - 'account_holder_type' => 'individual', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testCreateToken3() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - ['pii' => ['id_number' => '000000000']] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testCreateToken4() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'account' => [ - 'individual' => ['first_name' => 'Jane', 'last_name' => 'Doe'], - 'tos_shown_and_accepted' => true, - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testCreateToken5() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'person' => [ - 'first_name' => 'Jane', - 'last_name' => 'Doe', - 'relationship' => ['owner' => true], - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testCreateToken6() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testRetrieveToken() - { - $this->expectsRequest('get', '/v1/tokens/tok_xxxx'); - $result = $this->client->tokens->retrieve('tok_xxxx', []); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - - public function testListTopup() - { - $this->expectsRequest('get', '/v1/topups'); - $result = $this->client->topups->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Topup::class, $result->data[0]); - } - - public function testCreateTopup() - { - $this->expectsRequest('post', '/v1/topups'); - $result = $this->client->topups->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'description' => 'Top-up for Jenny Rosen', - 'statement_descriptor' => 'Top-up', - ] - ); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - - public function testRetrieveTopup() - { - $this->expectsRequest('get', '/v1/topups/tu_xxxxxxxxxxxxx'); - $result = $this->client->topups->retrieve('tu_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - - public function testUpdateTopup() - { - $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx'); - $result = $this->client->topups->update( - 'tu_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - - public function testCancelTopup() - { - $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel'); - $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - - public function testListTransfer() - { - $this->expectsRequest('get', '/v1/transfers'); - $result = $this->client->transfers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Transfer::class, $result->data[0]); - } - - public function testCreateTransfer() - { - $this->expectsRequest('post', '/v1/transfers'); - $result = $this->client->transfers->create( - [ - 'amount' => 400, - 'currency' => 'usd', - 'destination' => 'acct_xxxxxxxxxxxxx', - 'transfer_group' => 'ORDER_95', - ] - ); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - - public function testRetrieveTransfer() - { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx'); - $result = $this->client->transfers->retrieve('tr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - - public function testUpdateTransfer() - { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx'); - $result = $this->client->transfers->update( - 'tr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - - public function testListTransferReversal() - { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); - $result = $this->client->transfers->allReversals( - 'tr_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result->data[0]); - } - - public function testCreateTransferReversal() - { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); - $result = $this->client->transfers->createReversal( - 'tr_xxxxxxxxxxxxx', - ['amount' => 100] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - - public function testRetrieveTransferReversal() - { - $this->expectsRequest( - 'get', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' - ); - $result = $this->client->transfers->retrieveReversal( - 'tr_xxxxxxxxxxxxx', - 'trr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - - public function testUpdateTransferReversal() - { - $this->expectsRequest( - 'post', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' - ); - $result = $this->client->transfers->updateReversal( - 'tr_xxxxxxxxxxxxx', - 'trr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - - public function testListCreditReversal() - { - $this->expectsRequest('get', '/v1/treasury/credit_reversals'); - $result = $this->client->treasury->creditReversals->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result->data[0]); - } - - public function testCreateCreditReversal() - { - $this->expectsRequest('post', '/v1/treasury/credit_reversals'); - $result = $this->client->treasury->creditReversals->create( - ['received_credit' => 'rc_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); - } - - public function testRetrieveCreditReversal() - { - $this->expectsRequest( - 'get', - '/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->creditReversals->retrieve( - 'credrev_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); - } - - public function testListDebitReversal() - { - $this->expectsRequest('get', '/v1/treasury/debit_reversals'); - $result = $this->client->treasury->debitReversals->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result->data[0]); - } - - public function testCreateDebitReversal() - { - $this->expectsRequest('post', '/v1/treasury/debit_reversals'); - $result = $this->client->treasury->debitReversals->create( - ['received_debit' => 'rd_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); - } - - public function testRetrieveDebitReversal() - { - $this->expectsRequest( - 'get', - '/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->debitReversals->retrieve( - 'debrev_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); - } - - public function testListFinancialAccount() - { - $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); - } - - public function testCreateFinancialAccount() - { - $this->expectsRequest('post', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->create( - ['supported_currencies' => ['usd'], 'features' => []] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - - public function testRetrieveFinancialAccount() - { - $this->expectsRequest( - 'get', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->financialAccounts->retrieve( - 'fa_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - - public function testUpdateFinancialAccount() - { - $this->expectsRequest( - 'post', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->financialAccounts->update( - 'fa_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - - public function testRetrieveFeaturesFinancialAccount() - { - $this->expectsRequest( - 'get', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' - ); - $result = $this->client->treasury->financialAccounts->retrieveFeatures( - 'fa_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); - } - - public function testUpdateFeaturesFinancialAccount() - { - $this->expectsRequest( - 'post', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' - ); - $result = $this->client->treasury->financialAccounts->updateFeatures( - 'fa_xxxxxxxxxxxxx', - ['card_issuing' => ['requested' => false]] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); - } - - public function testListInboundTransfer() - { - $this->expectsRequest('get', '/v1/treasury/inbound_transfers'); - $result = $this->client->treasury->inboundTransfers->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result->data[0]); - } - - public function testCreateInboundTransfer() - { - $this->expectsRequest('post', '/v1/treasury/inbound_transfers'); - $result = $this->client->treasury->inboundTransfers->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'amount' => 10000, - 'currency' => 'usd', - 'origin_payment_method' => 'pm_xxxxxxxxxxxxx', - 'description' => 'InboundTransfer from my bank account', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testRetrieveInboundTransfer() - { - $this->expectsRequest( - 'get', - '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->inboundTransfers->retrieve( - 'ibt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testCancelInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->inboundTransfers->cancel( - 'ibt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - - public function testListOutboundPayment() - { - $this->expectsRequest('get', '/v1/treasury/outbound_payments'); - $result = $this->client->treasury->outboundPayments->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result->data[0]); - } - - public function testCreateOutboundPayment() - { - $this->expectsRequest('post', '/v1/treasury/outbound_payments'); - $result = $this->client->treasury->outboundPayments->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'amount' => 10000, - 'currency' => 'usd', - 'customer' => 'cu_xxxxxxxxxxxxx', - 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', - 'description' => 'OutboundPayment to a 3rd party', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - - public function testRetrieveOutboundPayment() - { - $this->expectsRequest( - 'get', - '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->outboundPayments->retrieve( - 'obp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - - public function testCancelOutboundPayment() - { - $this->expectsRequest( - 'post', - '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->outboundPayments->cancel( - 'obp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - - public function testListOutboundTransfer() - { - $this->expectsRequest('get', '/v1/treasury/outbound_transfers'); - $result = $this->client->treasury->outboundTransfers->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result->data[0]); - } - - public function testCreateOutboundTransfer() - { - $this->expectsRequest('post', '/v1/treasury/outbound_transfers'); - $result = $this->client->treasury->outboundTransfers->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', - 'amount' => 500, - 'currency' => 'usd', - 'description' => 'OutboundTransfer to my external bank account', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testRetrieveOutboundTransfer() - { - $this->expectsRequest( - 'get', - '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->outboundTransfers->retrieve( - 'obt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testCancelOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->outboundTransfers->cancel( - 'obt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - - public function testListReceivedCredit() - { - $this->expectsRequest('get', '/v1/treasury/received_credits'); - $result = $this->client->treasury->receivedCredits->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result->data[0]); - } - - public function testRetrieveReceivedCredit() - { - $this->expectsRequest( - 'get', - '/v1/treasury/received_credits/rc_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->receivedCredits->retrieve( - 'rc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); - } - - public function testListReceivedDebit() - { - $this->expectsRequest('get', '/v1/treasury/received_debits'); - $result = $this->client->treasury->receivedDebits->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result->data[0]); - } - - public function testRetrieveReceivedDebit() - { - $this->expectsRequest( - 'get', - '/v1/treasury/received_debits/rd_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->receivedDebits->retrieve( - 'rd_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); - } - - public function testListTransactionEntry() - { - $this->expectsRequest('get', '/v1/treasury/transaction_entries'); - $result = $this->client->treasury->transactionEntries->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result->data[0]); - } - - public function testRetrieveTransactionEntry() - { - $this->expectsRequest( - 'get', - '/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->transactionEntries->retrieve( - 'trxne_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result); - } - - public function testListTransaction2() - { - $this->expectsRequest('get', '/v1/treasury/transactions'); - $result = $this->client->treasury->transactions->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result->data[0]); - } - - public function testRetrieveTransaction2() - { - $this->expectsRequest( - 'get', - '/v1/treasury/transactions/trxn_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->transactions->retrieve( - 'trxn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result); - } - - public function testListWebhookEndpoint() - { - $this->expectsRequest('get', '/v1/webhook_endpoints'); - $result = $this->client->webhookEndpoints->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result->data[0]); - } - - public function testDeleteWebhookEndpoint() - { - $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } - - public function testRetrieveWebhookEndpoint() - { - $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } - - public function testUpdateWebhookEndpoint() - { - $this->expectsRequest('post', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->update( - 'we_xxxxxxxxxxxxx', - ['url' => 'https://example.com/new_endpoint'] - ); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } -} + use TestHelper; + + /** @var null|\Stripe\StripeClient */ + private $client; + + /** @before */ + protected function setUpService() + { + $this->client = new \Stripe\StripeClient(['api_key' =>'sk_test_123', 'api_base' => MOCK_URL]); + } + + public function testListSecret() + { + $this->expectsRequest('get', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->all( + ['scope' => ['type' => 'account'], 'limit' => 2] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result->data[0]); + } + public function testCreateSecret() + { + $this->expectsRequest('post', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->create( + [ + 'name' => 'sec_123', + 'payload' => 'very secret string', + 'scope' => ['type' => 'account'], + ] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + public function testDeleteWhereSecret() + { + $this->expectsRequest('post', '/v1/apps/secrets/delete'); + $result = $this->client->apps->secrets->deleteWhere( + ['name' => 'my-api-key', 'scope' => ['type' => 'account']] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + public function testFindSecret() + { + $this->expectsRequest('get', '/v1/apps/secrets/find'); + $result = $this->client->apps->secrets->find( + ['name' => 'sec_123', 'scope' => ['type' => 'account']] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + public function testCreateSession() + { + $this->expectsRequest('post', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->create( + [ + 'success_url' => 'https://example.com/success', + 'cancel_url' => 'https://example.com/cancel', + 'mode' => 'payment', + 'shipping_options' => [ + ['shipping_rate' => 'shr_standard'], + [ + 'shipping_rate_data' => [ + 'display_name' => 'Standard', + 'delivery_estimate' => [ + 'minimum' => ['unit' => 'day', 'value' => 5], + 'maximum' => ['unit' => 'day', 'value' => 7], + ], + ], + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + public function testExpireSession() + { + $this->expectsRequest('post', '/v1/checkout/sessions/sess_xyz/expire'); + $result = $this->client->checkout->sessions->expire('sess_xyz', []); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + public function testListLineItemsSession() + { + $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); + $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); + } + public function testRetrieveCashBalance() + { + $this->expectsRequest('get', '/v1/customers/cus_123/cash_balance'); + $result = $this->client->customers->retrieveCashBalance('cus_123', []); + static::assertInstanceOf(\Stripe\CashBalance::class, $result); + } + public function testUpdateCashBalance() + { + $this->expectsRequest('post', '/v1/customers/cus_123/cash_balance'); + $result = $this->client->customers->updateCashBalance( + 'cus_123', + ['settings' => ['reconciliation_mode' => 'manual']] + ); + static::assertInstanceOf(\Stripe\CashBalance::class, $result); + } + public function testCreateFundingInstructionsCustomer() + { + $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); + $result = $this->client->customers->createFundingInstructions( + 'cus_123', + [ + 'bank_transfer' => [ + 'requested_address_types' => ['zengin'], + 'type' => 'jp_bank_transfer', + ], + 'currency' => 'usd', + 'funding_type' => 'bank_transfer', + ] + ); + static::assertInstanceOf(\Stripe\FundingInstructions::class, $result); + } + public function testListAccount() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts'); + $result = $this->client->financialConnections->accounts->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); + } + public function testRetrieveAccount() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); + $result = $this->client->financialConnections->accounts->retrieve( + 'fca_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + public function testDisconnectAccount() + { + $this->expectsRequest( + 'post', + '/v1/financial_connections/accounts/fca_xyz/disconnect' + ); + $result = $this->client->financialConnections->accounts->disconnect( + 'fca_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + public function testListOwnersAccount() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xyz/owners' + ); + $result = $this->client->financialConnections->accounts->allOwners( + 'fca_xyz', + ['ownership' => 'fcaowns_xyz'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); + } + public function testRefreshAccount() + { + $this->expectsRequest( + 'post', + '/v1/financial_connections/accounts/fca_xyz/refresh' + ); + $result = $this->client->financialConnections->accounts->refresh( + 'fca_xyz', + ['features' => ['balance']] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + public function testCreateSession2() + { + $this->expectsRequest('post', '/v1/financial_connections/sessions'); + $result = $this->client->financialConnections->sessions->create( + [ + 'account_holder' => ['type' => 'customer', 'customer' => 'cus_123'], + 'permissions' => ['balances'], + ] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + public function testRetrieveSession() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/sessions/fcsess_xyz' + ); + $result = $this->client->financialConnections->sessions->retrieve( + 'fcsess_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + public function testUpcomingInvoice() + { + $this->expectsRequest('get', '/v1/invoices/upcoming'); + $result = $this->client->invoices->upcoming( + ['customer' => 'cus_9utnxg47pWjV1e'] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testCreatePaymentIntent() + { + $this->expectsRequest('post', '/v1/payment_intents'); + $result = $this->client->paymentIntents->create( + [ + 'amount' => 1099, + 'currency' => 'eur', + 'automatic_payment_methods' => ['enabled' => true], + ] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testVerifyMicrodepositsPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits' + ); + $result = $this->client->paymentIntents->verifyMicrodeposits( + 'pi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testCreatePaymentLink() + { + $this->expectsRequest('post', '/v1/payment_links'); + $result = $this->client->paymentLinks->create( + ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + public function testRetrievePaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links/pl_xyz'); + $result = $this->client->paymentLinks->retrieve('pl_xyz', []); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + public function testListLineItemsPaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links/pl_xyz/line_items'); + $result = $this->client->paymentLinks->allLineItems('pl_xyz', []); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); + } + public function testCreatePrice() + { + $this->expectsRequest('post', '/v1/prices'); + $result = $this->client->prices->create( + [ + 'unit_amount' => 2000, + 'currency' => 'usd', + 'currency_options' => [ + 'uah' => ['unit_amount' => 5000], + 'eur' => ['unit_amount' => 1800], + ], + 'recurring' => ['interval' => 'month'], + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + public function testListSetupAttempt() + { + $this->expectsRequest('get', '/v1/setup_attempts'); + $result = $this->client->setupAttempts->all( + ['limit' => 3, 'setup_intent' => 'si_xyz'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]); + } + public function testVerifyMicrodepositsSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits' + ); + $result = $this->client->setupIntents->verifyMicrodeposits( + 'seti_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testListShippingRate() + { + $this->expectsRequest('get', '/v1/shipping_rates'); + $result = $this->client->shippingRates->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); + } + public function testCreateShippingRate() + { + $this->expectsRequest('post', '/v1/shipping_rates'); + $result = $this->client->shippingRates->create( + [ + 'display_name' => 'Sample Shipper', + 'fixed_amount' => ['currency' => 'usd', 'amount' => 400], + 'type' => 'fixed_amount', + ] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + public function testListConfiguration() + { + $this->expectsRequest('get', '/v1/terminal/configurations'); + $result = $this->client->terminal->configurations->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); + } + public function testDeleteConfiguration() + { + $this->expectsRequest('delete', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->delete('uc_123', []); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testRetrieveConfiguration() + { + $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->retrieve('uc_123', []); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testUpdateConfiguration() + { + $this->expectsRequest('post', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->update( + 'uc_123', + ['tipping' => ['usd' => ['fixed_amounts' => [10]]]] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testFundCashBalanceCustomer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/customers/cus_123/fund_cash_balance' + ); + $result = $this->client->testHelpers->customers->fundCashBalance( + 'cus_123', + ['amount' => 30, 'currency' => 'eur'] + ); + static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result); + } + public function testDeliverCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/deliver' + ); + $result = $this->client->testHelpers->issuing->cards->deliverCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testFailCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/fail' + ); + $result = $this->client->testHelpers->issuing->cards->failCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testReturnCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/return' + ); + $result = $this->client->testHelpers->issuing->cards->returnCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testShipCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/ship' + ); + $result = $this->client->testHelpers->issuing->cards->shipCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testExpireRefund() + { + $this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire'); + $result = $this->client->testHelpers->refunds->expire('re_123', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + public function testListTestClock() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); + } + public function testCreateTestClock() + { + $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->create( + ['frozen_time' => 123, 'name' => 'cogsworth'] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testDeleteTestClock() + { + $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); + $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testRetrieveTestClock() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); + $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testAdvanceTestClock() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/test_clocks/clock_xyz/advance' + ); + $result = $this->client->testHelpers->testClocks->advance( + 'clock_xyz', + ['frozen_time' => 142] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testFailInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->fail( + 'ibt_123', + ['failure_details' => ['code' => 'account_closed']] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testReturnInboundTransferInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/return' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->returnInboundTransfer( + 'ibt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testSucceedInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->succeed( + 'ibt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testFailOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/fail' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->fail( + 'obt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testPostOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/post' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->post( + 'obt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testReturnOutboundTransferOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/return' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->returnOutboundTransfer( + 'obt_123', + ['returned_details' => ['code' => 'account_closed']] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testCreateReceivedCredit() + { + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); + $result = $this->client->testHelpers->treasury->receivedCredits->create( + [ + 'financial_account' => 'fa_123', + 'network' => 'ach', + 'amount' => 1234, + 'currency' => 'usd', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); + } + public function testCreateReceivedDebit() + { + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); + $result = $this->client->testHelpers->treasury->receivedDebits->create( + [ + 'financial_account' => 'fa_123', + 'network' => 'ach', + 'amount' => 1234, + 'currency' => 'usd', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); + } + public function testCreateToken() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'card' => [ + 'number' => '4242424242424242', + 'exp_month' => '5', + 'exp_year' => '2023', + 'cvc' => '314', + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testCreateAccountLink() + { + $this->expectsRequest('post', '/v1/account_links'); + $result = $this->client->accountLinks->create( + [ + 'account' => 'acct_xxxxxxxxxxxxx', + 'refresh_url' => 'https://example.com/reauth', + 'return_url' => 'https://example.com/return', + 'type' => 'account_onboarding', + ] + ); + static::assertInstanceOf(\Stripe\AccountLink::class, $result); + } + public function testListAccount2() + { + $this->expectsRequest('get', '/v1/accounts'); + $result = $this->client->accounts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Account::class, $result->data[0]); + } + public function testCreateAccount() + { + $this->expectsRequest('post', '/v1/accounts'); + $result = $this->client->accounts->create( + [ + 'type' => 'custom', + 'country' => 'US', + 'email' => 'jenny.rosen@example.com', + 'capabilities' => [ + 'card_payments' => ['requested' => true], + 'transfers' => ['requested' => true], + ], + ] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + public function testDeleteAccount() + { + $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + public function testRetrieveAccount2() + { + $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->retrieve('acct_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + public function testUpdateAccount() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->update( + 'acct_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + public function testRejectAccount() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/reject'); + $result = $this->client->accounts->reject( + 'acct_xxxxxxxxxxxxx', + ['reason' => 'fraud'] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + public function testListCapability() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities' + ); + $result = $this->client->accounts->allCapabilities( + 'acct_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Capability::class, $result->data[0]); + } + public function testRetrieveCapability() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' + ); + $result = $this->client->accounts->retrieveCapability( + 'acct_xxxxxxxxxxxxx', + 'card_payments', + [] + ); + static::assertInstanceOf(\Stripe\Capability::class, $result); + } + public function testUpdateCapability() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' + ); + $result = $this->client->accounts->updateCapability( + 'acct_xxxxxxxxxxxxx', + 'card_payments', + ['requested' => true] + ); + static::assertInstanceOf(\Stripe\Capability::class, $result); + } + public function testCreateLoginLink() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/login_links' + ); + $result = $this->client->accounts->createLoginLink( + 'acct_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\LoginLink::class, $result); + } + public function testListPerson() + { + $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $result = $this->client->accounts->allPersons( + 'acct_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Person::class, $result->data[0]); + } + public function testCreatePerson() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $result = $this->client->accounts->createPerson( + 'acct_xxxxxxxxxxxxx', + ['first_name' => 'Jane', 'last_name' => 'Diaz'] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + public function testDeletePerson() + { + $this->expectsRequest( + 'delete', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->deletePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + public function testRetrievePerson() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->retrievePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + public function testUpdatePerson() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->updatePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + public function testListApplicationFee() + { + $this->expectsRequest('get', '/v1/application_fees'); + $result = $this->client->applicationFees->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ApplicationFee::class, $result->data[0]); + } + public function testRetrieveApplicationFee() + { + $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); + $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); + } + public function testListApplicationFeeRefund() + { + $this->expectsRequest( + 'get', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' + ); + $result = $this->client->applicationFees->allRefunds( + 'fee_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result->data[0]); + } + public function testCreateApplicationFeeRefund() + { + $this->expectsRequest( + 'post', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' + ); + $result = $this->client->applicationFees->createRefund( + 'fee_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + public function testRetrieveApplicationFeeRefund() + { + $this->expectsRequest( + 'get', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' + ); + $result = $this->client->applicationFees->retrieveRefund( + 'fee_xxxxxxxxxxxxx', + 'fr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + public function testUpdateApplicationFeeRefund() + { + $this->expectsRequest( + 'post', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' + ); + $result = $this->client->applicationFees->updateRefund( + 'fee_xxxxxxxxxxxxx', + 'fr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + public function testCreateSecret2() + { + $this->expectsRequest('post', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->create( + [ + 'name' => 'my-api-key', + 'payload' => 'secret_key_xxxxxx', + 'scope' => ['type' => 'account'], + ] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + public function testListBalanceTransaction() + { + $this->expectsRequest('get', '/v1/balance_transactions'); + $result = $this->client->balanceTransactions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result->data[0]); + } + public function testRetrieveBalanceTransaction() + { + $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); + $result = $this->client->balanceTransactions->retrieve( + 'txn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result); + } + public function testListConfiguration2() + { + $this->expectsRequest('get', '/v1/billing_portal/configurations'); + $result = $this->client->billingPortal->configurations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); + } + public function testRetrieveConfiguration2() + { + $this->expectsRequest( + 'get', + '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' + ); + $result = $this->client->billingPortal->configurations->retrieve( + 'bpc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); + } + public function testUpdateConfiguration2() + { + $this->expectsRequest( + 'post', + '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' + ); + $result = $this->client->billingPortal->configurations->update( + 'bpc_xxxxxxxxxxxxx', + [ + 'business_profile' => [ + 'privacy_policy_url' => 'https://example.com/privacy', + 'terms_of_service_url' => 'https://example.com/terms', + ], + ] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); + } + public function testCreateSession3() + { + $this->expectsRequest('post', '/v1/billing_portal/sessions'); + $result = $this->client->billingPortal->sessions->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'return_url' => 'https://example.com/account', + ] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Session::class, $result); + } + public function testListCharge() + { + $this->expectsRequest('get', '/v1/charges'); + $result = $this->client->charges->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); + } + public function testCreateCharge() + { + $this->expectsRequest('post', '/v1/charges'); + $result = $this->client->charges->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'source' => 'tok_xxxx', + 'description' => 'My First Test Charge (created for API docs)', + ] + ); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + public function testRetrieveCharge() + { + $this->expectsRequest('get', '/v1/charges/ch_xxxxxxxxxxxxx'); + $result = $this->client->charges->retrieve('ch_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + public function testUpdateCharge() + { + $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx'); + $result = $this->client->charges->update( + 'ch_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + public function testCaptureCharge() + { + $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx/capture'); + $result = $this->client->charges->capture('ch_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + public function testSearchCharge() + { + $this->expectsRequest('get', '/v1/charges/search'); + $result = $this->client->charges->search( + ['query' => 'amount>999 AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); + } + public function testListSession() + { + $this->expectsRequest('get', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result->data[0]); + } + public function testCreateSession4() + { + $this->expectsRequest('post', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->create( + [ + 'success_url' => 'https://example.com/success', + 'cancel_url' => 'https://example.com/cancel', + 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], + 'mode' => 'payment', + ] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + public function testRetrieveSession2() + { + $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); + $result = $this->client->checkout->sessions->retrieve( + 'cs_test_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + public function testExpireSession2() + { + $this->expectsRequest( + 'post', + '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire' + ); + $result = $this->client->checkout->sessions->expire( + 'cs_test_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + public function testListCountrySpec() + { + $this->expectsRequest('get', '/v1/country_specs'); + $result = $this->client->countrySpecs->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CountrySpec::class, $result->data[0]); + } + public function testRetrieveCountrySpec() + { + $this->expectsRequest('get', '/v1/country_specs/US'); + $result = $this->client->countrySpecs->retrieve('US', []); + static::assertInstanceOf(\Stripe\CountrySpec::class, $result); + } + public function testListCoupon() + { + $this->expectsRequest('get', '/v1/coupons'); + $result = $this->client->coupons->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Coupon::class, $result->data[0]); + } + public function testCreateCoupon() + { + $this->expectsRequest('post', '/v1/coupons'); + $result = $this->client->coupons->create( + [ + 'percent_off' => 25.5, + 'duration' => 'repeating', + 'duration_in_months' => 3, + ] + ); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + public function testDeleteCoupon() + { + $this->expectsRequest('delete', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->delete('Z4OV52SU', []); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + public function testRetrieveCoupon() + { + $this->expectsRequest('get', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->retrieve('Z4OV52SU', []); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + public function testUpdateCoupon() + { + $this->expectsRequest('post', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->update( + 'Z4OV52SU', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + public function testListCreditNote() + { + $this->expectsRequest('get', '/v1/credit_notes'); + $result = $this->client->creditNotes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CreditNote::class, $result->data[0]); + } + public function testCreateCreditNote() + { + $this->expectsRequest('post', '/v1/credit_notes'); + $result = $this->client->creditNotes->create( + [ + 'invoice' => 'in_xxxxxxxxxxxxx', + 'lines' => [ + [ + 'type' => 'invoice_line_item', + 'invoice_line_item' => 'il_xxxxxxxxxxxxx', + 'quantity' => 1, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + public function testVoidCreditNoteCreditNote() + { + $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx/void'); + $result = $this->client->creditNotes->voidCreditNote( + 'cn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + public function testListCreditNoteLineItem() + { + $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx/lines'); + $result = $this->client->creditNotes->allLines( + 'cn_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CreditNoteLineItem::class, $result->data[0]); + } + public function testPreviewCreditNote() + { + $this->expectsRequest('get', '/v1/credit_notes/preview'); + $result = $this->client->creditNotes->preview( + [ + 'invoice' => 'in_xxxxxxxxxxxxx', + 'lines' => [ + [ + 'type' => 'invoice_line_item', + 'invoice_line_item' => 'il_xxxxxxxxxxxxx', + 'quantity' => 1, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + public function testListCustomer() + { + $this->expectsRequest('get', '/v1/customers'); + $result = $this->client->customers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + public function testListCustomer2() + { + $this->expectsRequest('get', '/v1/customers'); + $result = $this->client->customers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + public function testCreateCustomer() + { + $this->expectsRequest('post', '/v1/customers'); + $result = $this->client->customers->create( + ['description' => 'My First Test Customer (created for API docs)'] + ); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + public function testDeleteCustomer() + { + $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + public function testRetrieveCustomer() + { + $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->retrieve('cus_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + public function testUpdateCustomer() + { + $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->update( + 'cus_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + public function testListCustomerBalanceTransaction() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' + ); + $result = $this->client->customers->allBalanceTransactions( + 'cus_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result->data[0]); + } + public function testCreateCustomerBalanceTransaction() + { + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' + ); + $result = $this->client->customers->createBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + ['amount' => -500, 'currency' => 'usd'] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + public function testRetrieveCustomerBalanceTransaction() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->retrieveBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + 'cbtxn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + public function testUpdateCustomerBalanceTransaction() + { + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->updateBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + 'cbtxn_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + public function testListTaxId() + { + $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $result = $this->client->customers->allTaxIds( + 'cus_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); + } + public function testCreateTaxId() + { + $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $result = $this->client->customers->createTaxId( + 'cus_xxxxxxxxxxxxx', + ['type' => 'eu_vat', 'value' => 'DE123456789'] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + public function testDeleteTaxId() + { + $this->expectsRequest( + 'delete', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->deleteTaxId( + 'cus_xxxxxxxxxxxxx', + 'txi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + public function testRetrieveTaxId() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->retrieveTaxId( + 'cus_xxxxxxxxxxxxx', + 'txi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + public function testSearchCustomer() + { + $this->expectsRequest('get', '/v1/customers/search'); + $result = $this->client->customers->search( + ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + public function testSearchCustomer2() + { + $this->expectsRequest('get', '/v1/customers/search'); + $result = $this->client->customers->search( + ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + public function testListDispute() + { + $this->expectsRequest('get', '/v1/disputes'); + $result = $this->client->disputes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Dispute::class, $result->data[0]); + } + public function testRetrieveDispute() + { + $this->expectsRequest('get', '/v1/disputes/dp_xxxxxxxxxxxxx'); + $result = $this->client->disputes->retrieve('dp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + public function testUpdateDispute() + { + $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx'); + $result = $this->client->disputes->update( + 'dp_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + public function testCloseDispute() + { + $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx/close'); + $result = $this->client->disputes->close('dp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + public function testListEvent() + { + $this->expectsRequest('get', '/v1/events'); + $result = $this->client->events->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Event::class, $result->data[0]); + } + public function testRetrieveEvent() + { + $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx'); + $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Event::class, $result); + } + public function testListFileLink() + { + $this->expectsRequest('get', '/v1/file_links'); + $result = $this->client->fileLinks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FileLink::class, $result->data[0]); + } + public function testCreateFileLink() + { + $this->expectsRequest('post', '/v1/file_links'); + $result = $this->client->fileLinks->create( + ['file' => 'file_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + public function testRetrieveFileLink() + { + $this->expectsRequest('get', '/v1/file_links/link_xxxxxxxxxxxxx'); + $result = $this->client->fileLinks->retrieve('link_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + public function testUpdateFileLink() + { + $this->expectsRequest('post', '/v1/file_links/link_xxxxxxxxxxxxx'); + $result = $this->client->fileLinks->update( + 'link_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + public function testListFile() + { + $this->expectsRequest('get', '/v1/files'); + $result = $this->client->files->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\File::class, $result->data[0]); + } + public function testRetrieveFile() + { + $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx'); + $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\File::class, $result); + } + public function testListAccount3() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts'); + $result = $this->client->financialConnections->accounts->all( + ['account_holder' => ['customer' => 'cus_xxxxxxxxxxxxx']] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); + } + public function testRetrieveAccount3() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx' + ); + $result = $this->client->financialConnections->accounts->retrieve( + 'fca_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + public function testListOwnersAccount2() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners' + ); + $result = $this->client->financialConnections->accounts->allOwners( + 'fca_xxxxxxxxxxxxx', + ['limit' => 3, 'ownership' => 'fcaowns_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); + } + public function testCreateSession5() + { + $this->expectsRequest('post', '/v1/financial_connections/sessions'); + $result = $this->client->financialConnections->sessions->create( + [ + 'account_holder' => [ + 'type' => 'customer', + 'customer' => 'cus_xxxxxxxxxxxxx', + ], + 'permissions' => ['payment_method', 'balances'], + 'filters' => ['countries' => ['US']], + ] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + public function testRetrieveSession3() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx' + ); + $result = $this->client->financialConnections->sessions->retrieve( + 'fcsess_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + public function testListVerificationReport() + { + $this->expectsRequest('get', '/v1/identity/verification_reports'); + $result = $this->client->identity->verificationReports->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); + } + public function testRetrieveVerificationReport() + { + $this->expectsRequest( + 'get', + '/v1/identity/verification_reports/vr_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationReports->retrieve( + 'vr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result); + } + public function testListVerificationSession() + { + $this->expectsRequest('get', '/v1/identity/verification_sessions'); + $result = $this->client->identity->verificationSessions->all( + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result->data[0]); + } + public function testCreateVerificationSession() + { + $this->expectsRequest('post', '/v1/identity/verification_sessions'); + $result = $this->client->identity->verificationSessions->create( + ['type' => 'document'] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + public function testRetrieveVerificationSession() + { + $this->expectsRequest( + 'get', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationSessions->retrieve( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + public function testUpdateVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationSessions->update( + 'vs_xxxxxxxxxxxxx', + ['type' => 'id_number'] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + public function testCancelVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->identity->verificationSessions->cancel( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + public function testRedactVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact' + ); + $result = $this->client->identity->verificationSessions->redact( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + public function testListInvoiceItem() + { + $this->expectsRequest('get', '/v1/invoiceitems'); + $result = $this->client->invoiceItems->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result->data[0]); + } + public function testCreateInvoiceItem() + { + $this->expectsRequest('post', '/v1/invoiceitems'); + $result = $this->client->invoiceItems->create( + ['customer' => 'cus_xxxxxxxxxxxxx', 'price' => 'price_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + public function testDeleteInvoiceItem() + { + $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + public function testRetrieveInvoiceItem() + { + $this->expectsRequest('get', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->retrieve('ii_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + public function testUpdateInvoiceItem() + { + $this->expectsRequest('post', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->update( + 'ii_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + public function testListInvoice() + { + $this->expectsRequest('get', '/v1/invoices'); + $result = $this->client->invoices->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); + } + public function testCreateInvoice() + { + $this->expectsRequest('post', '/v1/invoices'); + $result = $this->client->invoices->create( + ['customer' => 'cus_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testDeleteInvoice() + { + $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testRetrieveInvoice() + { + $this->expectsRequest('get', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->retrieve('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testUpdateInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->update( + 'in_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testFinalizeInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); + $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testMarkUncollectibleInvoice() + { + $this->expectsRequest( + 'post', + '/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible' + ); + $result = $this->client->invoices->markUncollectible( + 'in_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testPayInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/pay'); + $result = $this->client->invoices->pay('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testSendInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/send'); + $result = $this->client->invoices->sendInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testVoidInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/void'); + $result = $this->client->invoices->voidInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + public function testSearchInvoice() + { + $this->expectsRequest('get', '/v1/invoices/search'); + $result = $this->client->invoices->search( + ['query' => 'total>999 AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); + } + public function testListAuthorization() + { + $this->expectsRequest('get', '/v1/issuing/authorizations'); + $result = $this->client->issuing->authorizations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result->data[0]); + } + public function testRetrieveAuthorization() + { + $this->expectsRequest( + 'get', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' + ); + $result = $this->client->issuing->authorizations->retrieve( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + public function testUpdateAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' + ); + $result = $this->client->issuing->authorizations->update( + 'iauth_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + public function testApproveAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve' + ); + $result = $this->client->issuing->authorizations->approve( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + public function testDeclineAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline' + ); + $result = $this->client->issuing->authorizations->decline( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + public function testListCardholder() + { + $this->expectsRequest('get', '/v1/issuing/cardholders'); + $result = $this->client->issuing->cardholders->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result->data[0]); + } + public function testCreateCardholder() + { + $this->expectsRequest('post', '/v1/issuing/cardholders'); + $result = $this->client->issuing->cardholders->create( + [ + 'type' => 'individual', + 'name' => 'Jenny Rosen', + 'email' => 'jenny.rosen@example.com', + 'phone_number' => '+18888675309', + 'billing' => [ + 'address' => [ + 'line1' => '1234 Main Street', + 'city' => 'San Francisco', + 'state' => 'CA', + 'country' => 'US', + 'postal_code' => '94111', + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + public function testRetrieveCardholder() + { + $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cardholders->retrieve( + 'ich_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + public function testUpdateCardholder() + { + $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cardholders->update( + 'ich_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + public function testListCard() + { + $this->expectsRequest('get', '/v1/issuing/cards'); + $result = $this->client->issuing->cards->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result->data[0]); + } + public function testCreateCard() + { + $this->expectsRequest('post', '/v1/issuing/cards'); + $result = $this->client->issuing->cards->create( + [ + 'cardholder' => 'ich_xxxxxxxxxxxxx', + 'currency' => 'usd', + 'type' => 'virtual', + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testRetrieveCard() + { + $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testUpdateCard() + { + $this->expectsRequest('post', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cards->update( + 'ic_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + public function testListDispute2() + { + $this->expectsRequest('get', '/v1/issuing/disputes'); + $result = $this->client->issuing->disputes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result->data[0]); + } + public function testCreateDispute() + { + $this->expectsRequest('post', '/v1/issuing/disputes'); + $result = $this->client->issuing->disputes->create( + [ + 'transaction' => 'ipi_xxxxxxxxxxxxx', + 'evidence' => [ + 'reason' => 'fraudulent', + 'fraudulent' => ['explanation' => 'Purchase was unrecognized.'], + ], + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + public function testRetrieveDispute2() + { + $this->expectsRequest('get', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx'); + $result = $this->client->issuing->disputes->retrieve( + 'idp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + public function testSubmitDispute() + { + $this->expectsRequest( + 'post', + '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' + ); + $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + public function testListTransaction() + { + $this->expectsRequest('get', '/v1/issuing/transactions'); + $result = $this->client->issuing->transactions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result->data[0]); + } + public function testRetrieveTransaction() + { + $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $result = $this->client->issuing->transactions->retrieve( + 'ipi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + public function testUpdateTransaction() + { + $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $result = $this->client->issuing->transactions->update( + 'ipi_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + public function testRetrieveMandate() + { + $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); + $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Mandate::class, $result); + } + public function testListPaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents'); + $result = $this->client->paymentIntents->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); + } + public function testCreatePaymentIntent2() + { + $this->expectsRequest('post', '/v1/payment_intents'); + $result = $this->client->paymentIntents->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'payment_method_types' => ['card'], + ] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testRetrievePaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); + $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testUpdatePaymentIntent() + { + $this->expectsRequest('post', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); + $result = $this->client->paymentIntents->update( + 'pi_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testApplyCustomerBalancePaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance' + ); + $result = $this->client->paymentIntents->applyCustomerBalance( + 'pi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testCancelPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->paymentIntents->cancel('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testCapturePaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' + ); + $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testConfirmPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm' + ); + $result = $this->client->paymentIntents->confirm( + 'pi_xxxxxxxxxxxxx', + ['payment_method' => 'pm_card_visa'] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testIncrementAuthorizationPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization' + ); + $result = $this->client->paymentIntents->incrementAuthorization( + 'pi_xxxxxxxxxxxxx', + ['amount' => 2099] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + public function testSearchPaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents/search'); + $result = $this->client->paymentIntents->search( + ['query' => 'status:\'succeeded\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); + } + public function testListPaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links'); + $result = $this->client->paymentLinks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result->data[0]); + } + public function testCreatePaymentLink2() + { + $this->expectsRequest('post', '/v1/payment_links'); + $result = $this->client->paymentLinks->create( + ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + public function testRetrievePaymentLink2() + { + $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); + $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + public function testUpdatePaymentLink() + { + $this->expectsRequest('post', '/v1/payment_links/plink_xxxxxxxxxxxxx'); + $result = $this->client->paymentLinks->update( + 'plink_xxxxxxxxxxxxx', + ['active' => false] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + public function testListPaymentMethod() + { + $this->expectsRequest('get', '/v1/payment_methods'); + $result = $this->client->paymentMethods->all( + ['customer' => 'cus_xxxxxxxxxxxxx', 'type' => 'card'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result->data[0]); + } + public function testCreatePaymentMethod() + { + $this->expectsRequest('post', '/v1/payment_methods'); + $result = $this->client->paymentMethods->create( + [ + 'type' => 'card', + 'card' => [ + 'number' => '4242424242424242', + 'exp_month' => 5, + 'exp_year' => 2023, + 'cvc' => '314', + ], + ] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + public function testRetrievePaymentMethod() + { + $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); + $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + public function testUpdatePaymentMethod() + { + $this->expectsRequest('post', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); + $result = $this->client->paymentMethods->update( + 'pm_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + public function testAttachPaymentMethod() + { + $this->expectsRequest( + 'post', + '/v1/payment_methods/pm_xxxxxxxxxxxxx/attach' + ); + $result = $this->client->paymentMethods->attach( + 'pm_xxxxxxxxxxxxx', + ['customer' => 'cus_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + public function testDetachPaymentMethod() + { + $this->expectsRequest( + 'post', + '/v1/payment_methods/pm_xxxxxxxxxxxxx/detach' + ); + $result = $this->client->paymentMethods->detach('pm_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + public function testListPayout() + { + $this->expectsRequest('get', '/v1/payouts'); + $result = $this->client->payouts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Payout::class, $result->data[0]); + } + public function testCreatePayout() + { + $this->expectsRequest('post', '/v1/payouts'); + $result = $this->client->payouts->create( + ['amount' => 1100, 'currency' => 'usd'] + ); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + public function testRetrievePayout() + { + $this->expectsRequest('get', '/v1/payouts/po_xxxxxxxxxxxxx'); + $result = $this->client->payouts->retrieve('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + public function testUpdatePayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx'); + $result = $this->client->payouts->update( + 'po_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + public function testCancelPayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/cancel'); + $result = $this->client->payouts->cancel('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + public function testReversePayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/reverse'); + $result = $this->client->payouts->reverse('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + public function testListPlan() + { + $this->expectsRequest('get', '/v1/plans'); + $result = $this->client->plans->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Plan::class, $result->data[0]); + } + public function testCreatePlan() + { + $this->expectsRequest('post', '/v1/plans'); + $result = $this->client->plans->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'interval' => 'month', + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + public function testDeletePlan() + { + $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + public function testRetrievePlan() + { + $this->expectsRequest('get', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->retrieve('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + public function testUpdatePlan() + { + $this->expectsRequest('post', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->update( + 'price_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + public function testListPrice() + { + $this->expectsRequest('get', '/v1/prices'); + $result = $this->client->prices->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); + } + public function testCreatePrice2() + { + $this->expectsRequest('post', '/v1/prices'); + $result = $this->client->prices->create( + [ + 'unit_amount' => 2000, + 'currency' => 'usd', + 'recurring' => ['interval' => 'month'], + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + public function testRetrievePrice() + { + $this->expectsRequest('get', '/v1/prices/price_xxxxxxxxxxxxx'); + $result = $this->client->prices->retrieve('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + public function testUpdatePrice() + { + $this->expectsRequest('post', '/v1/prices/price_xxxxxxxxxxxxx'); + $result = $this->client->prices->update( + 'price_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + public function testSearchPrice() + { + $this->expectsRequest('get', '/v1/prices/search'); + $result = $this->client->prices->search( + ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); + } + public function testListProduct() + { + $this->expectsRequest('get', '/v1/products'); + $result = $this->client->products->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); + } + public function testCreateProduct() + { + $this->expectsRequest('post', '/v1/products'); + $result = $this->client->products->create(['name' => 'Gold Special']); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + public function testDeleteProduct() + { + $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + public function testRetrieveProduct() + { + $this->expectsRequest('get', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->retrieve('prod_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + public function testUpdateProduct() + { + $this->expectsRequest('post', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->update( + 'prod_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + public function testSearchProduct() + { + $this->expectsRequest('get', '/v1/products/search'); + $result = $this->client->products->search( + ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); + } + public function testListPromotionCode() + { + $this->expectsRequest('get', '/v1/promotion_codes'); + $result = $this->client->promotionCodes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result->data[0]); + } + public function testCreatePromotionCode() + { + $this->expectsRequest('post', '/v1/promotion_codes'); + $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + public function testRetrievePromotionCode() + { + $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $result = $this->client->promotionCodes->retrieve( + 'promo_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + public function testUpdatePromotionCode() + { + $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $result = $this->client->promotionCodes->update( + 'promo_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + public function testListQuote() + { + $this->expectsRequest('get', '/v1/quotes'); + $result = $this->client->quotes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Quote::class, $result->data[0]); + } + public function testCreateQuote() + { + $this->expectsRequest('post', '/v1/quotes'); + $result = $this->client->quotes->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], + ] + ); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testRetrieveQuote() + { + $this->expectsRequest('get', '/v1/quotes/qt_xxxxxxxxxxxxx'); + $result = $this->client->quotes->retrieve('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testUpdateQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx'); + $result = $this->client->quotes->update( + 'qt_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testAcceptQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/accept'); + $result = $this->client->quotes->accept('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testCancelQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/cancel'); + $result = $this->client->quotes->cancel('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testFinalizeQuoteQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/finalize'); + $result = $this->client->quotes->finalizeQuote('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + public function testListEarlyFraudWarning() + { + $this->expectsRequest('get', '/v1/radar/early_fraud_warnings'); + $result = $this->client->radar->earlyFraudWarnings->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result->data[0]); + } + public function testRetrieveEarlyFraudWarning() + { + $this->expectsRequest( + 'get', + '/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->earlyFraudWarnings->retrieve( + 'issfr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result); + } + public function testListValueListItem() + { + $this->expectsRequest('get', '/v1/radar/value_list_items'); + $result = $this->client->radar->valueListItems->all( + ['limit' => 3, 'value_list' => 'rsl_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result->data[0]); + } + public function testCreateValueListItem() + { + $this->expectsRequest('post', '/v1/radar/value_list_items'); + $result = $this->client->radar->valueListItems->create( + ['value_list' => 'rsl_xxxxxxxxxxxxx', 'value' => '1.2.3.4'] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + public function testDeleteValueListItem() + { + $this->expectsRequest( + 'delete', + '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueListItems->delete( + 'rsli_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + public function testRetrieveValueListItem() + { + $this->expectsRequest( + 'get', + '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueListItems->retrieve( + 'rsli_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + public function testListValueList() + { + $this->expectsRequest('get', '/v1/radar/value_lists'); + $result = $this->client->radar->valueLists->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result->data[0]); + } + public function testCreateValueList() + { + $this->expectsRequest('post', '/v1/radar/value_lists'); + $result = $this->client->radar->valueLists->create( + [ + 'alias' => 'custom_ip_xxxxxxxxxxxxx', + 'name' => 'Custom IP Blocklist', + 'item_type' => 'ip_address', + ] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + public function testDeleteValueList() + { + $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + public function testRetrieveValueList() + { + $this->expectsRequest('get', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->retrieve( + 'rsl_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + public function testUpdateValueList() + { + $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->update( + 'rsl_xxxxxxxxxxxxx', + ['name' => 'Updated IP Block List'] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + public function testListRefund() + { + $this->expectsRequest('get', '/v1/refunds'); + $result = $this->client->refunds->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Refund::class, $result->data[0]); + } + public function testCreateRefund() + { + $this->expectsRequest('post', '/v1/refunds'); + $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + public function testRetrieveRefund() + { + $this->expectsRequest('get', '/v1/refunds/re_xxxxxxxxxxxxx'); + $result = $this->client->refunds->retrieve('re_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + public function testUpdateRefund() + { + $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx'); + $result = $this->client->refunds->update( + 're_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + public function testCancelRefund() + { + $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx/cancel'); + $result = $this->client->refunds->cancel('re_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + public function testListReportRun() + { + $this->expectsRequest('get', '/v1/reporting/report_runs'); + $result = $this->client->reporting->reportRuns->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result->data[0]); + } + public function testCreateReportRun() + { + $this->expectsRequest('post', '/v1/reporting/report_runs'); + $result = $this->client->reporting->reportRuns->create( + [ + 'report_type' => 'balance.summary.1', + 'parameters' => [ + 'interval_start' => 1522540800, + 'interval_end' => 1525132800, + ], + ] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); + } + public function testRetrieveReportRun() + { + $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); + $result = $this->client->reporting->reportRuns->retrieve( + 'frr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); + } + public function testListReportType() + { + $this->expectsRequest('get', '/v1/reporting/report_types'); + $result = $this->client->reporting->reportTypes->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result->data[0]); + } + public function testRetrieveReportType() + { + $this->expectsRequest( + 'get', + '/v1/reporting/report_types/balance.summary.1' + ); + $result = $this->client->reporting->reportTypes->retrieve( + 'balance.summary.1', + [] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result); + } + public function testListReview() + { + $this->expectsRequest('get', '/v1/reviews'); + $result = $this->client->reviews->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Review::class, $result->data[0]); + } + public function testRetrieveReview() + { + $this->expectsRequest('get', '/v1/reviews/prv_xxxxxxxxxxxxx'); + $result = $this->client->reviews->retrieve('prv_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Review::class, $result); + } + public function testApproveReview() + { + $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve'); + $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Review::class, $result); + } + public function testListSetupIntent() + { + $this->expectsRequest('get', '/v1/setup_intents'); + $result = $this->client->setupIntents->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result->data[0]); + } + public function testCreateSetupIntent() + { + $this->expectsRequest('post', '/v1/setup_intents'); + $result = $this->client->setupIntents->create( + ['payment_method_types' => ['card']] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testRetrieveSetupIntent() + { + $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); + $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testUpdateSetupIntent() + { + $this->expectsRequest('post', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); + $result = $this->client->setupIntents->update( + 'seti_xxxxxxxxxxxxx', + ['metadata' => ['user_id' => '3435453']] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testCancelSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->setupIntents->cancel('seti_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testConfirmSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm' + ); + $result = $this->client->setupIntents->confirm( + 'seti_xxxxxxxxxxxxx', + ['payment_method' => 'pm_card_visa'] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + public function testListShippingRate2() + { + $this->expectsRequest('get', '/v1/shipping_rates'); + $result = $this->client->shippingRates->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); + } + public function testCreateShippingRate2() + { + $this->expectsRequest('post', '/v1/shipping_rates'); + $result = $this->client->shippingRates->create( + [ + 'display_name' => 'Ground shipping', + 'type' => 'fixed_amount', + 'fixed_amount' => ['amount' => 500, 'currency' => 'usd'], + ] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + public function testRetrieveShippingRate() + { + $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); + $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + public function testUpdateShippingRate() + { + $this->expectsRequest('post', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); + $result = $this->client->shippingRates->update( + 'shr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + public function testListScheduledQueryRun() + { + $this->expectsRequest('get', '/v1/sigma/scheduled_query_runs'); + $result = $this->client->sigma->scheduledQueryRuns->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result->data[0]); + } + public function testRetrieveScheduledQueryRun() + { + $this->expectsRequest( + 'get', + '/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx' + ); + $result = $this->client->sigma->scheduledQueryRuns->retrieve( + 'sqr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result); + } + public function testRetrieveSource() + { + $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + public function testRetrieveSource2() + { + $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + public function testUpdateSource() + { + $this->expectsRequest('post', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->update( + 'src_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + public function testListSubscriptionItem() + { + $this->expectsRequest('get', '/v1/subscription_items'); + $result = $this->client->subscriptionItems->all( + ['subscription' => 'sub_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result->data[0]); + } + public function testCreateSubscriptionItem() + { + $this->expectsRequest('post', '/v1/subscription_items'); + $result = $this->client->subscriptionItems->create( + [ + 'subscription' => 'sub_xxxxxxxxxxxxx', + 'price' => 'price_xxxxxxxxxxxxx', + 'quantity' => 2, + ] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + public function testDeleteSubscriptionItem() + { + $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + public function testRetrieveSubscriptionItem() + { + $this->expectsRequest('get', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->retrieve( + 'si_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + public function testUpdateSubscriptionItem() + { + $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->update( + 'si_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + public function testListUsageRecordSummary() + { + $this->expectsRequest( + 'get', + '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries' + ); + $result = $this->client->subscriptionItems->allUsageRecordSummaries( + 'si_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\UsageRecordSummary::class, $result->data[0]); + } + public function testCreateUsageRecord() + { + $this->expectsRequest( + 'post', + '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records' + ); + $result = $this->client->subscriptionItems->createUsageRecord( + 'si_xxxxxxxxxxxxx', + ['quantity' => 100, 'timestamp' => 1571252444] + ); + static::assertInstanceOf(\Stripe\UsageRecord::class, $result); + } + public function testListSubscriptionSchedule() + { + $this->expectsRequest('get', '/v1/subscription_schedules'); + $result = $this->client->subscriptionSchedules->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result->data[0]); + } + public function testCreateSubscriptionSchedule() + { + $this->expectsRequest('post', '/v1/subscription_schedules'); + $result = $this->client->subscriptionSchedules->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'start_date' => 1652909005, + 'end_behavior' => 'release', + 'phases' => [ + [ + 'items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]], + 'iterations' => 12, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + public function testRetrieveSubscriptionSchedule() + { + $this->expectsRequest( + 'get', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionSchedules->retrieve( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + public function testUpdateSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionSchedules->update( + 'sub_sched_xxxxxxxxxxxxx', + ['end_behavior' => 'release'] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + public function testCancelSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->subscriptionSchedules->cancel( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + public function testReleaseSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release' + ); + $result = $this->client->subscriptionSchedules->release( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + public function testListSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions'); + $result = $this->client->subscriptions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); + } + public function testCreateSubscription() + { + $this->expectsRequest('post', '/v1/subscriptions'); + $result = $this->client->subscriptions->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'items' => [['price' => 'price_xxxxxxxxxxxxx']], + ] + ); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + public function testCancelSubscription() + { + $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + public function testRetrieveSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + public function testUpdateSubscription() + { + $this->expectsRequest('post', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->update( + 'sub_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + public function testSearchSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions/search'); + $result = $this->client->subscriptions->search( + ['query' => 'status:\'active\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); + } + public function testListTaxCode() + { + $this->expectsRequest('get', '/v1/tax_codes'); + $result = $this->client->taxCodes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxCode::class, $result->data[0]); + } + public function testRetrieveTaxCode() + { + $this->expectsRequest('get', '/v1/tax_codes/txcd_xxxxxxxxxxxxx'); + $result = $this->client->taxCodes->retrieve('txcd_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\TaxCode::class, $result); + } + public function testListTaxRate() + { + $this->expectsRequest('get', '/v1/tax_rates'); + $result = $this->client->taxRates->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxRate::class, $result->data[0]); + } + public function testCreateTaxRate() + { + $this->expectsRequest('post', '/v1/tax_rates'); + $result = $this->client->taxRates->create( + [ + 'display_name' => 'VAT', + 'description' => 'VAT Germany', + 'jurisdiction' => 'DE', + 'percentage' => 16, + 'inclusive' => false, + ] + ); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + public function testRetrieveTaxRate() + { + $this->expectsRequest('get', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); + $result = $this->client->taxRates->retrieve('txr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + public function testUpdateTaxRate() + { + $this->expectsRequest('post', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); + $result = $this->client->taxRates->update( + 'txr_xxxxxxxxxxxxx', + ['active' => false] + ); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + public function testListConfiguration3() + { + $this->expectsRequest('get', '/v1/terminal/configurations'); + $result = $this->client->terminal->configurations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); + } + public function testDeleteConfiguration2() + { + $this->expectsRequest( + 'delete', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->delete( + 'tmc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testRetrieveConfiguration3() + { + $this->expectsRequest( + 'get', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->retrieve( + 'tmc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testUpdateConfiguration3() + { + $this->expectsRequest( + 'post', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->update( + 'tmc_xxxxxxxxxxxxx', + ['bbpos_wisepos_e' => ['splashscreen' => 'file_xxxxxxxxxxxxx']] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + public function testCreateConnectionToken() + { + $this->expectsRequest('post', '/v1/terminal/connection_tokens'); + $result = $this->client->terminal->connectionTokens->create([]); + static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result); + } + public function testListLocation() + { + $this->expectsRequest('get', '/v1/terminal/locations'); + $result = $this->client->terminal->locations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result->data[0]); + } + public function testCreateLocation() + { + $this->expectsRequest('post', '/v1/terminal/locations'); + $result = $this->client->terminal->locations->create( + [ + 'display_name' => 'My First Store', + 'address' => [ + 'line1' => '1234 Main Street', + 'city' => 'San Francisco', + 'country' => 'US', + 'postal_code' => '94111', + ], + ] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + public function testDeleteLocation() + { + $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->delete( + 'tml_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + public function testRetrieveLocation() + { + $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->retrieve( + 'tml_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + public function testUpdateLocation() + { + $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->update( + 'tml_xxxxxxxxxxxxx', + ['display_name' => 'My First Store'] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + public function testListReader() + { + $this->expectsRequest('get', '/v1/terminal/readers'); + $result = $this->client->terminal->readers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result->data[0]); + } + public function testCreateReader() + { + $this->expectsRequest('post', '/v1/terminal/readers'); + $result = $this->client->terminal->readers->create( + [ + 'registration_code' => 'puppies-plug-could', + 'label' => 'Blue Rabbit', + 'location' => 'tml_1234', + ] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testDeleteReader() + { + $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testRetrieveReader() + { + $this->expectsRequest('get', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->retrieve( + 'tmr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testUpdateReader() + { + $this->expectsRequest('post', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->update( + 'tmr_xxxxxxxxxxxxx', + ['label' => 'Blue Rabbit'] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testCancelActionReader() + { + $this->expectsRequest( + 'post', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action' + ); + $result = $this->client->terminal->readers->cancelAction( + 'tmr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testProcessPaymentIntentReader() + { + $this->expectsRequest( + 'post', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent' + ); + $result = $this->client->terminal->readers->processPaymentIntent( + 'tmr_xxxxxxxxxxxxx', + ['payment_intent' => 'pi_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + public function testListTestClock2() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); + } + public function testCreateTestClock2() + { + $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->create( + ['frozen_time' => 1577836800] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testDeleteTestClock2() + { + $this->expectsRequest( + 'delete', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' + ); + $result = $this->client->testHelpers->testClocks->delete( + 'clock_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testRetrieveTestClock2() + { + $this->expectsRequest( + 'get', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' + ); + $result = $this->client->testHelpers->testClocks->retrieve( + 'clock_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testAdvanceTestClock2() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance' + ); + $result = $this->client->testHelpers->testClocks->advance( + 'clock_xxxxxxxxxxxxx', + ['frozen_time' => 1652390605] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + public function testCreateToken2() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'bank_account' => [ + 'country' => 'US', + 'currency' => 'usd', + 'account_holder_name' => 'Jenny Rosen', + 'account_holder_type' => 'individual', + 'routing_number' => '110000000', + 'account_number' => '000123456789', + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testCreateToken3() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + ['pii' => ['id_number' => '000000000']] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testCreateToken4() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'account' => [ + 'individual' => ['first_name' => 'Jane', 'last_name' => 'Doe'], + 'tos_shown_and_accepted' => true, + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testCreateToken5() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'person' => [ + 'first_name' => 'Jane', + 'last_name' => 'Doe', + 'relationship' => ['owner' => true], + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testCreateToken6() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testRetrieveToken() + { + $this->expectsRequest('get', '/v1/tokens/tok_xxxx'); + $result = $this->client->tokens->retrieve('tok_xxxx', []); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + public function testListTopup() + { + $this->expectsRequest('get', '/v1/topups'); + $result = $this->client->topups->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Topup::class, $result->data[0]); + } + public function testCreateTopup() + { + $this->expectsRequest('post', '/v1/topups'); + $result = $this->client->topups->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'description' => 'Top-up for Jenny Rosen', + 'statement_descriptor' => 'Top-up', + ] + ); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + public function testRetrieveTopup() + { + $this->expectsRequest('get', '/v1/topups/tu_xxxxxxxxxxxxx'); + $result = $this->client->topups->retrieve('tu_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + public function testUpdateTopup() + { + $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx'); + $result = $this->client->topups->update( + 'tu_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + public function testCancelTopup() + { + $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel'); + $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + public function testListTransfer() + { + $this->expectsRequest('get', '/v1/transfers'); + $result = $this->client->transfers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Transfer::class, $result->data[0]); + } + public function testCreateTransfer() + { + $this->expectsRequest('post', '/v1/transfers'); + $result = $this->client->transfers->create( + [ + 'amount' => 400, + 'currency' => 'usd', + 'destination' => 'acct_xxxxxxxxxxxxx', + 'transfer_group' => 'ORDER_95', + ] + ); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + public function testRetrieveTransfer() + { + $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx'); + $result = $this->client->transfers->retrieve('tr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + public function testUpdateTransfer() + { + $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx'); + $result = $this->client->transfers->update( + 'tr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + public function testListTransferReversal() + { + $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $result = $this->client->transfers->allReversals( + 'tr_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result->data[0]); + } + public function testCreateTransferReversal() + { + $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $result = $this->client->transfers->createReversal( + 'tr_xxxxxxxxxxxxx', + ['amount' => 100] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + public function testRetrieveTransferReversal() + { + $this->expectsRequest( + 'get', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' + ); + $result = $this->client->transfers->retrieveReversal( + 'tr_xxxxxxxxxxxxx', + 'trr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + public function testUpdateTransferReversal() + { + $this->expectsRequest( + 'post', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' + ); + $result = $this->client->transfers->updateReversal( + 'tr_xxxxxxxxxxxxx', + 'trr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + public function testListCreditReversal() + { + $this->expectsRequest('get', '/v1/treasury/credit_reversals'); + $result = $this->client->treasury->creditReversals->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result->data[0]); + } + public function testCreateCreditReversal() + { + $this->expectsRequest('post', '/v1/treasury/credit_reversals'); + $result = $this->client->treasury->creditReversals->create( + ['received_credit' => 'rc_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); + } + public function testRetrieveCreditReversal() + { + $this->expectsRequest( + 'get', + '/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->creditReversals->retrieve( + 'credrev_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); + } + public function testListDebitReversal() + { + $this->expectsRequest('get', '/v1/treasury/debit_reversals'); + $result = $this->client->treasury->debitReversals->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result->data[0]); + } + public function testCreateDebitReversal() + { + $this->expectsRequest('post', '/v1/treasury/debit_reversals'); + $result = $this->client->treasury->debitReversals->create( + ['received_debit' => 'rd_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); + } + public function testRetrieveDebitReversal() + { + $this->expectsRequest( + 'get', + '/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->debitReversals->retrieve( + 'debrev_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); + } + public function testListFinancialAccount() + { + $this->expectsRequest('get', '/v1/treasury/financial_accounts'); + $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); + } + public function testCreateFinancialAccount() + { + $this->expectsRequest('post', '/v1/treasury/financial_accounts'); + $result = $this->client->treasury->financialAccounts->create( + ['supported_currencies' => ['usd'], 'features' => []] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + public function testRetrieveFinancialAccount() + { + $this->expectsRequest( + 'get', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->financialAccounts->retrieve( + 'fa_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + public function testUpdateFinancialAccount() + { + $this->expectsRequest( + 'post', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->financialAccounts->update( + 'fa_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + public function testRetrieveFeaturesFinancialAccount() + { + $this->expectsRequest( + 'get', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' + ); + $result = $this->client->treasury->financialAccounts->retrieveFeatures( + 'fa_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); + } + public function testUpdateFeaturesFinancialAccount() + { + $this->expectsRequest( + 'post', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' + ); + $result = $this->client->treasury->financialAccounts->updateFeatures( + 'fa_xxxxxxxxxxxxx', + ['card_issuing' => ['requested' => false]] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); + } + public function testListInboundTransfer() + { + $this->expectsRequest('get', '/v1/treasury/inbound_transfers'); + $result = $this->client->treasury->inboundTransfers->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result->data[0]); + } + public function testCreateInboundTransfer() + { + $this->expectsRequest('post', '/v1/treasury/inbound_transfers'); + $result = $this->client->treasury->inboundTransfers->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'amount' => 10000, + 'currency' => 'usd', + 'origin_payment_method' => 'pm_xxxxxxxxxxxxx', + 'description' => 'InboundTransfer from my bank account', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testRetrieveInboundTransfer() + { + $this->expectsRequest( + 'get', + '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->inboundTransfers->retrieve( + 'ibt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testCancelInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->inboundTransfers->cancel( + 'ibt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + public function testListOutboundPayment() + { + $this->expectsRequest('get', '/v1/treasury/outbound_payments'); + $result = $this->client->treasury->outboundPayments->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result->data[0]); + } + public function testCreateOutboundPayment() + { + $this->expectsRequest('post', '/v1/treasury/outbound_payments'); + $result = $this->client->treasury->outboundPayments->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'amount' => 10000, + 'currency' => 'usd', + 'customer' => 'cu_xxxxxxxxxxxxx', + 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', + 'description' => 'OutboundPayment to a 3rd party', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + public function testRetrieveOutboundPayment() + { + $this->expectsRequest( + 'get', + '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->outboundPayments->retrieve( + 'obp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + public function testCancelOutboundPayment() + { + $this->expectsRequest( + 'post', + '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->outboundPayments->cancel( + 'obp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + public function testListOutboundTransfer() + { + $this->expectsRequest('get', '/v1/treasury/outbound_transfers'); + $result = $this->client->treasury->outboundTransfers->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result->data[0]); + } + public function testCreateOutboundTransfer() + { + $this->expectsRequest('post', '/v1/treasury/outbound_transfers'); + $result = $this->client->treasury->outboundTransfers->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', + 'amount' => 500, + 'currency' => 'usd', + 'description' => 'OutboundTransfer to my external bank account', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testRetrieveOutboundTransfer() + { + $this->expectsRequest( + 'get', + '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->outboundTransfers->retrieve( + 'obt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testCancelOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->outboundTransfers->cancel( + 'obt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + public function testListReceivedCredit() + { + $this->expectsRequest('get', '/v1/treasury/received_credits'); + $result = $this->client->treasury->receivedCredits->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result->data[0]); + } + public function testRetrieveReceivedCredit() + { + $this->expectsRequest( + 'get', + '/v1/treasury/received_credits/rc_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->receivedCredits->retrieve( + 'rc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); + } + public function testListReceivedDebit() + { + $this->expectsRequest('get', '/v1/treasury/received_debits'); + $result = $this->client->treasury->receivedDebits->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result->data[0]); + } + public function testRetrieveReceivedDebit() + { + $this->expectsRequest( + 'get', + '/v1/treasury/received_debits/rd_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->receivedDebits->retrieve( + 'rd_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); + } + public function testListTransactionEntry() + { + $this->expectsRequest('get', '/v1/treasury/transaction_entries'); + $result = $this->client->treasury->transactionEntries->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result->data[0]); + } + public function testRetrieveTransactionEntry() + { + $this->expectsRequest( + 'get', + '/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->transactionEntries->retrieve( + 'trxne_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result); + } + public function testListTransaction2() + { + $this->expectsRequest('get', '/v1/treasury/transactions'); + $result = $this->client->treasury->transactions->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result->data[0]); + } + public function testRetrieveTransaction2() + { + $this->expectsRequest( + 'get', + '/v1/treasury/transactions/trxn_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->transactions->retrieve( + 'trxn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result); + } + public function testListWebhookEndpoint() + { + $this->expectsRequest('get', '/v1/webhook_endpoints'); + $result = $this->client->webhookEndpoints->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result->data[0]); + } + public function testDeleteWebhookEndpoint() + { + $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } + public function testRetrieveWebhookEndpoint() + { + $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } + public function testUpdateWebhookEndpoint() + { + $this->expectsRequest('post', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->update( + 'we_xxxxxxxxxxxxx', + ['url' => 'https://example.com/new_endpoint'] + ); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } +} \ No newline at end of file From 1e12f5c3fc2be4b9b8be6f1f39078081fb86618a Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 5 Jan 2023 12:48:51 -0800 Subject: [PATCH 9/9] lint --- init.php | 1 + lib/Account.php | 8 +- lib/AccountLink.php | 1 + lib/AccountSession.php | 1 + lib/ApplePayDomain.php | 1 + lib/ApplicationFee.php | 2 +- lib/ApplicationFeeRefund.php | 2 +- lib/Apps/Secret.php | 1 + lib/Balance.php | 1 + lib/BalanceTransaction.php | 1 + lib/BankAccount.php | 1 + lib/BillingPortal/Configuration.php | 1 + lib/BillingPortal/Session.php | 1 + lib/Capability.php | 1 + lib/Capital/FinancingOffer.php | 1 + lib/Capital/FinancingSummary.php | 1 + lib/Capital/FinancingTransaction.php | 1 + lib/Card.php | 1 + lib/CashBalance.php | 2 +- lib/Charge.php | 2 + lib/Checkout/Session.php | 1 + lib/CountrySpec.php | 1 + lib/Coupon.php | 1 + lib/CreditNote.php | 2 +- lib/CreditNoteLineItem.php | 2 +- lib/Customer.php | 6 +- lib/CustomerBalanceTransaction.php | 2 +- lib/CustomerCashBalanceTransaction.php | 1 + lib/Dispute.php | 1 + lib/EphemeralKey.php | 5 +- lib/Event.php | 1 + lib/ExchangeRate.php | 1 + lib/File.php | 1 + lib/FileLink.php | 1 + lib/FinancialConnections/Account.php | 1 + lib/FinancialConnections/AccountOwner.php | 2 +- lib/FinancialConnections/AccountOwnership.php | 2 +- lib/FinancialConnections/Session.php | 1 + lib/FundingInstructions.php | 4 +- lib/GiftCards/Card.php | 1 + lib/GiftCards/Transaction.php | 1 + lib/Identity/VerificationReport.php | 1 + lib/Identity/VerificationSession.php | 1 + lib/Invoice.php | 3 +- lib/InvoiceItem.php | 1 + lib/InvoiceLineItem.php | 2 +- lib/Issuing/Authorization.php | 1 + lib/Issuing/Card.php | 1 + lib/Issuing/Cardholder.php | 1 + lib/Issuing/Dispute.php | 1 + lib/Issuing/Transaction.php | 1 + lib/LineItem.php | 2 +- lib/LoginLink.php | 2 +- lib/Mandate.php | 1 + lib/Order.php | 1 + lib/PaymentIntent.php | 4 +- lib/PaymentLink.php | 1 + lib/PaymentMethod.php | 1 + lib/Payout.php | 1 + lib/Person.php | 1 + lib/Plan.php | 1 + lib/Price.php | 2 + lib/Product.php | 2 + lib/PromotionCode.php | 1 + lib/Quote.php | 1 + lib/QuotePhase.php | 1 + lib/Radar/EarlyFraudWarning.php | 1 + lib/Radar/ValueList.php | 1 + lib/Radar/ValueListItem.php | 1 + lib/Refund.php | 1 + lib/Reporting/ReportRun.php | 1 + lib/Reporting/ReportType.php | 1 + lib/Review.php | 1 + lib/Service/AccountLinkService.php | 1 + lib/Service/AccountService.php | 1 + lib/Service/AccountSessionService.php | 1 + lib/Service/ApplePayDomainService.php | 1 + lib/Service/ApplicationFeeService.php | 1 + lib/Service/Apps/AppsServiceFactory.php | 3 +- lib/Service/Apps/SecretService.php | 1 + lib/Service/BalanceService.php | 1 + lib/Service/BalanceTransactionService.php | 1 + .../BillingPortalServiceFactory.php | 5 +- .../BillingPortal/ConfigurationService.php | 3 +- lib/Service/BillingPortal/SessionService.php | 1 + lib/Service/Capital/CapitalServiceFactory.php | 7 +- lib/Service/Capital/FinancingOfferService.php | 3 +- .../Capital/FinancingSummaryService.php | 1 + .../Capital/FinancingTransactionService.php | 1 + lib/Service/ChargeService.php | 1 + .../Checkout/CheckoutServiceFactory.php | 3 +- lib/Service/Checkout/SessionService.php | 3 +- lib/Service/CoreServiceFactory.php | 127 +- lib/Service/CountrySpecService.php | 1 + lib/Service/CouponService.php | 1 + lib/Service/CreditNoteService.php | 3 +- lib/Service/CustomerService.php | 3 +- lib/Service/DisputeService.php | 1 + lib/Service/EphemeralKeyService.php | 1 + lib/Service/EventService.php | 1 + lib/Service/ExchangeRateService.php | 1 + lib/Service/FileLinkService.php | 1 + lib/Service/FileService.php | 1 + .../FinancialConnections/AccountService.php | 3 +- .../FinancialConnectionsServiceFactory.php | 5 +- .../FinancialConnections/SessionService.php | 3 +- lib/Service/GiftCards/CardService.php | 7 +- .../GiftCards/GiftCardsServiceFactory.php | 5 +- lib/Service/GiftCards/TransactionService.php | 11 +- .../Identity/IdentityServiceFactory.php | 5 +- .../Identity/VerificationReportService.php | 3 +- .../Identity/VerificationSessionService.php | 3 +- lib/Service/InvoiceItemService.php | 1 + lib/Service/InvoiceService.php | 1 + lib/Service/Issuing/AuthorizationService.php | 1 + lib/Service/Issuing/CardService.php | 1 + lib/Service/Issuing/CardholderService.php | 1 + lib/Service/Issuing/DisputeService.php | 1 + lib/Service/Issuing/IssuingServiceFactory.php | 11 +- lib/Service/Issuing/TransactionService.php | 1 + lib/Service/MandateService.php | 1 + lib/Service/OrderService.php | 1 + lib/Service/PaymentIntentService.php | 1 + lib/Service/PaymentLinkService.php | 1 + lib/Service/PaymentMethodService.php | 3 +- lib/Service/PayoutService.php | 1 + lib/Service/PlanService.php | 1 + lib/Service/PriceService.php | 1 + lib/Service/ProductService.php | 1 + lib/Service/PromotionCodeService.php | 1 + lib/Service/QuotePhaseService.php | 1 + lib/Service/QuoteService.php | 13 +- .../Radar/EarlyFraudWarningService.php | 1 + lib/Service/Radar/RadarServiceFactory.php | 7 +- lib/Service/Radar/ValueListItemService.php | 1 + lib/Service/Radar/ValueListService.php | 1 + lib/Service/RefundService.php | 1 + lib/Service/Reporting/ReportRunService.php | 3 +- lib/Service/Reporting/ReportTypeService.php | 3 +- .../Reporting/ReportingServiceFactory.php | 5 +- lib/Service/ReviewService.php | 1 + lib/Service/SetupAttemptService.php | 1 + lib/Service/SetupIntentService.php | 1 + lib/Service/ShippingRateService.php | 1 + .../Sigma/ScheduledQueryRunService.php | 1 + lib/Service/Sigma/SigmaServiceFactory.php | 3 +- lib/Service/SourceService.php | 1 + lib/Service/SubscriptionItemService.php | 1 + lib/Service/SubscriptionScheduleService.php | 1 + lib/Service/SubscriptionService.php | 1 + lib/Service/Tax/CalculationService.php | 1 + lib/Service/Tax/TaxServiceFactory.php | 5 +- lib/Service/Tax/TransactionService.php | 1 + lib/Service/TaxCodeService.php | 1 + lib/Service/TaxRateService.php | 3 +- lib/Service/Terminal/ConfigurationService.php | 1 + .../Terminal/ConnectionTokenService.php | 1 + lib/Service/Terminal/LocationService.php | 1 + lib/Service/Terminal/ReaderService.php | 3 +- .../Terminal/TerminalServiceFactory.php | 9 +- lib/Service/TestHelpers/CustomerService.php | 3 +- .../TestHelpers/Issuing/CardService.php | 1 + .../Issuing/IssuingServiceFactory.php | 3 +- lib/Service/TestHelpers/RefundService.php | 1 + .../TestHelpers/Terminal/ReaderService.php | 1 + .../Terminal/TerminalServiceFactory.php | 3 +- lib/Service/TestHelpers/TestClockService.php | 1 + .../TestHelpers/TestHelpersServiceFactory.php | 13 +- .../Treasury/InboundTransferService.php | 1 + .../Treasury/OutboundPaymentService.php | 1 + .../Treasury/OutboundTransferService.php | 1 + .../Treasury/ReceivedCreditService.php | 1 + .../Treasury/ReceivedDebitService.php | 1 + .../Treasury/TreasuryServiceFactory.php | 11 +- lib/Service/TokenService.php | 1 + lib/Service/TopupService.php | 3 +- lib/Service/TransferService.php | 1 + .../Treasury/CreditReversalService.php | 3 +- lib/Service/Treasury/DebitReversalService.php | 1 + .../Treasury/FinancialAccountService.php | 1 + .../Treasury/InboundTransferService.php | 1 + .../Treasury/OutboundPaymentService.php | 1 + .../Treasury/OutboundTransferService.php | 1 + .../Treasury/ReceivedCreditService.php | 1 + lib/Service/Treasury/ReceivedDebitService.php | 3 +- .../Treasury/TransactionEntryService.php | 1 + lib/Service/Treasury/TransactionService.php | 1 + .../Treasury/TreasuryServiceFactory.php | 21 +- lib/Service/WebhookEndpointService.php | 1 + lib/SetupAttempt.php | 1 + lib/SetupIntent.php | 1 + lib/ShippingRate.php | 1 + lib/Sigma/ScheduledQueryRun.php | 1 + lib/Source.php | 1 + lib/StripeClient.php | 1 + lib/Subscription.php | 3 + lib/SubscriptionItem.php | 2 +- lib/SubscriptionSchedule.php | 1 + lib/Tax/Calculation.php | 1 + lib/Tax/Transaction.php | 1 + lib/TaxCode.php | 1 + lib/TaxId.php | 1 + lib/TaxRate.php | 1 + lib/Terminal/Configuration.php | 1 + lib/Terminal/ConnectionToken.php | 1 + lib/Terminal/Location.php | 1 + lib/Terminal/Reader.php | 1 + lib/TestHelpers/TestClock.php | 1 + lib/Token.php | 1 + lib/Topup.php | 1 + lib/Transfer.php | 2 +- lib/TransferReversal.php | 2 +- lib/Treasury/CreditReversal.php | 1 + lib/Treasury/DebitReversal.php | 1 + lib/Treasury/FinancialAccount.php | 1 + lib/Treasury/FinancialAccountFeatures.php | 2 +- lib/Treasury/InboundTransfer.php | 1 + lib/Treasury/OutboundPayment.php | 1 + lib/Treasury/OutboundTransfer.php | 1 + lib/Treasury/ReceivedCredit.php | 1 + lib/Treasury/ReceivedDebit.php | 1 + lib/Treasury/Transaction.php | 1 + lib/Treasury/TransactionEntry.php | 1 + lib/UsageRecord.php | 2 +- lib/UsageRecordSummary.php | 2 +- lib/Util/ApiVersion.php | 4 +- lib/Util/ObjectTypes.php | 240 +- lib/WebhookEndpoint.php | 1 + tests/Stripe/GeneratedExamplesTest.php | 7505 +++++++++-------- 229 files changed, 4456 insertions(+), 3861 deletions(-) diff --git a/init.php b/init.php index bf79eba09..23cc5f941 100644 --- a/init.php +++ b/init.php @@ -1,4 +1,5 @@ serializeParameters() : $v; if ([] !== $update) { - if (!$originalValue || - !\array_key_exists($i, $originalValue) || - ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + if (!$originalValue + || !\array_key_exists($i, $originalValue) + || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { $updateArr[$i] = $update; } } @@ -185,7 +186,6 @@ public function reject($params = null, $opts = null) return $this; } - const PATH_CAPABILITIES = '/capabilities'; /** diff --git a/lib/AccountLink.php b/lib/AccountLink.php index b2d76f67e..24a9e68aa 100644 --- a/lib/AccountLink.php +++ b/lib/AccountLink.php @@ -1,4 +1,5 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); + return $this; } @@ -131,16 +133,17 @@ public function retrievePaymentMethod($payment_method, $params = null, $opts = n 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 * @@ -155,6 +158,7 @@ public static function retrieveCashBalance($id, $cashBalanceId, $params = null, * @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 * diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php index 9636af92c..02cc1f4d7 100644 --- a/lib/CustomerBalanceTransaction.php +++ b/lib/CustomerBalanceTransaction.php @@ -1,4 +1,5 @@ financial_addresses field. Related guide: Customer - * Balance - Funding Instructions to learn more + * 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 @@ -23,6 +24,5 @@ class FundingInstructions extends ApiResource { const OBJECT_NAME = 'funding_instructions'; - const FUNDING_TYPE_BANK_TRANSFER = 'bank_transfer'; } diff --git a/lib/GiftCards/Card.php b/lib/GiftCards/Card.php index 861becc66..506e62985 100644 --- a/lib/GiftCards/Card.php +++ b/lib/GiftCards/Card.php @@ -1,4 +1,5 @@ required or optional. * @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\BankAccount|\Stripe\Card|\Stripe\Account|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|string|\Stripe\Account|\Stripe\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. @@ -192,6 +193,7 @@ public function verifyMicrodeposits($params = null, $opts = null) public static function search($params = null, $opts = null) { $url = '/v1/payment_intents/search'; + return self::_searchResource($url, $params, $opts); } } diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php index 7d25b6e3f..5c3462e69 100644 --- a/lib/PaymentLink.php +++ b/lib/PaymentLink.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'secrets' => SecretService::class, + 'secrets' => SecretService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Apps/SecretService.php b/lib/Service/Apps/SecretService.php index 60fde5dd2..8c9c74b48 100644 --- a/lib/Service/Apps/SecretService.php +++ b/lib/Service/Apps/SecretService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'sessions' => SessionService::class, + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/BillingPortal/ConfigurationService.php b/lib/Service/BillingPortal/ConfigurationService.php index d0324b178..11d1a5a3a 100644 --- a/lib/Service/BillingPortal/ConfigurationService.php +++ b/lib/Service/BillingPortal/ConfigurationService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'financingOffers' => FinancingOfferService::class, - 'financingSummary' => FinancingSummaryService::class, - 'financingTransactions' => FinancingTransactionService::class, + 'financingOffers' => FinancingOfferService::class, + 'financingSummary' => FinancingSummaryService::class, + 'financingTransactions' => FinancingTransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Capital/FinancingOfferService.php b/lib/Service/Capital/FinancingOfferService.php index dee12fde2..f06f1f536 100644 --- a/lib/Service/Capital/FinancingOfferService.php +++ b/lib/Service/Capital/FinancingOfferService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'sessions' => SessionService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Checkout/SessionService.php b/lib/Service/Checkout/SessionService.php index fdcb89b14..2291ccd50 100644 --- a/lib/Service/Checkout/SessionService.php +++ b/lib/Service/Checkout/SessionService.php @@ -1,4 +1,5 @@ open + * A Session can be expired when it is in one of these statuses: open. * * After it expires, a customer can’t complete a Session and customers loading the * Session see a message saying the Session is expired. diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php index a8644e04a..bed255a11 100644 --- a/lib/Service/CoreServiceFactory.php +++ b/lib/Service/CoreServiceFactory.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'accountLinks' => AccountLinkService::class, - 'accounts' => AccountService::class, - 'accountSessions' => AccountSessionService::class, - 'applePayDomains' => ApplePayDomainService::class, - 'applicationFees' => ApplicationFeeService::class, - 'apps' => Apps\AppsServiceFactory::class, - 'balance' => BalanceService::class, - 'balanceTransactions' => BalanceTransactionService::class, - 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, - 'capital' => Capital\CapitalServiceFactory::class, - 'charges' => ChargeService::class, - 'checkout' => Checkout\CheckoutServiceFactory::class, - 'countrySpecs' => CountrySpecService::class, - 'coupons' => CouponService::class, - 'creditNotes' => CreditNoteService::class, - 'customers' => CustomerService::class, - 'disputes' => DisputeService::class, - 'ephemeralKeys' => EphemeralKeyService::class, - 'events' => EventService::class, - 'exchangeRates' => ExchangeRateService::class, - 'fileLinks' => FileLinkService::class, - 'files' => FileService::class, - 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, - 'giftCards' => GiftCards\GiftCardsServiceFactory::class, - 'identity' => Identity\IdentityServiceFactory::class, - 'invoiceItems' => InvoiceItemService::class, - 'invoices' => InvoiceService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'mandates' => MandateService::class, - 'oauth' => OAuthService::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, - 'quotePhases' => QuotePhaseService::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, - 'sources' => SourceService::class, - 'subscriptionItems' => SubscriptionItemService::class, - 'subscriptions' => SubscriptionService::class, - 'subscriptionSchedules' => SubscriptionScheduleService::class, - 'tax' => Tax\TaxServiceFactory::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, + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'accountSessions' => AccountSessionService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::class, + 'apps' => Apps\AppsServiceFactory::class, + 'balance' => BalanceService::class, + 'balanceTransactions' => BalanceTransactionService::class, + 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, + 'capital' => Capital\CapitalServiceFactory::class, + 'charges' => ChargeService::class, + 'checkout' => Checkout\CheckoutServiceFactory::class, + 'countrySpecs' => CountrySpecService::class, + 'coupons' => CouponService::class, + 'creditNotes' => CreditNoteService::class, + 'customers' => CustomerService::class, + 'disputes' => DisputeService::class, + 'ephemeralKeys' => EphemeralKeyService::class, + 'events' => EventService::class, + 'exchangeRates' => ExchangeRateService::class, + 'fileLinks' => FileLinkService::class, + 'files' => FileService::class, + 'financialConnections' => FinancialConnections\FinancialConnectionsServiceFactory::class, + 'giftCards' => GiftCards\GiftCardsServiceFactory::class, + 'identity' => Identity\IdentityServiceFactory::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::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, + 'quotePhases' => QuotePhaseService::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, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'tax' => Tax\TaxServiceFactory::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, ]; protected function getServiceClass($name) diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php index 14499b6c7..8f3869fee 100644 --- a/lib/Service/CountrySpecService.php +++ b/lib/Service/CountrySpecService.php @@ -1,4 +1,5 @@ status=open invoice, a credit note reduces its * amount_due. For a status=paid invoice, a credit note * does not affect its amount_due. Instead, it can result in any - * combination of the following: + * combination of the following:. * *
    • Refund: create a new refund (using refund_amount) or link * an existing refund (using refund).
    • Customer balance diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php index c5aefb8e0..5cb7910a2 100644 --- a/lib/Service/CustomerService.php +++ b/lib/Service/CustomerService.php @@ -1,4 +1,5 @@ Account + * Lists all owners for a given Account. * * @param string $id * @param null|array $params diff --git a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php index b7aefa9d9..7dd826341 100644 --- a/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php +++ b/lib/Service/FinancialConnections/FinancialConnectionsServiceFactory.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'accounts' => AccountService::class, - 'sessions' => SessionService::class, + 'accounts' => AccountService::class, + 'sessions' => SessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/FinancialConnections/SessionService.php b/lib/Service/FinancialConnections/SessionService.php index 58a311ae3..eab589cda 100644 --- a/lib/Service/FinancialConnections/SessionService.php +++ b/lib/Service/FinancialConnections/SessionService.php @@ -1,4 +1,5 @@ Session + * Retrieves the details of a Financial Connections Session. * * @param string $id * @param null|array $params diff --git a/lib/Service/GiftCards/CardService.php b/lib/Service/GiftCards/CardService.php index a9b224d92..e2e0b1fa2 100644 --- a/lib/Service/GiftCards/CardService.php +++ b/lib/Service/GiftCards/CardService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'cards' => CardService::class, - 'transactions' => TransactionService::class, + 'cards' => CardService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/GiftCards/TransactionService.php b/lib/Service/GiftCards/TransactionService.php index 58e6e5688..8891799f0 100644 --- a/lib/Service/GiftCards/TransactionService.php +++ b/lib/Service/GiftCards/TransactionService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'verificationReports' => VerificationReportService::class, - 'verificationSessions' => VerificationSessionService::class, + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Identity/VerificationReportService.php b/lib/Service/Identity/VerificationReportService.php index 83e96e584..9289d9dfd 100644 --- a/lib/Service/Identity/VerificationReportService.php +++ b/lib/Service/Identity/VerificationReportService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'authorizations' => AuthorizationService::class, - 'cardholders' => CardholderService::class, - 'cards' => CardService::class, - 'disputes' => DisputeService::class, - 'transactions' => TransactionService::class, + 'authorizations' => AuthorizationService::class, + 'cardholders' => CardholderService::class, + 'cards' => CardService::class, + 'disputes' => DisputeService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Issuing/TransactionService.php b/lib/Service/Issuing/TransactionService.php index 44476aa4b..dd83b1820 100644 --- a/lib/Service/Issuing/TransactionService.php +++ b/lib/Service/Issuing/TransactionService.php @@ -1,4 +1,5 @@ Retrieve a Customer’s - * PaymentMethods + * PaymentMethods. * * @param string $id * @param null|array $params diff --git a/lib/Service/PayoutService.php b/lib/Service/PayoutService.php index 112f2b003..4ca3561c8 100644 --- a/lib/Service/PayoutService.php +++ b/lib/Service/PayoutService.php @@ -1,4 +1,5 @@ apiBase)) { - $opts->apiBase = $this->getClient()->getFilesBase(); - } - $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts); + $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/lib/Service/Radar/EarlyFraudWarningService.php b/lib/Service/Radar/EarlyFraudWarningService.php index c5849c4b5..be119b4c8 100644 --- a/lib/Service/Radar/EarlyFraudWarningService.php +++ b/lib/Service/Radar/EarlyFraudWarningService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'earlyFraudWarnings' => EarlyFraudWarningService::class, - 'valueListItems' => ValueListItemService::class, - 'valueLists' => ValueListService::class, + 'earlyFraudWarnings' => EarlyFraudWarningService::class, + 'valueListItems' => ValueListItemService::class, + 'valueLists' => ValueListService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Radar/ValueListItemService.php b/lib/Service/Radar/ValueListItemService.php index 5b849a548..b9da3dd8b 100644 --- a/lib/Service/Radar/ValueListItemService.php +++ b/lib/Service/Radar/ValueListItemService.php @@ -1,4 +1,5 @@ live-mode API key.) + * a live-mode API key.). * * @param null|array $params * @param null|array|\Stripe\Util\RequestOptions $opts diff --git a/lib/Service/Reporting/ReportTypeService.php b/lib/Service/Reporting/ReportTypeService.php index 695ad6544..7fa503821 100644 --- a/lib/Service/Reporting/ReportTypeService.php +++ b/lib/Service/Reporting/ReportTypeService.php @@ -1,4 +1,5 @@ live-mode API key.) + * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key.). * * @param string $id * @param null|array $params diff --git a/lib/Service/Reporting/ReportingServiceFactory.php b/lib/Service/Reporting/ReportingServiceFactory.php index dbf22098f..7832e9175 100644 --- a/lib/Service/Reporting/ReportingServiceFactory.php +++ b/lib/Service/Reporting/ReportingServiceFactory.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'reportRuns' => ReportRunService::class, - 'reportTypes' => ReportTypeService::class, + 'reportRuns' => ReportRunService::class, + 'reportTypes' => ReportTypeService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/ReviewService.php b/lib/Service/ReviewService.php index b42fd04fa..3bcd325b6 100644 --- a/lib/Service/ReviewService.php +++ b/lib/Service/ReviewService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'scheduledQueryRuns' => ScheduledQueryRunService::class, + 'scheduledQueryRuns' => ScheduledQueryRunService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/SourceService.php b/lib/Service/SourceService.php index 960930d38..b55717883 100644 --- a/lib/Service/SourceService.php +++ b/lib/Service/SourceService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'calculations' => CalculationService::class, - 'transactions' => TransactionService::class, + 'calculations' => CalculationService::class, + 'transactions' => TransactionService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/Tax/TransactionService.php b/lib/Service/Tax/TransactionService.php index 384d34d9d..15bd26ae1 100644 --- a/lib/Service/Tax/TransactionService.php +++ b/lib/Service/Tax/TransactionService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'configurations' => ConfigurationService::class, - 'connectionTokens' => ConnectionTokenService::class, - 'locations' => LocationService::class, - 'readers' => ReaderService::class, + 'configurations' => ConfigurationService::class, + 'connectionTokens' => ConnectionTokenService::class, + 'locations' => LocationService::class, + 'readers' => ReaderService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/CustomerService.php b/lib/Service/TestHelpers/CustomerService.php index 2a41070a0..c46b57975 100644 --- a/lib/Service/TestHelpers/CustomerService.php +++ b/lib/Service/TestHelpers/CustomerService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'cards' => CardService::class, + 'cards' => CardService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/RefundService.php b/lib/Service/TestHelpers/RefundService.php index 433072f4b..de0e4d10b 100644 --- a/lib/Service/TestHelpers/RefundService.php +++ b/lib/Service/TestHelpers/RefundService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'readers' => ReaderService::class, + 'readers' => ReaderService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TestHelpers/TestClockService.php b/lib/Service/TestHelpers/TestClockService.php index 22c75e7d9..a4eee8c3e 100644 --- a/lib/Service/TestHelpers/TestClockService.php +++ b/lib/Service/TestHelpers/TestClockService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'customers' => CustomerService::class, - 'issuing' => Issuing\IssuingServiceFactory::class, - 'refunds' => RefundService::class, - 'terminal' => Terminal\TerminalServiceFactory::class, - 'testClocks' => TestClockService::class, - 'treasury' => Treasury\TreasuryServiceFactory::class, + '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) diff --git a/lib/Service/TestHelpers/Treasury/InboundTransferService.php b/lib/Service/TestHelpers/Treasury/InboundTransferService.php index 51a573d21..1c8247625 100644 --- a/lib/Service/TestHelpers/Treasury/InboundTransferService.php +++ b/lib/Service/TestHelpers/Treasury/InboundTransferService.php @@ -1,4 +1,5 @@ */ private static $classMap = [ - 'inboundTransfers' => InboundTransferService::class, - 'outboundPayments' => OutboundPaymentService::class, - 'outboundTransfers' => OutboundTransferService::class, - 'receivedCredits' => ReceivedCreditService::class, - 'receivedDebits' => ReceivedDebitService::class, + 'inboundTransfers' => InboundTransferService::class, + 'outboundPayments' => OutboundPaymentService::class, + 'outboundTransfers' => OutboundTransferService::class, + 'receivedCredits' => ReceivedCreditService::class, + 'receivedDebits' => ReceivedDebitService::class, ]; protected function getServiceClass($name) diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php index 73131cb9b..1c72759f6 100644 --- a/lib/Service/TokenService.php +++ b/lib/Service/TokenService.php @@ -1,4 +1,5 @@ */ 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, + '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) diff --git a/lib/Service/WebhookEndpointService.php b/lib/Service/WebhookEndpointService.php index 9d4ade954..baa15bd24 100644 --- a/lib/Service/WebhookEndpointService.php +++ b/lib/Service/WebhookEndpointService.php @@ -1,4 +1,5 @@ instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url, $params, $opts); $this->refreshFrom(['discount' => null], $opts, true); + return $this; } @@ -141,6 +143,7 @@ public function cancel($params = null, $opts = null) public static function search($params = null, $opts = null) { $url = '/v1/subscriptions/search'; + return self::_searchResource($url, $params, $opts); } } diff --git a/lib/SubscriptionItem.php b/lib/SubscriptionItem.php index 6c39f6f62..6b57588db 100644 --- a/lib/SubscriptionItem.php +++ b/lib/SubscriptionItem.php @@ -1,4 +1,5 @@ \Stripe\Account::class, - \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, - \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::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\Capability::OBJECT_NAME => \Stripe\Capability::class, - \Stripe\Capital\FinancingOffer::OBJECT_NAME => \Stripe\Capital\FinancingOffer::class, - \Stripe\Capital\FinancingSummary::OBJECT_NAME => \Stripe\Capital\FinancingSummary::class, - \Stripe\Capital\FinancingTransaction::OBJECT_NAME => \Stripe\Capital\FinancingTransaction::class, - \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, - \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, - \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, - \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, - \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, - \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, - \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, - \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, - \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, - \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, - \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, - \Stripe\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, - \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, - \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, - \Stripe\File::OBJECT_NAME => \Stripe\File::class, - \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, - \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, - \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, - \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, - \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, - \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, - \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, - \Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class, - \Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class, - \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, - \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, - \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, - \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, - \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, - \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, - \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, - \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, - \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, - \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, - \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, - \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, - \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, - \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, - \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, - \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, - \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, - \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, - \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, - \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, - \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, - \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, - \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, - \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, - \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, - \Stripe\QuotePhase::OBJECT_NAME => \Stripe\QuotePhase::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\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\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\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class, - \Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class, - \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, - \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, - \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, - \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, - \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, - \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, - \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, - \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, - \Stripe\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, - ]; + /** + * @var array Mapping from object types to resource classes + */ + const mapping = [ + \Stripe\Account::OBJECT_NAME => \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AccountSession::OBJECT_NAME => \Stripe\AccountSession::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\Capability::OBJECT_NAME => \Stripe\Capability::class, + \Stripe\Capital\FinancingOffer::OBJECT_NAME => \Stripe\Capital\FinancingOffer::class, + \Stripe\Capital\FinancingSummary::OBJECT_NAME => \Stripe\Capital\FinancingSummary::class, + \Stripe\Capital\FinancingTransaction::OBJECT_NAME => \Stripe\Capital\FinancingTransaction::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\CashBalance::OBJECT_NAME => \Stripe\CashBalance::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, + \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\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, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class, + \Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class, + \Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class, + \Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class, + \Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class, + \Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class, + \Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class, + \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class, + \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class, + \Stripe\QuotePhase::OBJECT_NAME => \Stripe\QuotePhase::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\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\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\Tax\Calculation::OBJECT_NAME => \Stripe\Tax\Calculation::class, + \Stripe\Tax\Transaction::OBJECT_NAME => \Stripe\Tax\Transaction::class, + \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class, + \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, + \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\Configuration::OBJECT_NAME => \Stripe\Terminal\Configuration::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\TestHelpers\TestClock::OBJECT_NAME => \Stripe\TestHelpers\TestClock::class, + \Stripe\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/lib/WebhookEndpoint.php b/lib/WebhookEndpoint.php index 1862f05e0..96333d132 100644 --- a/lib/WebhookEndpoint.php +++ b/lib/WebhookEndpoint.php @@ -1,4 +1,5 @@ client = new \Stripe\StripeClient(['api_key' =>'sk_test_123', 'api_base' => MOCK_URL]); - } - - public function testListSecret() - { - $this->expectsRequest('get', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->all( - ['scope' => ['type' => 'account'], 'limit' => 2] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result->data[0]); - } - public function testCreateSecret() - { - $this->expectsRequest('post', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->create( - [ - 'name' => 'sec_123', - 'payload' => 'very secret string', - 'scope' => ['type' => 'account'], - ] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - public function testDeleteWhereSecret() - { - $this->expectsRequest('post', '/v1/apps/secrets/delete'); - $result = $this->client->apps->secrets->deleteWhere( - ['name' => 'my-api-key', 'scope' => ['type' => 'account']] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - public function testFindSecret() - { - $this->expectsRequest('get', '/v1/apps/secrets/find'); - $result = $this->client->apps->secrets->find( - ['name' => 'sec_123', 'scope' => ['type' => 'account']] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - public function testCreateSession() - { - $this->expectsRequest('post', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->create( - [ - 'success_url' => 'https://example.com/success', - 'cancel_url' => 'https://example.com/cancel', - 'mode' => 'payment', - 'shipping_options' => [ - ['shipping_rate' => 'shr_standard'], - [ - 'shipping_rate_data' => [ - 'display_name' => 'Standard', - 'delivery_estimate' => [ - 'minimum' => ['unit' => 'day', 'value' => 5], - 'maximum' => ['unit' => 'day', 'value' => 7], - ], - ], - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - public function testExpireSession() - { - $this->expectsRequest('post', '/v1/checkout/sessions/sess_xyz/expire'); - $result = $this->client->checkout->sessions->expire('sess_xyz', []); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - public function testListLineItemsSession() - { - $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); - $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); - } - public function testRetrieveCashBalance() - { - $this->expectsRequest('get', '/v1/customers/cus_123/cash_balance'); - $result = $this->client->customers->retrieveCashBalance('cus_123', []); - static::assertInstanceOf(\Stripe\CashBalance::class, $result); - } - public function testUpdateCashBalance() - { - $this->expectsRequest('post', '/v1/customers/cus_123/cash_balance'); - $result = $this->client->customers->updateCashBalance( - 'cus_123', - ['settings' => ['reconciliation_mode' => 'manual']] - ); - static::assertInstanceOf(\Stripe\CashBalance::class, $result); - } - public function testCreateFundingInstructionsCustomer() - { - $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); - $result = $this->client->customers->createFundingInstructions( - 'cus_123', - [ - 'bank_transfer' => [ - 'requested_address_types' => ['zengin'], - 'type' => 'jp_bank_transfer', - ], - 'currency' => 'usd', - 'funding_type' => 'bank_transfer', - ] - ); - static::assertInstanceOf(\Stripe\FundingInstructions::class, $result); - } - public function testListAccount() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts'); - $result = $this->client->financialConnections->accounts->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); - } - public function testRetrieveAccount() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); - $result = $this->client->financialConnections->accounts->retrieve( - 'fca_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - public function testDisconnectAccount() - { - $this->expectsRequest( - 'post', - '/v1/financial_connections/accounts/fca_xyz/disconnect' - ); - $result = $this->client->financialConnections->accounts->disconnect( - 'fca_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - public function testListOwnersAccount() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xyz/owners' - ); - $result = $this->client->financialConnections->accounts->allOwners( - 'fca_xyz', - ['ownership' => 'fcaowns_xyz'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); - } - public function testRefreshAccount() - { - $this->expectsRequest( - 'post', - '/v1/financial_connections/accounts/fca_xyz/refresh' - ); - $result = $this->client->financialConnections->accounts->refresh( - 'fca_xyz', - ['features' => ['balance']] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - public function testCreateSession2() - { - $this->expectsRequest('post', '/v1/financial_connections/sessions'); - $result = $this->client->financialConnections->sessions->create( - [ - 'account_holder' => ['type' => 'customer', 'customer' => 'cus_123'], - 'permissions' => ['balances'], - ] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - public function testRetrieveSession() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/sessions/fcsess_xyz' - ); - $result = $this->client->financialConnections->sessions->retrieve( - 'fcsess_xyz', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - public function testUpcomingInvoice() - { - $this->expectsRequest('get', '/v1/invoices/upcoming'); - $result = $this->client->invoices->upcoming( - ['customer' => 'cus_9utnxg47pWjV1e'] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testCreatePaymentIntent() - { - $this->expectsRequest('post', '/v1/payment_intents'); - $result = $this->client->paymentIntents->create( - [ - 'amount' => 1099, - 'currency' => 'eur', - 'automatic_payment_methods' => ['enabled' => true], - ] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testVerifyMicrodepositsPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits' - ); - $result = $this->client->paymentIntents->verifyMicrodeposits( - 'pi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testCreatePaymentLink() - { - $this->expectsRequest('post', '/v1/payment_links'); - $result = $this->client->paymentLinks->create( - ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - public function testRetrievePaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links/pl_xyz'); - $result = $this->client->paymentLinks->retrieve('pl_xyz', []); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - public function testListLineItemsPaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links/pl_xyz/line_items'); - $result = $this->client->paymentLinks->allLineItems('pl_xyz', []); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); - } - public function testCreatePrice() - { - $this->expectsRequest('post', '/v1/prices'); - $result = $this->client->prices->create( - [ - 'unit_amount' => 2000, - 'currency' => 'usd', - 'currency_options' => [ - 'uah' => ['unit_amount' => 5000], - 'eur' => ['unit_amount' => 1800], - ], - 'recurring' => ['interval' => 'month'], - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - public function testListSetupAttempt() - { - $this->expectsRequest('get', '/v1/setup_attempts'); - $result = $this->client->setupAttempts->all( - ['limit' => 3, 'setup_intent' => 'si_xyz'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]); - } - public function testVerifyMicrodepositsSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits' - ); - $result = $this->client->setupIntents->verifyMicrodeposits( - 'seti_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testListShippingRate() - { - $this->expectsRequest('get', '/v1/shipping_rates'); - $result = $this->client->shippingRates->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); - } - public function testCreateShippingRate() - { - $this->expectsRequest('post', '/v1/shipping_rates'); - $result = $this->client->shippingRates->create( - [ - 'display_name' => 'Sample Shipper', - 'fixed_amount' => ['currency' => 'usd', 'amount' => 400], - 'type' => 'fixed_amount', - ] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - public function testListConfiguration() - { - $this->expectsRequest('get', '/v1/terminal/configurations'); - $result = $this->client->terminal->configurations->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); - } - public function testDeleteConfiguration() - { - $this->expectsRequest('delete', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->delete('uc_123', []); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testRetrieveConfiguration() - { - $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->retrieve('uc_123', []); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testUpdateConfiguration() - { - $this->expectsRequest('post', '/v1/terminal/configurations/uc_123'); - $result = $this->client->terminal->configurations->update( - 'uc_123', - ['tipping' => ['usd' => ['fixed_amounts' => [10]]]] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testFundCashBalanceCustomer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/customers/cus_123/fund_cash_balance' - ); - $result = $this->client->testHelpers->customers->fundCashBalance( - 'cus_123', - ['amount' => 30, 'currency' => 'eur'] - ); - static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result); - } - public function testDeliverCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/deliver' - ); - $result = $this->client->testHelpers->issuing->cards->deliverCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testFailCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/fail' - ); - $result = $this->client->testHelpers->issuing->cards->failCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testReturnCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/return' - ); - $result = $this->client->testHelpers->issuing->cards->returnCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testShipCardCard() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/issuing/cards/card_123/shipping/ship' - ); - $result = $this->client->testHelpers->issuing->cards->shipCard( - 'card_123', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testExpireRefund() - { - $this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire'); - $result = $this->client->testHelpers->refunds->expire('re_123', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - public function testListTestClock() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); - } - public function testCreateTestClock() - { - $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->create( - ['frozen_time' => 123, 'name' => 'cogsworth'] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testDeleteTestClock() - { - $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testRetrieveTestClock() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); - $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testAdvanceTestClock() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/test_clocks/clock_xyz/advance' - ); - $result = $this->client->testHelpers->testClocks->advance( - 'clock_xyz', - ['frozen_time' => 142] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testFailInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->fail( - 'ibt_123', - ['failure_details' => ['code' => 'account_closed']] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testReturnInboundTransferInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/return' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->returnInboundTransfer( - 'ibt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testSucceedInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed' - ); - $result = $this->client->testHelpers->treasury->inboundTransfers->succeed( - 'ibt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testFailOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/fail' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->fail( - 'obt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testPostOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/post' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->post( - 'obt_123', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testReturnOutboundTransferOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/treasury/outbound_transfers/obt_123/return' - ); - $result = $this->client->testHelpers->treasury->outboundTransfers->returnOutboundTransfer( - 'obt_123', - ['returned_details' => ['code' => 'account_closed']] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testCreateReceivedCredit() - { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); - $result = $this->client->testHelpers->treasury->receivedCredits->create( - [ - 'financial_account' => 'fa_123', - 'network' => 'ach', - 'amount' => 1234, - 'currency' => 'usd', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); - } - public function testCreateReceivedDebit() - { - $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); - $result = $this->client->testHelpers->treasury->receivedDebits->create( - [ - 'financial_account' => 'fa_123', - 'network' => 'ach', - 'amount' => 1234, - 'currency' => 'usd', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); - } - public function testCreateToken() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'card' => [ - 'number' => '4242424242424242', - 'exp_month' => '5', - 'exp_year' => '2023', - 'cvc' => '314', - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testCreateAccountLink() - { - $this->expectsRequest('post', '/v1/account_links'); - $result = $this->client->accountLinks->create( - [ - 'account' => 'acct_xxxxxxxxxxxxx', - 'refresh_url' => 'https://example.com/reauth', - 'return_url' => 'https://example.com/return', - 'type' => 'account_onboarding', - ] - ); - static::assertInstanceOf(\Stripe\AccountLink::class, $result); - } - public function testListAccount2() - { - $this->expectsRequest('get', '/v1/accounts'); - $result = $this->client->accounts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Account::class, $result->data[0]); - } - public function testCreateAccount() - { - $this->expectsRequest('post', '/v1/accounts'); - $result = $this->client->accounts->create( - [ - 'type' => 'custom', - 'country' => 'US', - 'email' => 'jenny.rosen@example.com', - 'capabilities' => [ - 'card_payments' => ['requested' => true], - 'transfers' => ['requested' => true], - ], - ] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - public function testDeleteAccount() - { - $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - public function testRetrieveAccount2() - { - $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->retrieve('acct_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - public function testUpdateAccount() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx'); - $result = $this->client->accounts->update( - 'acct_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - public function testRejectAccount() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/reject'); - $result = $this->client->accounts->reject( - 'acct_xxxxxxxxxxxxx', - ['reason' => 'fraud'] - ); - static::assertInstanceOf(\Stripe\Account::class, $result); - } - public function testListCapability() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities' - ); - $result = $this->client->accounts->allCapabilities( - 'acct_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Capability::class, $result->data[0]); - } - public function testRetrieveCapability() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' - ); - $result = $this->client->accounts->retrieveCapability( - 'acct_xxxxxxxxxxxxx', - 'card_payments', - [] - ); - static::assertInstanceOf(\Stripe\Capability::class, $result); - } - public function testUpdateCapability() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' - ); - $result = $this->client->accounts->updateCapability( - 'acct_xxxxxxxxxxxxx', - 'card_payments', - ['requested' => true] - ); - static::assertInstanceOf(\Stripe\Capability::class, $result); - } - public function testCreateLoginLink() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/login_links' - ); - $result = $this->client->accounts->createLoginLink( - 'acct_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\LoginLink::class, $result); - } - public function testListPerson() - { - $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); - $result = $this->client->accounts->allPersons( - 'acct_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Person::class, $result->data[0]); - } - public function testCreatePerson() - { - $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); - $result = $this->client->accounts->createPerson( - 'acct_xxxxxxxxxxxxx', - ['first_name' => 'Jane', 'last_name' => 'Diaz'] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - public function testDeletePerson() - { - $this->expectsRequest( - 'delete', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->deletePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - public function testRetrievePerson() - { - $this->expectsRequest( - 'get', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->retrievePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - public function testUpdatePerson() - { - $this->expectsRequest( - 'post', - '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' - ); - $result = $this->client->accounts->updatePerson( - 'acct_xxxxxxxxxxxxx', - 'person_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Person::class, $result); - } - public function testListApplicationFee() - { - $this->expectsRequest('get', '/v1/application_fees'); - $result = $this->client->applicationFees->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ApplicationFee::class, $result->data[0]); - } - public function testRetrieveApplicationFee() - { - $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); - $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); - } - public function testListApplicationFeeRefund() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' - ); - $result = $this->client->applicationFees->allRefunds( - 'fee_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result->data[0]); - } - public function testCreateApplicationFeeRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' - ); - $result = $this->client->applicationFees->createRefund( - 'fee_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - public function testRetrieveApplicationFeeRefund() - { - $this->expectsRequest( - 'get', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' - ); - $result = $this->client->applicationFees->retrieveRefund( - 'fee_xxxxxxxxxxxxx', - 'fr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - public function testUpdateApplicationFeeRefund() - { - $this->expectsRequest( - 'post', - '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' - ); - $result = $this->client->applicationFees->updateRefund( - 'fee_xxxxxxxxxxxxx', - 'fr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); - } - public function testCreateSecret2() - { - $this->expectsRequest('post', '/v1/apps/secrets'); - $result = $this->client->apps->secrets->create( - [ - 'name' => 'my-api-key', - 'payload' => 'secret_key_xxxxxx', - 'scope' => ['type' => 'account'], - ] - ); - static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); - } - public function testListBalanceTransaction() - { - $this->expectsRequest('get', '/v1/balance_transactions'); - $result = $this->client->balanceTransactions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result->data[0]); - } - public function testRetrieveBalanceTransaction() - { - $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); - $result = $this->client->balanceTransactions->retrieve( - 'txn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result); - } - public function testListConfiguration2() - { - $this->expectsRequest('get', '/v1/billing_portal/configurations'); - $result = $this->client->billingPortal->configurations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); - } - public function testRetrieveConfiguration2() - { - $this->expectsRequest( - 'get', - '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' - ); - $result = $this->client->billingPortal->configurations->retrieve( - 'bpc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); - } - public function testUpdateConfiguration2() - { - $this->expectsRequest( - 'post', - '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' - ); - $result = $this->client->billingPortal->configurations->update( - 'bpc_xxxxxxxxxxxxx', - [ - 'business_profile' => [ - 'privacy_policy_url' => 'https://example.com/privacy', - 'terms_of_service_url' => 'https://example.com/terms', - ], - ] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); - } - public function testCreateSession3() - { - $this->expectsRequest('post', '/v1/billing_portal/sessions'); - $result = $this->client->billingPortal->sessions->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'return_url' => 'https://example.com/account', - ] - ); - static::assertInstanceOf(\Stripe\BillingPortal\Session::class, $result); - } - public function testListCharge() - { - $this->expectsRequest('get', '/v1/charges'); - $result = $this->client->charges->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); - } - public function testCreateCharge() - { - $this->expectsRequest('post', '/v1/charges'); - $result = $this->client->charges->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'source' => 'tok_xxxx', - 'description' => 'My First Test Charge (created for API docs)', - ] - ); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - public function testRetrieveCharge() - { - $this->expectsRequest('get', '/v1/charges/ch_xxxxxxxxxxxxx'); - $result = $this->client->charges->retrieve('ch_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - public function testUpdateCharge() - { - $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx'); - $result = $this->client->charges->update( - 'ch_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - public function testCaptureCharge() - { - $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx/capture'); - $result = $this->client->charges->capture('ch_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Charge::class, $result); - } - public function testSearchCharge() - { - $this->expectsRequest('get', '/v1/charges/search'); - $result = $this->client->charges->search( - ['query' => 'amount>999 AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); - } - public function testListSession() - { - $this->expectsRequest('get', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result->data[0]); - } - public function testCreateSession4() - { - $this->expectsRequest('post', '/v1/checkout/sessions'); - $result = $this->client->checkout->sessions->create( - [ - 'success_url' => 'https://example.com/success', - 'cancel_url' => 'https://example.com/cancel', - 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], - 'mode' => 'payment', - ] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - public function testRetrieveSession2() - { - $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); - $result = $this->client->checkout->sessions->retrieve( - 'cs_test_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - public function testExpireSession2() - { - $this->expectsRequest( - 'post', - '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire' - ); - $result = $this->client->checkout->sessions->expire( - 'cs_test_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); - } - public function testListCountrySpec() - { - $this->expectsRequest('get', '/v1/country_specs'); - $result = $this->client->countrySpecs->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CountrySpec::class, $result->data[0]); - } - public function testRetrieveCountrySpec() - { - $this->expectsRequest('get', '/v1/country_specs/US'); - $result = $this->client->countrySpecs->retrieve('US', []); - static::assertInstanceOf(\Stripe\CountrySpec::class, $result); - } - public function testListCoupon() - { - $this->expectsRequest('get', '/v1/coupons'); - $result = $this->client->coupons->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Coupon::class, $result->data[0]); - } - public function testCreateCoupon() - { - $this->expectsRequest('post', '/v1/coupons'); - $result = $this->client->coupons->create( - [ - 'percent_off' => 25.5, - 'duration' => 'repeating', - 'duration_in_months' => 3, - ] - ); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - public function testDeleteCoupon() - { - $this->expectsRequest('delete', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->delete('Z4OV52SU', []); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - public function testRetrieveCoupon() - { - $this->expectsRequest('get', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->retrieve('Z4OV52SU', []); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - public function testUpdateCoupon() - { - $this->expectsRequest('post', '/v1/coupons/Z4OV52SU'); - $result = $this->client->coupons->update( - 'Z4OV52SU', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Coupon::class, $result); - } - public function testListCreditNote() - { - $this->expectsRequest('get', '/v1/credit_notes'); - $result = $this->client->creditNotes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CreditNote::class, $result->data[0]); - } - public function testCreateCreditNote() - { - $this->expectsRequest('post', '/v1/credit_notes'); - $result = $this->client->creditNotes->create( - [ - 'invoice' => 'in_xxxxxxxxxxxxx', - 'lines' => [ - [ - 'type' => 'invoice_line_item', - 'invoice_line_item' => 'il_xxxxxxxxxxxxx', - 'quantity' => 1, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - public function testVoidCreditNoteCreditNote() - { - $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx/void'); - $result = $this->client->creditNotes->voidCreditNote( - 'cn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - public function testListCreditNoteLineItem() - { - $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx/lines'); - $result = $this->client->creditNotes->allLines( - 'cn_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CreditNoteLineItem::class, $result->data[0]); - } - public function testPreviewCreditNote() - { - $this->expectsRequest('get', '/v1/credit_notes/preview'); - $result = $this->client->creditNotes->preview( - [ - 'invoice' => 'in_xxxxxxxxxxxxx', - 'lines' => [ - [ - 'type' => 'invoice_line_item', - 'invoice_line_item' => 'il_xxxxxxxxxxxxx', - 'quantity' => 1, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\CreditNote::class, $result); - } - public function testListCustomer() - { - $this->expectsRequest('get', '/v1/customers'); - $result = $this->client->customers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - public function testListCustomer2() - { - $this->expectsRequest('get', '/v1/customers'); - $result = $this->client->customers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - public function testCreateCustomer() - { - $this->expectsRequest('post', '/v1/customers'); - $result = $this->client->customers->create( - ['description' => 'My First Test Customer (created for API docs)'] - ); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - public function testDeleteCustomer() - { - $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - public function testRetrieveCustomer() - { - $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->retrieve('cus_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - public function testUpdateCustomer() - { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx'); - $result = $this->client->customers->update( - 'cus_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Customer::class, $result); - } - public function testListCustomerBalanceTransaction() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' - ); - $result = $this->client->customers->allBalanceTransactions( - 'cus_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result->data[0]); - } - public function testCreateCustomerBalanceTransaction() - { - $this->expectsRequest( - 'post', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' - ); - $result = $this->client->customers->createBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - ['amount' => -500, 'currency' => 'usd'] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - public function testRetrieveCustomerBalanceTransaction() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->retrieveBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - 'cbtxn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - public function testUpdateCustomerBalanceTransaction() - { - $this->expectsRequest( - 'post', - '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->updateBalanceTransaction( - 'cus_xxxxxxxxxxxxx', - 'cbtxn_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); - } - public function testListTaxId() - { - $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); - $result = $this->client->customers->allTaxIds( - 'cus_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); - } - public function testCreateTaxId() - { - $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); - $result = $this->client->customers->createTaxId( - 'cus_xxxxxxxxxxxxx', - ['type' => 'eu_vat', 'value' => 'DE123456789'] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - public function testDeleteTaxId() - { - $this->expectsRequest( - 'delete', - '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->deleteTaxId( - 'cus_xxxxxxxxxxxxx', - 'txi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - public function testRetrieveTaxId() - { - $this->expectsRequest( - 'get', - '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' - ); - $result = $this->client->customers->retrieveTaxId( - 'cus_xxxxxxxxxxxxx', - 'txi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TaxId::class, $result); - } - public function testSearchCustomer() - { - $this->expectsRequest('get', '/v1/customers/search'); - $result = $this->client->customers->search( - ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - public function testSearchCustomer2() - { - $this->expectsRequest('get', '/v1/customers/search'); - $result = $this->client->customers->search( - ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); - } - public function testListDispute() - { - $this->expectsRequest('get', '/v1/disputes'); - $result = $this->client->disputes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Dispute::class, $result->data[0]); - } - public function testRetrieveDispute() - { - $this->expectsRequest('get', '/v1/disputes/dp_xxxxxxxxxxxxx'); - $result = $this->client->disputes->retrieve('dp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - public function testUpdateDispute() - { - $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx'); - $result = $this->client->disputes->update( - 'dp_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - public function testCloseDispute() - { - $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx/close'); - $result = $this->client->disputes->close('dp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Dispute::class, $result); - } - public function testListEvent() - { - $this->expectsRequest('get', '/v1/events'); - $result = $this->client->events->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Event::class, $result->data[0]); - } - public function testRetrieveEvent() - { - $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx'); - $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Event::class, $result); - } - public function testListFileLink() - { - $this->expectsRequest('get', '/v1/file_links'); - $result = $this->client->fileLinks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FileLink::class, $result->data[0]); - } - public function testCreateFileLink() - { - $this->expectsRequest('post', '/v1/file_links'); - $result = $this->client->fileLinks->create( - ['file' => 'file_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - public function testRetrieveFileLink() - { - $this->expectsRequest('get', '/v1/file_links/link_xxxxxxxxxxxxx'); - $result = $this->client->fileLinks->retrieve('link_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - public function testUpdateFileLink() - { - $this->expectsRequest('post', '/v1/file_links/link_xxxxxxxxxxxxx'); - $result = $this->client->fileLinks->update( - 'link_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\FileLink::class, $result); - } - public function testListFile() - { - $this->expectsRequest('get', '/v1/files'); - $result = $this->client->files->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\File::class, $result->data[0]); - } - public function testRetrieveFile() - { - $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx'); - $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\File::class, $result); - } - public function testListAccount3() - { - $this->expectsRequest('get', '/v1/financial_connections/accounts'); - $result = $this->client->financialConnections->accounts->all( - ['account_holder' => ['customer' => 'cus_xxxxxxxxxxxxx']] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); - } - public function testRetrieveAccount3() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx' - ); - $result = $this->client->financialConnections->accounts->retrieve( - 'fca_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); - } - public function testListOwnersAccount2() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners' - ); - $result = $this->client->financialConnections->accounts->allOwners( - 'fca_xxxxxxxxxxxxx', - ['limit' => 3, 'ownership' => 'fcaowns_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); - } - public function testCreateSession5() - { - $this->expectsRequest('post', '/v1/financial_connections/sessions'); - $result = $this->client->financialConnections->sessions->create( - [ - 'account_holder' => [ - 'type' => 'customer', - 'customer' => 'cus_xxxxxxxxxxxxx', - ], - 'permissions' => ['payment_method', 'balances'], - 'filters' => ['countries' => ['US']], - ] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - public function testRetrieveSession3() - { - $this->expectsRequest( - 'get', - '/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx' - ); - $result = $this->client->financialConnections->sessions->retrieve( - 'fcsess_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); - } - public function testListVerificationReport() - { - $this->expectsRequest('get', '/v1/identity/verification_reports'); - $result = $this->client->identity->verificationReports->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); - } - public function testRetrieveVerificationReport() - { - $this->expectsRequest( - 'get', - '/v1/identity/verification_reports/vr_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationReports->retrieve( - 'vr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result); - } - public function testListVerificationSession() - { - $this->expectsRequest('get', '/v1/identity/verification_sessions'); - $result = $this->client->identity->verificationSessions->all( - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result->data[0]); - } - public function testCreateVerificationSession() - { - $this->expectsRequest('post', '/v1/identity/verification_sessions'); - $result = $this->client->identity->verificationSessions->create( - ['type' => 'document'] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - public function testRetrieveVerificationSession() - { - $this->expectsRequest( - 'get', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationSessions->retrieve( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - public function testUpdateVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' - ); - $result = $this->client->identity->verificationSessions->update( - 'vs_xxxxxxxxxxxxx', - ['type' => 'id_number'] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - public function testCancelVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->identity->verificationSessions->cancel( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - public function testRedactVerificationSession() - { - $this->expectsRequest( - 'post', - '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact' - ); - $result = $this->client->identity->verificationSessions->redact( - 'vs_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); - } - public function testListInvoiceItem() - { - $this->expectsRequest('get', '/v1/invoiceitems'); - $result = $this->client->invoiceItems->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result->data[0]); - } - public function testCreateInvoiceItem() - { - $this->expectsRequest('post', '/v1/invoiceitems'); - $result = $this->client->invoiceItems->create( - ['customer' => 'cus_xxxxxxxxxxxxx', 'price' => 'price_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - public function testDeleteInvoiceItem() - { - $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - public function testRetrieveInvoiceItem() - { - $this->expectsRequest('get', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->retrieve('ii_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - public function testUpdateInvoiceItem() - { - $this->expectsRequest('post', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); - $result = $this->client->invoiceItems->update( - 'ii_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); - } - public function testListInvoice() - { - $this->expectsRequest('get', '/v1/invoices'); - $result = $this->client->invoices->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); - } - public function testCreateInvoice() - { - $this->expectsRequest('post', '/v1/invoices'); - $result = $this->client->invoices->create( - ['customer' => 'cus_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testDeleteInvoice() - { - $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testRetrieveInvoice() - { - $this->expectsRequest('get', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->retrieve('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testUpdateInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx'); - $result = $this->client->invoices->update( - 'in_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testFinalizeInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); - $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testMarkUncollectibleInvoice() - { - $this->expectsRequest( - 'post', - '/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible' - ); - $result = $this->client->invoices->markUncollectible( - 'in_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testPayInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/pay'); - $result = $this->client->invoices->pay('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testSendInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/send'); - $result = $this->client->invoices->sendInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testVoidInvoiceInvoice() - { - $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/void'); - $result = $this->client->invoices->voidInvoice('in_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Invoice::class, $result); - } - public function testSearchInvoice() - { - $this->expectsRequest('get', '/v1/invoices/search'); - $result = $this->client->invoices->search( - ['query' => 'total>999 AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); - } - public function testListAuthorization() - { - $this->expectsRequest('get', '/v1/issuing/authorizations'); - $result = $this->client->issuing->authorizations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result->data[0]); - } - public function testRetrieveAuthorization() - { - $this->expectsRequest( - 'get', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' - ); - $result = $this->client->issuing->authorizations->retrieve( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - public function testUpdateAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' - ); - $result = $this->client->issuing->authorizations->update( - 'iauth_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - public function testApproveAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve' - ); - $result = $this->client->issuing->authorizations->approve( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - public function testDeclineAuthorization() - { - $this->expectsRequest( - 'post', - '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline' - ); - $result = $this->client->issuing->authorizations->decline( - 'iauth_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); - } - public function testListCardholder() - { - $this->expectsRequest('get', '/v1/issuing/cardholders'); - $result = $this->client->issuing->cardholders->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result->data[0]); - } - public function testCreateCardholder() - { - $this->expectsRequest('post', '/v1/issuing/cardholders'); - $result = $this->client->issuing->cardholders->create( - [ - 'type' => 'individual', - 'name' => 'Jenny Rosen', - 'email' => 'jenny.rosen@example.com', - 'phone_number' => '+18888675309', - 'billing' => [ - 'address' => [ - 'line1' => '1234 Main Street', - 'city' => 'San Francisco', - 'state' => 'CA', - 'country' => 'US', - 'postal_code' => '94111', - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - public function testRetrieveCardholder() - { - $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cardholders->retrieve( - 'ich_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - public function testUpdateCardholder() - { - $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cardholders->update( - 'ich_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); - } - public function testListCard() - { - $this->expectsRequest('get', '/v1/issuing/cards'); - $result = $this->client->issuing->cards->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result->data[0]); - } - public function testCreateCard() - { - $this->expectsRequest('post', '/v1/issuing/cards'); - $result = $this->client->issuing->cards->create( - [ - 'cardholder' => 'ich_xxxxxxxxxxxxx', - 'currency' => 'usd', - 'type' => 'virtual', - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testRetrieveCard() - { - $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testUpdateCard() - { - $this->expectsRequest('post', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); - $result = $this->client->issuing->cards->update( - 'ic_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); - } - public function testListDispute2() - { - $this->expectsRequest('get', '/v1/issuing/disputes'); - $result = $this->client->issuing->disputes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result->data[0]); - } - public function testCreateDispute() - { - $this->expectsRequest('post', '/v1/issuing/disputes'); - $result = $this->client->issuing->disputes->create( - [ - 'transaction' => 'ipi_xxxxxxxxxxxxx', - 'evidence' => [ - 'reason' => 'fraudulent', - 'fraudulent' => ['explanation' => 'Purchase was unrecognized.'], - ], - ] - ); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - public function testRetrieveDispute2() - { - $this->expectsRequest('get', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx'); - $result = $this->client->issuing->disputes->retrieve( - 'idp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - public function testSubmitDispute() - { - $this->expectsRequest( - 'post', - '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' - ); - $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); - } - public function testListTransaction() - { - $this->expectsRequest('get', '/v1/issuing/transactions'); - $result = $this->client->issuing->transactions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result->data[0]); - } - public function testRetrieveTransaction() - { - $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); - $result = $this->client->issuing->transactions->retrieve( - 'ipi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); - } - public function testUpdateTransaction() - { - $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); - $result = $this->client->issuing->transactions->update( - 'ipi_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); - } - public function testRetrieveMandate() - { - $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); - $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Mandate::class, $result); - } - public function testListPaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents'); - $result = $this->client->paymentIntents->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); - } - public function testCreatePaymentIntent2() - { - $this->expectsRequest('post', '/v1/payment_intents'); - $result = $this->client->paymentIntents->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'payment_method_types' => ['card'], - ] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testRetrievePaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testUpdatePaymentIntent() - { - $this->expectsRequest('post', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); - $result = $this->client->paymentIntents->update( - 'pi_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testApplyCustomerBalancePaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance' - ); - $result = $this->client->paymentIntents->applyCustomerBalance( - 'pi_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testCancelPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->paymentIntents->cancel('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testCapturePaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' - ); - $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testConfirmPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm' - ); - $result = $this->client->paymentIntents->confirm( - 'pi_xxxxxxxxxxxxx', - ['payment_method' => 'pm_card_visa'] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testIncrementAuthorizationPaymentIntent() - { - $this->expectsRequest( - 'post', - '/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization' - ); - $result = $this->client->paymentIntents->incrementAuthorization( - 'pi_xxxxxxxxxxxxx', - ['amount' => 2099] - ); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); - } - public function testSearchPaymentIntent() - { - $this->expectsRequest('get', '/v1/payment_intents/search'); - $result = $this->client->paymentIntents->search( - ['query' => 'status:\'succeeded\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); - } - public function testListPaymentLink() - { - $this->expectsRequest('get', '/v1/payment_links'); - $result = $this->client->paymentLinks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result->data[0]); - } - public function testCreatePaymentLink2() - { - $this->expectsRequest('post', '/v1/payment_links'); - $result = $this->client->paymentLinks->create( - ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - public function testRetrievePaymentLink2() - { - $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - public function testUpdatePaymentLink() - { - $this->expectsRequest('post', '/v1/payment_links/plink_xxxxxxxxxxxxx'); - $result = $this->client->paymentLinks->update( - 'plink_xxxxxxxxxxxxx', - ['active' => false] - ); - static::assertInstanceOf(\Stripe\PaymentLink::class, $result); - } - public function testListPaymentMethod() - { - $this->expectsRequest('get', '/v1/payment_methods'); - $result = $this->client->paymentMethods->all( - ['customer' => 'cus_xxxxxxxxxxxxx', 'type' => 'card'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result->data[0]); - } - public function testCreatePaymentMethod() - { - $this->expectsRequest('post', '/v1/payment_methods'); - $result = $this->client->paymentMethods->create( - [ - 'type' => 'card', - 'card' => [ - 'number' => '4242424242424242', - 'exp_month' => 5, - 'exp_year' => 2023, - 'cvc' => '314', - ], - ] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - public function testRetrievePaymentMethod() - { - $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - public function testUpdatePaymentMethod() - { - $this->expectsRequest('post', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); - $result = $this->client->paymentMethods->update( - 'pm_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - public function testAttachPaymentMethod() - { - $this->expectsRequest( - 'post', - '/v1/payment_methods/pm_xxxxxxxxxxxxx/attach' - ); - $result = $this->client->paymentMethods->attach( - 'pm_xxxxxxxxxxxxx', - ['customer' => 'cus_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - public function testDetachPaymentMethod() - { - $this->expectsRequest( - 'post', - '/v1/payment_methods/pm_xxxxxxxxxxxxx/detach' - ); - $result = $this->client->paymentMethods->detach('pm_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); - } - public function testListPayout() - { - $this->expectsRequest('get', '/v1/payouts'); - $result = $this->client->payouts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Payout::class, $result->data[0]); - } - public function testCreatePayout() - { - $this->expectsRequest('post', '/v1/payouts'); - $result = $this->client->payouts->create( - ['amount' => 1100, 'currency' => 'usd'] - ); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - public function testRetrievePayout() - { - $this->expectsRequest('get', '/v1/payouts/po_xxxxxxxxxxxxx'); - $result = $this->client->payouts->retrieve('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - public function testUpdatePayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx'); - $result = $this->client->payouts->update( - 'po_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - public function testCancelPayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/cancel'); - $result = $this->client->payouts->cancel('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - public function testReversePayout() - { - $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/reverse'); - $result = $this->client->payouts->reverse('po_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Payout::class, $result); - } - public function testListPlan() - { - $this->expectsRequest('get', '/v1/plans'); - $result = $this->client->plans->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Plan::class, $result->data[0]); - } - public function testCreatePlan() - { - $this->expectsRequest('post', '/v1/plans'); - $result = $this->client->plans->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'interval' => 'month', - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - public function testDeletePlan() - { - $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - public function testRetrievePlan() - { - $this->expectsRequest('get', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->retrieve('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - public function testUpdatePlan() - { - $this->expectsRequest('post', '/v1/plans/price_xxxxxxxxxxxxx'); - $result = $this->client->plans->update( - 'price_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Plan::class, $result); - } - public function testListPrice() - { - $this->expectsRequest('get', '/v1/prices'); - $result = $this->client->prices->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); - } - public function testCreatePrice2() - { - $this->expectsRequest('post', '/v1/prices'); - $result = $this->client->prices->create( - [ - 'unit_amount' => 2000, - 'currency' => 'usd', - 'recurring' => ['interval' => 'month'], - 'product' => 'prod_xxxxxxxxxxxxx', - ] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - public function testRetrievePrice() - { - $this->expectsRequest('get', '/v1/prices/price_xxxxxxxxxxxxx'); - $result = $this->client->prices->retrieve('price_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - public function testUpdatePrice() - { - $this->expectsRequest('post', '/v1/prices/price_xxxxxxxxxxxxx'); - $result = $this->client->prices->update( - 'price_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Price::class, $result); - } - public function testSearchPrice() - { - $this->expectsRequest('get', '/v1/prices/search'); - $result = $this->client->prices->search( - ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); - } - public function testListProduct() - { - $this->expectsRequest('get', '/v1/products'); - $result = $this->client->products->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); - } - public function testCreateProduct() - { - $this->expectsRequest('post', '/v1/products'); - $result = $this->client->products->create(['name' => 'Gold Special']); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - public function testDeleteProduct() - { - $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - public function testRetrieveProduct() - { - $this->expectsRequest('get', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->retrieve('prod_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - public function testUpdateProduct() - { - $this->expectsRequest('post', '/v1/products/prod_xxxxxxxxxxxxx'); - $result = $this->client->products->update( - 'prod_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Product::class, $result); - } - public function testSearchProduct() - { - $this->expectsRequest('get', '/v1/products/search'); - $result = $this->client->products->search( - ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); - } - public function testListPromotionCode() - { - $this->expectsRequest('get', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result->data[0]); - } - public function testCreatePromotionCode() - { - $this->expectsRequest('post', '/v1/promotion_codes'); - $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - public function testRetrievePromotionCode() - { - $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); - $result = $this->client->promotionCodes->retrieve( - 'promo_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - public function testUpdatePromotionCode() - { - $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); - $result = $this->client->promotionCodes->update( - 'promo_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\PromotionCode::class, $result); - } - public function testListQuote() - { - $this->expectsRequest('get', '/v1/quotes'); - $result = $this->client->quotes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Quote::class, $result->data[0]); - } - public function testCreateQuote() - { - $this->expectsRequest('post', '/v1/quotes'); - $result = $this->client->quotes->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], - ] - ); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testRetrieveQuote() - { - $this->expectsRequest('get', '/v1/quotes/qt_xxxxxxxxxxxxx'); - $result = $this->client->quotes->retrieve('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testUpdateQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx'); - $result = $this->client->quotes->update( - 'qt_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testAcceptQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/accept'); - $result = $this->client->quotes->accept('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testCancelQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/cancel'); - $result = $this->client->quotes->cancel('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testFinalizeQuoteQuote() - { - $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/finalize'); - $result = $this->client->quotes->finalizeQuote('qt_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Quote::class, $result); - } - public function testListEarlyFraudWarning() - { - $this->expectsRequest('get', '/v1/radar/early_fraud_warnings'); - $result = $this->client->radar->earlyFraudWarnings->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result->data[0]); - } - public function testRetrieveEarlyFraudWarning() - { - $this->expectsRequest( - 'get', - '/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->earlyFraudWarnings->retrieve( - 'issfr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result); - } - public function testListValueListItem() - { - $this->expectsRequest('get', '/v1/radar/value_list_items'); - $result = $this->client->radar->valueListItems->all( - ['limit' => 3, 'value_list' => 'rsl_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result->data[0]); - } - public function testCreateValueListItem() - { - $this->expectsRequest('post', '/v1/radar/value_list_items'); - $result = $this->client->radar->valueListItems->create( - ['value_list' => 'rsl_xxxxxxxxxxxxx', 'value' => '1.2.3.4'] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - public function testDeleteValueListItem() - { - $this->expectsRequest( - 'delete', - '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->valueListItems->delete( - 'rsli_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - public function testRetrieveValueListItem() - { - $this->expectsRequest( - 'get', - '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' - ); - $result = $this->client->radar->valueListItems->retrieve( - 'rsli_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); - } - public function testListValueList() - { - $this->expectsRequest('get', '/v1/radar/value_lists'); - $result = $this->client->radar->valueLists->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result->data[0]); - } - public function testCreateValueList() - { - $this->expectsRequest('post', '/v1/radar/value_lists'); - $result = $this->client->radar->valueLists->create( - [ - 'alias' => 'custom_ip_xxxxxxxxxxxxx', - 'name' => 'Custom IP Blocklist', - 'item_type' => 'ip_address', - ] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - public function testDeleteValueList() - { - $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - public function testRetrieveValueList() - { - $this->expectsRequest('get', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->retrieve( - 'rsl_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - public function testUpdateValueList() - { - $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); - $result = $this->client->radar->valueLists->update( - 'rsl_xxxxxxxxxxxxx', - ['name' => 'Updated IP Block List'] - ); - static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); - } - public function testListRefund() - { - $this->expectsRequest('get', '/v1/refunds'); - $result = $this->client->refunds->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Refund::class, $result->data[0]); - } - public function testCreateRefund() - { - $this->expectsRequest('post', '/v1/refunds'); - $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - public function testRetrieveRefund() - { - $this->expectsRequest('get', '/v1/refunds/re_xxxxxxxxxxxxx'); - $result = $this->client->refunds->retrieve('re_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - public function testUpdateRefund() - { - $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx'); - $result = $this->client->refunds->update( - 're_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - public function testCancelRefund() - { - $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx/cancel'); - $result = $this->client->refunds->cancel('re_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Refund::class, $result); - } - public function testListReportRun() - { - $this->expectsRequest('get', '/v1/reporting/report_runs'); - $result = $this->client->reporting->reportRuns->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result->data[0]); - } - public function testCreateReportRun() - { - $this->expectsRequest('post', '/v1/reporting/report_runs'); - $result = $this->client->reporting->reportRuns->create( - [ - 'report_type' => 'balance.summary.1', - 'parameters' => [ - 'interval_start' => 1522540800, - 'interval_end' => 1525132800, - ], - ] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); - } - public function testRetrieveReportRun() - { - $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); - $result = $this->client->reporting->reportRuns->retrieve( - 'frr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); - } - public function testListReportType() - { - $this->expectsRequest('get', '/v1/reporting/report_types'); - $result = $this->client->reporting->reportTypes->all([]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result->data[0]); - } - public function testRetrieveReportType() - { - $this->expectsRequest( - 'get', - '/v1/reporting/report_types/balance.summary.1' - ); - $result = $this->client->reporting->reportTypes->retrieve( - 'balance.summary.1', - [] - ); - static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result); - } - public function testListReview() - { - $this->expectsRequest('get', '/v1/reviews'); - $result = $this->client->reviews->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Review::class, $result->data[0]); - } - public function testRetrieveReview() - { - $this->expectsRequest('get', '/v1/reviews/prv_xxxxxxxxxxxxx'); - $result = $this->client->reviews->retrieve('prv_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Review::class, $result); - } - public function testApproveReview() - { - $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve'); - $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Review::class, $result); - } - public function testListSetupIntent() - { - $this->expectsRequest('get', '/v1/setup_intents'); - $result = $this->client->setupIntents->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result->data[0]); - } - public function testCreateSetupIntent() - { - $this->expectsRequest('post', '/v1/setup_intents'); - $result = $this->client->setupIntents->create( - ['payment_method_types' => ['card']] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testRetrieveSetupIntent() - { - $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testUpdateSetupIntent() - { - $this->expectsRequest('post', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); - $result = $this->client->setupIntents->update( - 'seti_xxxxxxxxxxxxx', - ['metadata' => ['user_id' => '3435453']] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testCancelSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->setupIntents->cancel('seti_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testConfirmSetupIntent() - { - $this->expectsRequest( - 'post', - '/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm' - ); - $result = $this->client->setupIntents->confirm( - 'seti_xxxxxxxxxxxxx', - ['payment_method' => 'pm_card_visa'] - ); - static::assertInstanceOf(\Stripe\SetupIntent::class, $result); - } - public function testListShippingRate2() - { - $this->expectsRequest('get', '/v1/shipping_rates'); - $result = $this->client->shippingRates->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); - } - public function testCreateShippingRate2() - { - $this->expectsRequest('post', '/v1/shipping_rates'); - $result = $this->client->shippingRates->create( - [ - 'display_name' => 'Ground shipping', - 'type' => 'fixed_amount', - 'fixed_amount' => ['amount' => 500, 'currency' => 'usd'], - ] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - public function testRetrieveShippingRate() - { - $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - public function testUpdateShippingRate() - { - $this->expectsRequest('post', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); - $result = $this->client->shippingRates->update( - 'shr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\ShippingRate::class, $result); - } - public function testListScheduledQueryRun() - { - $this->expectsRequest('get', '/v1/sigma/scheduled_query_runs'); - $result = $this->client->sigma->scheduledQueryRuns->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result->data[0]); - } - public function testRetrieveScheduledQueryRun() - { - $this->expectsRequest( - 'get', - '/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx' - ); - $result = $this->client->sigma->scheduledQueryRuns->retrieve( - 'sqr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result); - } - public function testRetrieveSource() - { - $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - public function testRetrieveSource2() - { - $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - public function testUpdateSource() - { - $this->expectsRequest('post', '/v1/sources/src_xxxxxxxxxxxxx'); - $result = $this->client->sources->update( - 'src_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Source::class, $result); - } - public function testListSubscriptionItem() - { - $this->expectsRequest('get', '/v1/subscription_items'); - $result = $this->client->subscriptionItems->all( - ['subscription' => 'sub_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result->data[0]); - } - public function testCreateSubscriptionItem() - { - $this->expectsRequest('post', '/v1/subscription_items'); - $result = $this->client->subscriptionItems->create( - [ - 'subscription' => 'sub_xxxxxxxxxxxxx', - 'price' => 'price_xxxxxxxxxxxxx', - 'quantity' => 2, - ] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - public function testDeleteSubscriptionItem() - { - $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - public function testRetrieveSubscriptionItem() - { - $this->expectsRequest('get', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->retrieve( - 'si_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - public function testUpdateSubscriptionItem() - { - $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); - $result = $this->client->subscriptionItems->update( - 'si_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); - } - public function testListUsageRecordSummary() - { - $this->expectsRequest( - 'get', - '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries' - ); - $result = $this->client->subscriptionItems->allUsageRecordSummaries( - 'si_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\UsageRecordSummary::class, $result->data[0]); - } - public function testCreateUsageRecord() - { - $this->expectsRequest( - 'post', - '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records' - ); - $result = $this->client->subscriptionItems->createUsageRecord( - 'si_xxxxxxxxxxxxx', - ['quantity' => 100, 'timestamp' => 1571252444] - ); - static::assertInstanceOf(\Stripe\UsageRecord::class, $result); - } - public function testListSubscriptionSchedule() - { - $this->expectsRequest('get', '/v1/subscription_schedules'); - $result = $this->client->subscriptionSchedules->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result->data[0]); - } - public function testCreateSubscriptionSchedule() - { - $this->expectsRequest('post', '/v1/subscription_schedules'); - $result = $this->client->subscriptionSchedules->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'start_date' => 1652909005, - 'end_behavior' => 'release', - 'phases' => [ - [ - 'items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]], - 'iterations' => 12, - ], - ], - ] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - public function testRetrieveSubscriptionSchedule() - { - $this->expectsRequest( - 'get', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' - ); - $result = $this->client->subscriptionSchedules->retrieve( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - public function testUpdateSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' - ); - $result = $this->client->subscriptionSchedules->update( - 'sub_sched_xxxxxxxxxxxxx', - ['end_behavior' => 'release'] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - public function testCancelSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->subscriptionSchedules->cancel( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - public function testReleaseSubscriptionSchedule() - { - $this->expectsRequest( - 'post', - '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release' - ); - $result = $this->client->subscriptionSchedules->release( - 'sub_sched_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); - } - public function testListSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions'); - $result = $this->client->subscriptions->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); - } - public function testCreateSubscription() - { - $this->expectsRequest('post', '/v1/subscriptions'); - $result = $this->client->subscriptions->create( - [ - 'customer' => 'cus_xxxxxxxxxxxxx', - 'items' => [['price' => 'price_xxxxxxxxxxxxx']], - ] - ); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - public function testCancelSubscription() - { - $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - public function testRetrieveSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - public function testUpdateSubscription() - { - $this->expectsRequest('post', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); - $result = $this->client->subscriptions->update( - 'sub_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Subscription::class, $result); - } - public function testSearchSubscription() - { - $this->expectsRequest('get', '/v1/subscriptions/search'); - $result = $this->client->subscriptions->search( - ['query' => 'status:\'active\' AND metadata[\'order_id\']:\'6735\''] - ); - static::assertInstanceOf(\Stripe\SearchResult::class, $result); - static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); - } - public function testListTaxCode() - { - $this->expectsRequest('get', '/v1/tax_codes'); - $result = $this->client->taxCodes->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxCode::class, $result->data[0]); - } - public function testRetrieveTaxCode() - { - $this->expectsRequest('get', '/v1/tax_codes/txcd_xxxxxxxxxxxxx'); - $result = $this->client->taxCodes->retrieve('txcd_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\TaxCode::class, $result); - } - public function testListTaxRate() - { - $this->expectsRequest('get', '/v1/tax_rates'); - $result = $this->client->taxRates->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TaxRate::class, $result->data[0]); - } - public function testCreateTaxRate() - { - $this->expectsRequest('post', '/v1/tax_rates'); - $result = $this->client->taxRates->create( - [ - 'display_name' => 'VAT', - 'description' => 'VAT Germany', - 'jurisdiction' => 'DE', - 'percentage' => 16, - 'inclusive' => false, - ] - ); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - public function testRetrieveTaxRate() - { - $this->expectsRequest('get', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); - $result = $this->client->taxRates->retrieve('txr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - public function testUpdateTaxRate() - { - $this->expectsRequest('post', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); - $result = $this->client->taxRates->update( - 'txr_xxxxxxxxxxxxx', - ['active' => false] - ); - static::assertInstanceOf(\Stripe\TaxRate::class, $result); - } - public function testListConfiguration3() - { - $this->expectsRequest('get', '/v1/terminal/configurations'); - $result = $this->client->terminal->configurations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); - } - public function testDeleteConfiguration2() - { - $this->expectsRequest( - 'delete', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->delete( - 'tmc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testRetrieveConfiguration3() - { - $this->expectsRequest( - 'get', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->retrieve( - 'tmc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testUpdateConfiguration3() - { - $this->expectsRequest( - 'post', - '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' - ); - $result = $this->client->terminal->configurations->update( - 'tmc_xxxxxxxxxxxxx', - ['bbpos_wisepos_e' => ['splashscreen' => 'file_xxxxxxxxxxxxx']] - ); - static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); - } - public function testCreateConnectionToken() - { - $this->expectsRequest('post', '/v1/terminal/connection_tokens'); - $result = $this->client->terminal->connectionTokens->create([]); - static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result); - } - public function testListLocation() - { - $this->expectsRequest('get', '/v1/terminal/locations'); - $result = $this->client->terminal->locations->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result->data[0]); - } - public function testCreateLocation() - { - $this->expectsRequest('post', '/v1/terminal/locations'); - $result = $this->client->terminal->locations->create( - [ - 'display_name' => 'My First Store', - 'address' => [ - 'line1' => '1234 Main Street', - 'city' => 'San Francisco', - 'country' => 'US', - 'postal_code' => '94111', - ], - ] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - public function testDeleteLocation() - { - $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->delete( - 'tml_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - public function testRetrieveLocation() - { - $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->retrieve( - 'tml_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - public function testUpdateLocation() - { - $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); - $result = $this->client->terminal->locations->update( - 'tml_xxxxxxxxxxxxx', - ['display_name' => 'My First Store'] - ); - static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); - } - public function testListReader() - { - $this->expectsRequest('get', '/v1/terminal/readers'); - $result = $this->client->terminal->readers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result->data[0]); - } - public function testCreateReader() - { - $this->expectsRequest('post', '/v1/terminal/readers'); - $result = $this->client->terminal->readers->create( - [ - 'registration_code' => 'puppies-plug-could', - 'label' => 'Blue Rabbit', - 'location' => 'tml_1234', - ] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testDeleteReader() - { - $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testRetrieveReader() - { - $this->expectsRequest('get', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->retrieve( - 'tmr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testUpdateReader() - { - $this->expectsRequest('post', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); - $result = $this->client->terminal->readers->update( - 'tmr_xxxxxxxxxxxxx', - ['label' => 'Blue Rabbit'] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testCancelActionReader() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action' - ); - $result = $this->client->terminal->readers->cancelAction( - 'tmr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testProcessPaymentIntentReader() - { - $this->expectsRequest( - 'post', - '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent' - ); - $result = $this->client->terminal->readers->processPaymentIntent( - 'tmr_xxxxxxxxxxxxx', - ['payment_intent' => 'pi_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); - } - public function testListTestClock2() - { - $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); - } - public function testCreateTestClock2() - { - $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); - $result = $this->client->testHelpers->testClocks->create( - ['frozen_time' => 1577836800] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testDeleteTestClock2() - { - $this->expectsRequest( - 'delete', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' - ); - $result = $this->client->testHelpers->testClocks->delete( - 'clock_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testRetrieveTestClock2() - { - $this->expectsRequest( - 'get', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' - ); - $result = $this->client->testHelpers->testClocks->retrieve( - 'clock_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testAdvanceTestClock2() - { - $this->expectsRequest( - 'post', - '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance' - ); - $result = $this->client->testHelpers->testClocks->advance( - 'clock_xxxxxxxxxxxxx', - ['frozen_time' => 1652390605] - ); - static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); - } - public function testCreateToken2() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'bank_account' => [ - 'country' => 'US', - 'currency' => 'usd', - 'account_holder_name' => 'Jenny Rosen', - 'account_holder_type' => 'individual', - 'routing_number' => '110000000', - 'account_number' => '000123456789', - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testCreateToken3() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - ['pii' => ['id_number' => '000000000']] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testCreateToken4() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'account' => [ - 'individual' => ['first_name' => 'Jane', 'last_name' => 'Doe'], - 'tos_shown_and_accepted' => true, - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testCreateToken5() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create( - [ - 'person' => [ - 'first_name' => 'Jane', - 'last_name' => 'Doe', - 'relationship' => ['owner' => true], - ], - ] - ); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testCreateToken6() - { - $this->expectsRequest('post', '/v1/tokens'); - $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testRetrieveToken() - { - $this->expectsRequest('get', '/v1/tokens/tok_xxxx'); - $result = $this->client->tokens->retrieve('tok_xxxx', []); - static::assertInstanceOf(\Stripe\Token::class, $result); - } - public function testListTopup() - { - $this->expectsRequest('get', '/v1/topups'); - $result = $this->client->topups->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Topup::class, $result->data[0]); - } - public function testCreateTopup() - { - $this->expectsRequest('post', '/v1/topups'); - $result = $this->client->topups->create( - [ - 'amount' => 2000, - 'currency' => 'usd', - 'description' => 'Top-up for Jenny Rosen', - 'statement_descriptor' => 'Top-up', - ] - ); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - public function testRetrieveTopup() - { - $this->expectsRequest('get', '/v1/topups/tu_xxxxxxxxxxxxx'); - $result = $this->client->topups->retrieve('tu_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - public function testUpdateTopup() - { - $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx'); - $result = $this->client->topups->update( - 'tu_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - public function testCancelTopup() - { - $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel'); - $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Topup::class, $result); - } - public function testListTransfer() - { - $this->expectsRequest('get', '/v1/transfers'); - $result = $this->client->transfers->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Transfer::class, $result->data[0]); - } - public function testCreateTransfer() - { - $this->expectsRequest('post', '/v1/transfers'); - $result = $this->client->transfers->create( - [ - 'amount' => 400, - 'currency' => 'usd', - 'destination' => 'acct_xxxxxxxxxxxxx', - 'transfer_group' => 'ORDER_95', - ] - ); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - public function testRetrieveTransfer() - { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx'); - $result = $this->client->transfers->retrieve('tr_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - public function testUpdateTransfer() - { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx'); - $result = $this->client->transfers->update( - 'tr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Transfer::class, $result); - } - public function testListTransferReversal() - { - $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); - $result = $this->client->transfers->allReversals( - 'tr_xxxxxxxxxxxxx', - ['limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result->data[0]); - } - public function testCreateTransferReversal() - { - $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); - $result = $this->client->transfers->createReversal( - 'tr_xxxxxxxxxxxxx', - ['amount' => 100] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - public function testRetrieveTransferReversal() - { - $this->expectsRequest( - 'get', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' - ); - $result = $this->client->transfers->retrieveReversal( - 'tr_xxxxxxxxxxxxx', - 'trr_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - public function testUpdateTransferReversal() - { - $this->expectsRequest( - 'post', - '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' - ); - $result = $this->client->transfers->updateReversal( - 'tr_xxxxxxxxxxxxx', - 'trr_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\TransferReversal::class, $result); - } - public function testListCreditReversal() - { - $this->expectsRequest('get', '/v1/treasury/credit_reversals'); - $result = $this->client->treasury->creditReversals->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result->data[0]); - } - public function testCreateCreditReversal() - { - $this->expectsRequest('post', '/v1/treasury/credit_reversals'); - $result = $this->client->treasury->creditReversals->create( - ['received_credit' => 'rc_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); - } - public function testRetrieveCreditReversal() - { - $this->expectsRequest( - 'get', - '/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->creditReversals->retrieve( - 'credrev_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); - } - public function testListDebitReversal() - { - $this->expectsRequest('get', '/v1/treasury/debit_reversals'); - $result = $this->client->treasury->debitReversals->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result->data[0]); - } - public function testCreateDebitReversal() - { - $this->expectsRequest('post', '/v1/treasury/debit_reversals'); - $result = $this->client->treasury->debitReversals->create( - ['received_debit' => 'rd_xxxxxxxxxxxxx'] - ); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); - } - public function testRetrieveDebitReversal() - { - $this->expectsRequest( - 'get', - '/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->debitReversals->retrieve( - 'debrev_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); - } - public function testListFinancialAccount() - { - $this->expectsRequest('get', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); - } - public function testCreateFinancialAccount() - { - $this->expectsRequest('post', '/v1/treasury/financial_accounts'); - $result = $this->client->treasury->financialAccounts->create( - ['supported_currencies' => ['usd'], 'features' => []] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - public function testRetrieveFinancialAccount() - { - $this->expectsRequest( - 'get', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->financialAccounts->retrieve( - 'fa_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - public function testUpdateFinancialAccount() - { - $this->expectsRequest( - 'post', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->financialAccounts->update( - 'fa_xxxxxxxxxxxxx', - ['metadata' => ['order_id' => '6735']] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); - } - public function testRetrieveFeaturesFinancialAccount() - { - $this->expectsRequest( - 'get', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' - ); - $result = $this->client->treasury->financialAccounts->retrieveFeatures( - 'fa_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); - } - public function testUpdateFeaturesFinancialAccount() - { - $this->expectsRequest( - 'post', - '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' - ); - $result = $this->client->treasury->financialAccounts->updateFeatures( - 'fa_xxxxxxxxxxxxx', - ['card_issuing' => ['requested' => false]] - ); - static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); - } - public function testListInboundTransfer() - { - $this->expectsRequest('get', '/v1/treasury/inbound_transfers'); - $result = $this->client->treasury->inboundTransfers->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result->data[0]); - } - public function testCreateInboundTransfer() - { - $this->expectsRequest('post', '/v1/treasury/inbound_transfers'); - $result = $this->client->treasury->inboundTransfers->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'amount' => 10000, - 'currency' => 'usd', - 'origin_payment_method' => 'pm_xxxxxxxxxxxxx', - 'description' => 'InboundTransfer from my bank account', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testRetrieveInboundTransfer() - { - $this->expectsRequest( - 'get', - '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->inboundTransfers->retrieve( - 'ibt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testCancelInboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->inboundTransfers->cancel( - 'ibt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); - } - public function testListOutboundPayment() - { - $this->expectsRequest('get', '/v1/treasury/outbound_payments'); - $result = $this->client->treasury->outboundPayments->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result->data[0]); - } - public function testCreateOutboundPayment() - { - $this->expectsRequest('post', '/v1/treasury/outbound_payments'); - $result = $this->client->treasury->outboundPayments->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'amount' => 10000, - 'currency' => 'usd', - 'customer' => 'cu_xxxxxxxxxxxxx', - 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', - 'description' => 'OutboundPayment to a 3rd party', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - public function testRetrieveOutboundPayment() - { - $this->expectsRequest( - 'get', - '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->outboundPayments->retrieve( - 'obp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - public function testCancelOutboundPayment() - { - $this->expectsRequest( - 'post', - '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->outboundPayments->cancel( - 'obp_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); - } - public function testListOutboundTransfer() - { - $this->expectsRequest('get', '/v1/treasury/outbound_transfers'); - $result = $this->client->treasury->outboundTransfers->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result->data[0]); - } - public function testCreateOutboundTransfer() - { - $this->expectsRequest('post', '/v1/treasury/outbound_transfers'); - $result = $this->client->treasury->outboundTransfers->create( - [ - 'financial_account' => 'fa_xxxxxxxxxxxxx', - 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', - 'amount' => 500, - 'currency' => 'usd', - 'description' => 'OutboundTransfer to my external bank account', - ] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testRetrieveOutboundTransfer() - { - $this->expectsRequest( - 'get', - '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->outboundTransfers->retrieve( - 'obt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testCancelOutboundTransfer() - { - $this->expectsRequest( - 'post', - '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel' - ); - $result = $this->client->treasury->outboundTransfers->cancel( - 'obt_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); - } - public function testListReceivedCredit() - { - $this->expectsRequest('get', '/v1/treasury/received_credits'); - $result = $this->client->treasury->receivedCredits->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result->data[0]); - } - public function testRetrieveReceivedCredit() - { - $this->expectsRequest( - 'get', - '/v1/treasury/received_credits/rc_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->receivedCredits->retrieve( - 'rc_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); - } - public function testListReceivedDebit() - { - $this->expectsRequest('get', '/v1/treasury/received_debits'); - $result = $this->client->treasury->receivedDebits->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result->data[0]); - } - public function testRetrieveReceivedDebit() - { - $this->expectsRequest( - 'get', - '/v1/treasury/received_debits/rd_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->receivedDebits->retrieve( - 'rd_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); - } - public function testListTransactionEntry() - { - $this->expectsRequest('get', '/v1/treasury/transaction_entries'); - $result = $this->client->treasury->transactionEntries->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result->data[0]); - } - public function testRetrieveTransactionEntry() - { - $this->expectsRequest( - 'get', - '/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->transactionEntries->retrieve( - 'trxne_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result); - } - public function testListTransaction2() - { - $this->expectsRequest('get', '/v1/treasury/transactions'); - $result = $this->client->treasury->transactions->all( - ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] - ); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result->data[0]); - } - public function testRetrieveTransaction2() - { - $this->expectsRequest( - 'get', - '/v1/treasury/transactions/trxn_xxxxxxxxxxxxx' - ); - $result = $this->client->treasury->transactions->retrieve( - 'trxn_xxxxxxxxxxxxx', - [] - ); - static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result); - } - public function testListWebhookEndpoint() - { - $this->expectsRequest('get', '/v1/webhook_endpoints'); - $result = $this->client->webhookEndpoints->all(['limit' => 3]); - static::assertInstanceOf(\Stripe\Collection::class, $result); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result->data[0]); - } - public function testDeleteWebhookEndpoint() - { - $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } - public function testRetrieveWebhookEndpoint() - { - $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } - public function testUpdateWebhookEndpoint() - { - $this->expectsRequest('post', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); - $result = $this->client->webhookEndpoints->update( - 'we_xxxxxxxxxxxxx', - ['url' => 'https://example.com/new_endpoint'] - ); - static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); - } -} \ No newline at end of file + use TestHelper; + + /** @var null|\Stripe\StripeClient */ + private $client; + + /** @before */ + protected function setUpService() + { + $this->client = new \Stripe\StripeClient(['api_key' => 'sk_test_123', 'api_base' => MOCK_URL]); + } + + public function testListSecret() + { + $this->expectsRequest('get', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->all( + ['scope' => ['type' => 'account'], 'limit' => 2] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result->data[0]); + } + + public function testCreateSecret() + { + $this->expectsRequest('post', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->create( + [ + 'name' => 'sec_123', + 'payload' => 'very secret string', + 'scope' => ['type' => 'account'], + ] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + + public function testDeleteWhereSecret() + { + $this->expectsRequest('post', '/v1/apps/secrets/delete'); + $result = $this->client->apps->secrets->deleteWhere( + ['name' => 'my-api-key', 'scope' => ['type' => 'account']] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + + public function testFindSecret() + { + $this->expectsRequest('get', '/v1/apps/secrets/find'); + $result = $this->client->apps->secrets->find( + ['name' => 'sec_123', 'scope' => ['type' => 'account']] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + + public function testCreateSession() + { + $this->expectsRequest('post', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->create( + [ + 'success_url' => 'https://example.com/success', + 'cancel_url' => 'https://example.com/cancel', + 'mode' => 'payment', + 'shipping_options' => [ + ['shipping_rate' => 'shr_standard'], + [ + 'shipping_rate_data' => [ + 'display_name' => 'Standard', + 'delivery_estimate' => [ + 'minimum' => ['unit' => 'day', 'value' => 5], + 'maximum' => ['unit' => 'day', 'value' => 7], + ], + ], + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + + public function testExpireSession() + { + $this->expectsRequest('post', '/v1/checkout/sessions/sess_xyz/expire'); + $result = $this->client->checkout->sessions->expire('sess_xyz', []); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + + public function testListLineItemsSession() + { + $this->expectsRequest('get', '/v1/checkout/sessions/sess_xyz/line_items'); + $result = $this->client->checkout->sessions->allLineItems('sess_xyz', []); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); + } + + public function testRetrieveCashBalance() + { + $this->expectsRequest('get', '/v1/customers/cus_123/cash_balance'); + $result = $this->client->customers->retrieveCashBalance('cus_123', []); + static::assertInstanceOf(\Stripe\CashBalance::class, $result); + } + + public function testUpdateCashBalance() + { + $this->expectsRequest('post', '/v1/customers/cus_123/cash_balance'); + $result = $this->client->customers->updateCashBalance( + 'cus_123', + ['settings' => ['reconciliation_mode' => 'manual']] + ); + static::assertInstanceOf(\Stripe\CashBalance::class, $result); + } + + public function testCreateFundingInstructionsCustomer() + { + $this->expectsRequest('post', '/v1/customers/cus_123/funding_instructions'); + $result = $this->client->customers->createFundingInstructions( + 'cus_123', + [ + 'bank_transfer' => [ + 'requested_address_types' => ['zengin'], + 'type' => 'jp_bank_transfer', + ], + 'currency' => 'usd', + 'funding_type' => 'bank_transfer', + ] + ); + static::assertInstanceOf(\Stripe\FundingInstructions::class, $result); + } + + public function testListAccount() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts'); + $result = $this->client->financialConnections->accounts->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); + } + + public function testRetrieveAccount() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts/fca_xyz'); + $result = $this->client->financialConnections->accounts->retrieve( + 'fca_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + + public function testDisconnectAccount() + { + $this->expectsRequest( + 'post', + '/v1/financial_connections/accounts/fca_xyz/disconnect' + ); + $result = $this->client->financialConnections->accounts->disconnect( + 'fca_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + + public function testListOwnersAccount() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xyz/owners' + ); + $result = $this->client->financialConnections->accounts->allOwners( + 'fca_xyz', + ['ownership' => 'fcaowns_xyz'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); + } + + public function testRefreshAccount() + { + $this->expectsRequest( + 'post', + '/v1/financial_connections/accounts/fca_xyz/refresh' + ); + $result = $this->client->financialConnections->accounts->refresh( + 'fca_xyz', + ['features' => ['balance']] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + + public function testCreateSession2() + { + $this->expectsRequest('post', '/v1/financial_connections/sessions'); + $result = $this->client->financialConnections->sessions->create( + [ + 'account_holder' => ['type' => 'customer', 'customer' => 'cus_123'], + 'permissions' => ['balances'], + ] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + + public function testRetrieveSession() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/sessions/fcsess_xyz' + ); + $result = $this->client->financialConnections->sessions->retrieve( + 'fcsess_xyz', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + + public function testUpcomingInvoice() + { + $this->expectsRequest('get', '/v1/invoices/upcoming'); + $result = $this->client->invoices->upcoming( + ['customer' => 'cus_9utnxg47pWjV1e'] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testCreatePaymentIntent() + { + $this->expectsRequest('post', '/v1/payment_intents'); + $result = $this->client->paymentIntents->create( + [ + 'amount' => 1099, + 'currency' => 'eur', + 'automatic_payment_methods' => ['enabled' => true], + ] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testVerifyMicrodepositsPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits' + ); + $result = $this->client->paymentIntents->verifyMicrodeposits( + 'pi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testCreatePaymentLink() + { + $this->expectsRequest('post', '/v1/payment_links'); + $result = $this->client->paymentLinks->create( + ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + + public function testRetrievePaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links/pl_xyz'); + $result = $this->client->paymentLinks->retrieve('pl_xyz', []); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + + public function testListLineItemsPaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links/pl_xyz/line_items'); + $result = $this->client->paymentLinks->allLineItems('pl_xyz', []); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]); + } + + public function testCreatePrice() + { + $this->expectsRequest('post', '/v1/prices'); + $result = $this->client->prices->create( + [ + 'unit_amount' => 2000, + 'currency' => 'usd', + 'currency_options' => [ + 'uah' => ['unit_amount' => 5000], + 'eur' => ['unit_amount' => 1800], + ], + 'recurring' => ['interval' => 'month'], + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + + public function testListSetupAttempt() + { + $this->expectsRequest('get', '/v1/setup_attempts'); + $result = $this->client->setupAttempts->all( + ['limit' => 3, 'setup_intent' => 'si_xyz'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]); + } + + public function testVerifyMicrodepositsSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits' + ); + $result = $this->client->setupIntents->verifyMicrodeposits( + 'seti_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testListShippingRate() + { + $this->expectsRequest('get', '/v1/shipping_rates'); + $result = $this->client->shippingRates->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); + } + + public function testCreateShippingRate() + { + $this->expectsRequest('post', '/v1/shipping_rates'); + $result = $this->client->shippingRates->create( + [ + 'display_name' => 'Sample Shipper', + 'fixed_amount' => ['currency' => 'usd', 'amount' => 400], + 'type' => 'fixed_amount', + ] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + + public function testListConfiguration() + { + $this->expectsRequest('get', '/v1/terminal/configurations'); + $result = $this->client->terminal->configurations->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); + } + + public function testDeleteConfiguration() + { + $this->expectsRequest('delete', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->delete('uc_123', []); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testRetrieveConfiguration() + { + $this->expectsRequest('get', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->retrieve('uc_123', []); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testUpdateConfiguration() + { + $this->expectsRequest('post', '/v1/terminal/configurations/uc_123'); + $result = $this->client->terminal->configurations->update( + 'uc_123', + ['tipping' => ['usd' => ['fixed_amounts' => [10]]]] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testFundCashBalanceCustomer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/customers/cus_123/fund_cash_balance' + ); + $result = $this->client->testHelpers->customers->fundCashBalance( + 'cus_123', + ['amount' => 30, 'currency' => 'eur'] + ); + static::assertInstanceOf(\Stripe\CustomerCashBalanceTransaction::class, $result); + } + + public function testDeliverCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/deliver' + ); + $result = $this->client->testHelpers->issuing->cards->deliverCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testFailCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/fail' + ); + $result = $this->client->testHelpers->issuing->cards->failCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testReturnCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/return' + ); + $result = $this->client->testHelpers->issuing->cards->returnCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testShipCardCard() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/issuing/cards/card_123/shipping/ship' + ); + $result = $this->client->testHelpers->issuing->cards->shipCard( + 'card_123', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testExpireRefund() + { + $this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire'); + $result = $this->client->testHelpers->refunds->expire('re_123', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + + public function testListTestClock() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); + } + + public function testCreateTestClock() + { + $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->create( + ['frozen_time' => 123, 'name' => 'cogsworth'] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testDeleteTestClock() + { + $this->expectsRequest('delete', '/v1/test_helpers/test_clocks/clock_xyz'); + $result = $this->client->testHelpers->testClocks->delete('clock_xyz', []); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testRetrieveTestClock() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks/clock_xyz'); + $result = $this->client->testHelpers->testClocks->retrieve('clock_xyz', []); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testAdvanceTestClock() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/test_clocks/clock_xyz/advance' + ); + $result = $this->client->testHelpers->testClocks->advance( + 'clock_xyz', + ['frozen_time' => 142] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testFailInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->fail( + 'ibt_123', + ['failure_details' => ['code' => 'account_closed']] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testReturnInboundTransferInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/return' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->returnInboundTransfer( + 'ibt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testSucceedInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed' + ); + $result = $this->client->testHelpers->treasury->inboundTransfers->succeed( + 'ibt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testFailOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/fail' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->fail( + 'obt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testPostOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/post' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->post( + 'obt_123', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testReturnOutboundTransferOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/treasury/outbound_transfers/obt_123/return' + ); + $result = $this->client->testHelpers->treasury->outboundTransfers->returnOutboundTransfer( + 'obt_123', + ['returned_details' => ['code' => 'account_closed']] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testCreateReceivedCredit() + { + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_credits'); + $result = $this->client->testHelpers->treasury->receivedCredits->create( + [ + 'financial_account' => 'fa_123', + 'network' => 'ach', + 'amount' => 1234, + 'currency' => 'usd', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); + } + + public function testCreateReceivedDebit() + { + $this->expectsRequest('post', '/v1/test_helpers/treasury/received_debits'); + $result = $this->client->testHelpers->treasury->receivedDebits->create( + [ + 'financial_account' => 'fa_123', + 'network' => 'ach', + 'amount' => 1234, + 'currency' => 'usd', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); + } + + public function testCreateToken() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'card' => [ + 'number' => '4242424242424242', + 'exp_month' => '5', + 'exp_year' => '2023', + 'cvc' => '314', + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testCreateAccountLink() + { + $this->expectsRequest('post', '/v1/account_links'); + $result = $this->client->accountLinks->create( + [ + 'account' => 'acct_xxxxxxxxxxxxx', + 'refresh_url' => 'https://example.com/reauth', + 'return_url' => 'https://example.com/return', + 'type' => 'account_onboarding', + ] + ); + static::assertInstanceOf(\Stripe\AccountLink::class, $result); + } + + public function testListAccount2() + { + $this->expectsRequest('get', '/v1/accounts'); + $result = $this->client->accounts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Account::class, $result->data[0]); + } + + public function testCreateAccount() + { + $this->expectsRequest('post', '/v1/accounts'); + $result = $this->client->accounts->create( + [ + 'type' => 'custom', + 'country' => 'US', + 'email' => 'jenny.rosen@example.com', + 'capabilities' => [ + 'card_payments' => ['requested' => true], + 'transfers' => ['requested' => true], + ], + ] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + + public function testDeleteAccount() + { + $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + + public function testRetrieveAccount2() + { + $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->retrieve('acct_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + + public function testUpdateAccount() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx'); + $result = $this->client->accounts->update( + 'acct_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + + public function testRejectAccount() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/reject'); + $result = $this->client->accounts->reject( + 'acct_xxxxxxxxxxxxx', + ['reason' => 'fraud'] + ); + static::assertInstanceOf(\Stripe\Account::class, $result); + } + + public function testListCapability() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities' + ); + $result = $this->client->accounts->allCapabilities( + 'acct_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Capability::class, $result->data[0]); + } + + public function testRetrieveCapability() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' + ); + $result = $this->client->accounts->retrieveCapability( + 'acct_xxxxxxxxxxxxx', + 'card_payments', + [] + ); + static::assertInstanceOf(\Stripe\Capability::class, $result); + } + + public function testUpdateCapability() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments' + ); + $result = $this->client->accounts->updateCapability( + 'acct_xxxxxxxxxxxxx', + 'card_payments', + ['requested' => true] + ); + static::assertInstanceOf(\Stripe\Capability::class, $result); + } + + public function testCreateLoginLink() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/login_links' + ); + $result = $this->client->accounts->createLoginLink( + 'acct_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\LoginLink::class, $result); + } + + public function testListPerson() + { + $this->expectsRequest('get', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $result = $this->client->accounts->allPersons( + 'acct_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Person::class, $result->data[0]); + } + + public function testCreatePerson() + { + $this->expectsRequest('post', '/v1/accounts/acct_xxxxxxxxxxxxx/persons'); + $result = $this->client->accounts->createPerson( + 'acct_xxxxxxxxxxxxx', + ['first_name' => 'Jane', 'last_name' => 'Diaz'] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + + public function testDeletePerson() + { + $this->expectsRequest( + 'delete', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->deletePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + + public function testRetrievePerson() + { + $this->expectsRequest( + 'get', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->retrievePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + + public function testUpdatePerson() + { + $this->expectsRequest( + 'post', + '/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx' + ); + $result = $this->client->accounts->updatePerson( + 'acct_xxxxxxxxxxxxx', + 'person_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Person::class, $result); + } + + public function testListApplicationFee() + { + $this->expectsRequest('get', '/v1/application_fees'); + $result = $this->client->applicationFees->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ApplicationFee::class, $result->data[0]); + } + + public function testRetrieveApplicationFee() + { + $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx'); + $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\ApplicationFee::class, $result); + } + + public function testListApplicationFeeRefund() + { + $this->expectsRequest( + 'get', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' + ); + $result = $this->client->applicationFees->allRefunds( + 'fee_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result->data[0]); + } + + public function testCreateApplicationFeeRefund() + { + $this->expectsRequest( + 'post', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds' + ); + $result = $this->client->applicationFees->createRefund( + 'fee_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + + public function testRetrieveApplicationFeeRefund() + { + $this->expectsRequest( + 'get', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' + ); + $result = $this->client->applicationFees->retrieveRefund( + 'fee_xxxxxxxxxxxxx', + 'fr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + + public function testUpdateApplicationFeeRefund() + { + $this->expectsRequest( + 'post', + '/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx' + ); + $result = $this->client->applicationFees->updateRefund( + 'fee_xxxxxxxxxxxxx', + 'fr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\ApplicationFeeRefund::class, $result); + } + + public function testCreateSecret2() + { + $this->expectsRequest('post', '/v1/apps/secrets'); + $result = $this->client->apps->secrets->create( + [ + 'name' => 'my-api-key', + 'payload' => 'secret_key_xxxxxx', + 'scope' => ['type' => 'account'], + ] + ); + static::assertInstanceOf(\Stripe\Apps\Secret::class, $result); + } + + public function testListBalanceTransaction() + { + $this->expectsRequest('get', '/v1/balance_transactions'); + $result = $this->client->balanceTransactions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result->data[0]); + } + + public function testRetrieveBalanceTransaction() + { + $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx'); + $result = $this->client->balanceTransactions->retrieve( + 'txn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\BalanceTransaction::class, $result); + } + + public function testListConfiguration2() + { + $this->expectsRequest('get', '/v1/billing_portal/configurations'); + $result = $this->client->billingPortal->configurations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result->data[0]); + } + + public function testRetrieveConfiguration2() + { + $this->expectsRequest( + 'get', + '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' + ); + $result = $this->client->billingPortal->configurations->retrieve( + 'bpc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); + } + + public function testUpdateConfiguration2() + { + $this->expectsRequest( + 'post', + '/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx' + ); + $result = $this->client->billingPortal->configurations->update( + 'bpc_xxxxxxxxxxxxx', + [ + 'business_profile' => [ + 'privacy_policy_url' => 'https://example.com/privacy', + 'terms_of_service_url' => 'https://example.com/terms', + ], + ] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Configuration::class, $result); + } + + public function testCreateSession3() + { + $this->expectsRequest('post', '/v1/billing_portal/sessions'); + $result = $this->client->billingPortal->sessions->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'return_url' => 'https://example.com/account', + ] + ); + static::assertInstanceOf(\Stripe\BillingPortal\Session::class, $result); + } + + public function testListCharge() + { + $this->expectsRequest('get', '/v1/charges'); + $result = $this->client->charges->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); + } + + public function testCreateCharge() + { + $this->expectsRequest('post', '/v1/charges'); + $result = $this->client->charges->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'source' => 'tok_xxxx', + 'description' => 'My First Test Charge (created for API docs)', + ] + ); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + + public function testRetrieveCharge() + { + $this->expectsRequest('get', '/v1/charges/ch_xxxxxxxxxxxxx'); + $result = $this->client->charges->retrieve('ch_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + + public function testUpdateCharge() + { + $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx'); + $result = $this->client->charges->update( + 'ch_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + + public function testCaptureCharge() + { + $this->expectsRequest('post', '/v1/charges/ch_xxxxxxxxxxxxx/capture'); + $result = $this->client->charges->capture('ch_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Charge::class, $result); + } + + public function testSearchCharge() + { + $this->expectsRequest('get', '/v1/charges/search'); + $result = $this->client->charges->search( + ['query' => 'amount>999 AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Charge::class, $result->data[0]); + } + + public function testListSession() + { + $this->expectsRequest('get', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result->data[0]); + } + + public function testCreateSession4() + { + $this->expectsRequest('post', '/v1/checkout/sessions'); + $result = $this->client->checkout->sessions->create( + [ + 'success_url' => 'https://example.com/success', + 'cancel_url' => 'https://example.com/cancel', + 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], + 'mode' => 'payment', + ] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + + public function testRetrieveSession2() + { + $this->expectsRequest('get', '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx'); + $result = $this->client->checkout->sessions->retrieve( + 'cs_test_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + + public function testExpireSession2() + { + $this->expectsRequest( + 'post', + '/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire' + ); + $result = $this->client->checkout->sessions->expire( + 'cs_test_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Checkout\Session::class, $result); + } + + public function testListCountrySpec() + { + $this->expectsRequest('get', '/v1/country_specs'); + $result = $this->client->countrySpecs->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CountrySpec::class, $result->data[0]); + } + + public function testRetrieveCountrySpec() + { + $this->expectsRequest('get', '/v1/country_specs/US'); + $result = $this->client->countrySpecs->retrieve('US', []); + static::assertInstanceOf(\Stripe\CountrySpec::class, $result); + } + + public function testListCoupon() + { + $this->expectsRequest('get', '/v1/coupons'); + $result = $this->client->coupons->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Coupon::class, $result->data[0]); + } + + public function testCreateCoupon() + { + $this->expectsRequest('post', '/v1/coupons'); + $result = $this->client->coupons->create( + [ + 'percent_off' => 25.5, + 'duration' => 'repeating', + 'duration_in_months' => 3, + ] + ); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + + public function testDeleteCoupon() + { + $this->expectsRequest('delete', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->delete('Z4OV52SU', []); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + + public function testRetrieveCoupon() + { + $this->expectsRequest('get', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->retrieve('Z4OV52SU', []); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + + public function testUpdateCoupon() + { + $this->expectsRequest('post', '/v1/coupons/Z4OV52SU'); + $result = $this->client->coupons->update( + 'Z4OV52SU', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Coupon::class, $result); + } + + public function testListCreditNote() + { + $this->expectsRequest('get', '/v1/credit_notes'); + $result = $this->client->creditNotes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CreditNote::class, $result->data[0]); + } + + public function testCreateCreditNote() + { + $this->expectsRequest('post', '/v1/credit_notes'); + $result = $this->client->creditNotes->create( + [ + 'invoice' => 'in_xxxxxxxxxxxxx', + 'lines' => [ + [ + 'type' => 'invoice_line_item', + 'invoice_line_item' => 'il_xxxxxxxxxxxxx', + 'quantity' => 1, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + + public function testVoidCreditNoteCreditNote() + { + $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx/void'); + $result = $this->client->creditNotes->voidCreditNote( + 'cn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + + public function testListCreditNoteLineItem() + { + $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx/lines'); + $result = $this->client->creditNotes->allLines( + 'cn_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CreditNoteLineItem::class, $result->data[0]); + } + + public function testPreviewCreditNote() + { + $this->expectsRequest('get', '/v1/credit_notes/preview'); + $result = $this->client->creditNotes->preview( + [ + 'invoice' => 'in_xxxxxxxxxxxxx', + 'lines' => [ + [ + 'type' => 'invoice_line_item', + 'invoice_line_item' => 'il_xxxxxxxxxxxxx', + 'quantity' => 1, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\CreditNote::class, $result); + } + + public function testListCustomer() + { + $this->expectsRequest('get', '/v1/customers'); + $result = $this->client->customers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + + public function testListCustomer2() + { + $this->expectsRequest('get', '/v1/customers'); + $result = $this->client->customers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + + public function testCreateCustomer() + { + $this->expectsRequest('post', '/v1/customers'); + $result = $this->client->customers->create( + ['description' => 'My First Test Customer (created for API docs)'] + ); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + + public function testDeleteCustomer() + { + $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + + public function testRetrieveCustomer() + { + $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->retrieve('cus_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + + public function testUpdateCustomer() + { + $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx'); + $result = $this->client->customers->update( + 'cus_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Customer::class, $result); + } + + public function testListCustomerBalanceTransaction() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' + ); + $result = $this->client->customers->allBalanceTransactions( + 'cus_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result->data[0]); + } + + public function testCreateCustomerBalanceTransaction() + { + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions' + ); + $result = $this->client->customers->createBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + ['amount' => -500, 'currency' => 'usd'] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + + public function testRetrieveCustomerBalanceTransaction() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->retrieveBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + 'cbtxn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + + public function testUpdateCustomerBalanceTransaction() + { + $this->expectsRequest( + 'post', + '/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->updateBalanceTransaction( + 'cus_xxxxxxxxxxxxx', + 'cbtxn_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result); + } + + public function testListTaxId() + { + $this->expectsRequest('get', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $result = $this->client->customers->allTaxIds( + 'cus_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxId::class, $result->data[0]); + } + + public function testCreateTaxId() + { + $this->expectsRequest('post', '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids'); + $result = $this->client->customers->createTaxId( + 'cus_xxxxxxxxxxxxx', + ['type' => 'eu_vat', 'value' => 'DE123456789'] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testDeleteTaxId() + { + $this->expectsRequest( + 'delete', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->deleteTaxId( + 'cus_xxxxxxxxxxxxx', + 'txi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testRetrieveTaxId() + { + $this->expectsRequest( + 'get', + '/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx' + ); + $result = $this->client->customers->retrieveTaxId( + 'cus_xxxxxxxxxxxxx', + 'txi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TaxId::class, $result); + } + + public function testSearchCustomer() + { + $this->expectsRequest('get', '/v1/customers/search'); + $result = $this->client->customers->search( + ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + + public function testSearchCustomer2() + { + $this->expectsRequest('get', '/v1/customers/search'); + $result = $this->client->customers->search( + ['query' => 'name:\'fakename\' AND metadata[\'foo\']:\'bar\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Customer::class, $result->data[0]); + } + + public function testListDispute() + { + $this->expectsRequest('get', '/v1/disputes'); + $result = $this->client->disputes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Dispute::class, $result->data[0]); + } + + public function testRetrieveDispute() + { + $this->expectsRequest('get', '/v1/disputes/dp_xxxxxxxxxxxxx'); + $result = $this->client->disputes->retrieve('dp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + + public function testUpdateDispute() + { + $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx'); + $result = $this->client->disputes->update( + 'dp_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + + public function testCloseDispute() + { + $this->expectsRequest('post', '/v1/disputes/dp_xxxxxxxxxxxxx/close'); + $result = $this->client->disputes->close('dp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Dispute::class, $result); + } + + public function testListEvent() + { + $this->expectsRequest('get', '/v1/events'); + $result = $this->client->events->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Event::class, $result->data[0]); + } + + public function testRetrieveEvent() + { + $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx'); + $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Event::class, $result); + } + + public function testListFileLink() + { + $this->expectsRequest('get', '/v1/file_links'); + $result = $this->client->fileLinks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FileLink::class, $result->data[0]); + } + + public function testCreateFileLink() + { + $this->expectsRequest('post', '/v1/file_links'); + $result = $this->client->fileLinks->create( + ['file' => 'file_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + + public function testRetrieveFileLink() + { + $this->expectsRequest('get', '/v1/file_links/link_xxxxxxxxxxxxx'); + $result = $this->client->fileLinks->retrieve('link_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + + public function testUpdateFileLink() + { + $this->expectsRequest('post', '/v1/file_links/link_xxxxxxxxxxxxx'); + $result = $this->client->fileLinks->update( + 'link_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\FileLink::class, $result); + } + + public function testListFile() + { + $this->expectsRequest('get', '/v1/files'); + $result = $this->client->files->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\File::class, $result->data[0]); + } + + public function testRetrieveFile() + { + $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx'); + $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\File::class, $result); + } + + public function testListAccount3() + { + $this->expectsRequest('get', '/v1/financial_connections/accounts'); + $result = $this->client->financialConnections->accounts->all( + ['account_holder' => ['customer' => 'cus_xxxxxxxxxxxxx']] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result->data[0]); + } + + public function testRetrieveAccount3() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx' + ); + $result = $this->client->financialConnections->accounts->retrieve( + 'fca_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Account::class, $result); + } + + public function testListOwnersAccount2() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners' + ); + $result = $this->client->financialConnections->accounts->allOwners( + 'fca_xxxxxxxxxxxxx', + ['limit' => 3, 'ownership' => 'fcaowns_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\FinancialConnections\AccountOwner::class, $result->data[0]); + } + + public function testCreateSession5() + { + $this->expectsRequest('post', '/v1/financial_connections/sessions'); + $result = $this->client->financialConnections->sessions->create( + [ + 'account_holder' => [ + 'type' => 'customer', + 'customer' => 'cus_xxxxxxxxxxxxx', + ], + 'permissions' => ['payment_method', 'balances'], + 'filters' => ['countries' => ['US']], + ] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + + public function testRetrieveSession3() + { + $this->expectsRequest( + 'get', + '/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx' + ); + $result = $this->client->financialConnections->sessions->retrieve( + 'fcsess_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result); + } + + public function testListVerificationReport() + { + $this->expectsRequest('get', '/v1/identity/verification_reports'); + $result = $this->client->identity->verificationReports->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result->data[0]); + } + + public function testRetrieveVerificationReport() + { + $this->expectsRequest( + 'get', + '/v1/identity/verification_reports/vr_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationReports->retrieve( + 'vr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationReport::class, $result); + } + + public function testListVerificationSession() + { + $this->expectsRequest('get', '/v1/identity/verification_sessions'); + $result = $this->client->identity->verificationSessions->all( + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result->data[0]); + } + + public function testCreateVerificationSession() + { + $this->expectsRequest('post', '/v1/identity/verification_sessions'); + $result = $this->client->identity->verificationSessions->create( + ['type' => 'document'] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + + public function testRetrieveVerificationSession() + { + $this->expectsRequest( + 'get', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationSessions->retrieve( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + + public function testUpdateVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx' + ); + $result = $this->client->identity->verificationSessions->update( + 'vs_xxxxxxxxxxxxx', + ['type' => 'id_number'] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + + public function testCancelVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->identity->verificationSessions->cancel( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + + public function testRedactVerificationSession() + { + $this->expectsRequest( + 'post', + '/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact' + ); + $result = $this->client->identity->verificationSessions->redact( + 'vs_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Identity\VerificationSession::class, $result); + } + + public function testListInvoiceItem() + { + $this->expectsRequest('get', '/v1/invoiceitems'); + $result = $this->client->invoiceItems->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result->data[0]); + } + + public function testCreateInvoiceItem() + { + $this->expectsRequest('post', '/v1/invoiceitems'); + $result = $this->client->invoiceItems->create( + ['customer' => 'cus_xxxxxxxxxxxxx', 'price' => 'price_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + + public function testDeleteInvoiceItem() + { + $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + + public function testRetrieveInvoiceItem() + { + $this->expectsRequest('get', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->retrieve('ii_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + + public function testUpdateInvoiceItem() + { + $this->expectsRequest('post', '/v1/invoiceitems/ii_xxxxxxxxxxxxx'); + $result = $this->client->invoiceItems->update( + 'ii_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\InvoiceItem::class, $result); + } + + public function testListInvoice() + { + $this->expectsRequest('get', '/v1/invoices'); + $result = $this->client->invoices->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); + } + + public function testCreateInvoice() + { + $this->expectsRequest('post', '/v1/invoices'); + $result = $this->client->invoices->create( + ['customer' => 'cus_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testDeleteInvoice() + { + $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testRetrieveInvoice() + { + $this->expectsRequest('get', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->retrieve('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testUpdateInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx'); + $result = $this->client->invoices->update( + 'in_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testFinalizeInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/finalize'); + $result = $this->client->invoices->finalizeInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testMarkUncollectibleInvoice() + { + $this->expectsRequest( + 'post', + '/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible' + ); + $result = $this->client->invoices->markUncollectible( + 'in_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testPayInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/pay'); + $result = $this->client->invoices->pay('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testSendInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/send'); + $result = $this->client->invoices->sendInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testVoidInvoiceInvoice() + { + $this->expectsRequest('post', '/v1/invoices/in_xxxxxxxxxxxxx/void'); + $result = $this->client->invoices->voidInvoice('in_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Invoice::class, $result); + } + + public function testSearchInvoice() + { + $this->expectsRequest('get', '/v1/invoices/search'); + $result = $this->client->invoices->search( + ['query' => 'total>999 AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Invoice::class, $result->data[0]); + } + + public function testListAuthorization() + { + $this->expectsRequest('get', '/v1/issuing/authorizations'); + $result = $this->client->issuing->authorizations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result->data[0]); + } + + public function testRetrieveAuthorization() + { + $this->expectsRequest( + 'get', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' + ); + $result = $this->client->issuing->authorizations->retrieve( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testUpdateAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx' + ); + $result = $this->client->issuing->authorizations->update( + 'iauth_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testApproveAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve' + ); + $result = $this->client->issuing->authorizations->approve( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testDeclineAuthorization() + { + $this->expectsRequest( + 'post', + '/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline' + ); + $result = $this->client->issuing->authorizations->decline( + 'iauth_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Authorization::class, $result); + } + + public function testListCardholder() + { + $this->expectsRequest('get', '/v1/issuing/cardholders'); + $result = $this->client->issuing->cardholders->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result->data[0]); + } + + public function testCreateCardholder() + { + $this->expectsRequest('post', '/v1/issuing/cardholders'); + $result = $this->client->issuing->cardholders->create( + [ + 'type' => 'individual', + 'name' => 'Jenny Rosen', + 'email' => 'jenny.rosen@example.com', + 'phone_number' => '+18888675309', + 'billing' => [ + 'address' => [ + 'line1' => '1234 Main Street', + 'city' => 'San Francisco', + 'state' => 'CA', + 'country' => 'US', + 'postal_code' => '94111', + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + + public function testRetrieveCardholder() + { + $this->expectsRequest('get', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cardholders->retrieve( + 'ich_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + + public function testUpdateCardholder() + { + $this->expectsRequest('post', '/v1/issuing/cardholders/ich_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cardholders->update( + 'ich_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Cardholder::class, $result); + } + + public function testListCard() + { + $this->expectsRequest('get', '/v1/issuing/cards'); + $result = $this->client->issuing->cards->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result->data[0]); + } + + public function testCreateCard() + { + $this->expectsRequest('post', '/v1/issuing/cards'); + $result = $this->client->issuing->cards->create( + [ + 'cardholder' => 'ich_xxxxxxxxxxxxx', + 'currency' => 'usd', + 'type' => 'virtual', + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testRetrieveCard() + { + $this->expectsRequest('get', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cards->retrieve('ic_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testUpdateCard() + { + $this->expectsRequest('post', '/v1/issuing/cards/ic_xxxxxxxxxxxxx'); + $result = $this->client->issuing->cards->update( + 'ic_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Card::class, $result); + } + + public function testListDispute2() + { + $this->expectsRequest('get', '/v1/issuing/disputes'); + $result = $this->client->issuing->disputes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result->data[0]); + } + + public function testCreateDispute() + { + $this->expectsRequest('post', '/v1/issuing/disputes'); + $result = $this->client->issuing->disputes->create( + [ + 'transaction' => 'ipi_xxxxxxxxxxxxx', + 'evidence' => [ + 'reason' => 'fraudulent', + 'fraudulent' => ['explanation' => 'Purchase was unrecognized.'], + ], + ] + ); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + + public function testRetrieveDispute2() + { + $this->expectsRequest('get', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx'); + $result = $this->client->issuing->disputes->retrieve( + 'idp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + + public function testSubmitDispute() + { + $this->expectsRequest( + 'post', + '/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit' + ); + $result = $this->client->issuing->disputes->submit('idp_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Issuing\Dispute::class, $result); + } + + public function testListTransaction() + { + $this->expectsRequest('get', '/v1/issuing/transactions'); + $result = $this->client->issuing->transactions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result->data[0]); + } + + public function testRetrieveTransaction() + { + $this->expectsRequest('get', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $result = $this->client->issuing->transactions->retrieve( + 'ipi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + + public function testUpdateTransaction() + { + $this->expectsRequest('post', '/v1/issuing/transactions/ipi_xxxxxxxxxxxxx'); + $result = $this->client->issuing->transactions->update( + 'ipi_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Issuing\Transaction::class, $result); + } + + public function testRetrieveMandate() + { + $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx'); + $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Mandate::class, $result); + } + + public function testListPaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents'); + $result = $this->client->paymentIntents->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); + } + + public function testCreatePaymentIntent2() + { + $this->expectsRequest('post', '/v1/payment_intents'); + $result = $this->client->paymentIntents->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'payment_method_types' => ['card'], + ] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testRetrievePaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); + $result = $this->client->paymentIntents->retrieve('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testUpdatePaymentIntent() + { + $this->expectsRequest('post', '/v1/payment_intents/pi_xxxxxxxxxxxxx'); + $result = $this->client->paymentIntents->update( + 'pi_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testApplyCustomerBalancePaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance' + ); + $result = $this->client->paymentIntents->applyCustomerBalance( + 'pi_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testCancelPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->paymentIntents->cancel('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testCapturePaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/capture' + ); + $result = $this->client->paymentIntents->capture('pi_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testConfirmPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm' + ); + $result = $this->client->paymentIntents->confirm( + 'pi_xxxxxxxxxxxxx', + ['payment_method' => 'pm_card_visa'] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testIncrementAuthorizationPaymentIntent() + { + $this->expectsRequest( + 'post', + '/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization' + ); + $result = $this->client->paymentIntents->incrementAuthorization( + 'pi_xxxxxxxxxxxxx', + ['amount' => 2099] + ); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result); + } + + public function testSearchPaymentIntent() + { + $this->expectsRequest('get', '/v1/payment_intents/search'); + $result = $this->client->paymentIntents->search( + ['query' => 'status:\'succeeded\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\PaymentIntent::class, $result->data[0]); + } + + public function testListPaymentLink() + { + $this->expectsRequest('get', '/v1/payment_links'); + $result = $this->client->paymentLinks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result->data[0]); + } + + public function testCreatePaymentLink2() + { + $this->expectsRequest('post', '/v1/payment_links'); + $result = $this->client->paymentLinks->create( + ['line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]]] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + + public function testRetrievePaymentLink2() + { + $this->expectsRequest('get', '/v1/payment_links/plink_xxxxxxxxxxxxx'); + $result = $this->client->paymentLinks->retrieve('plink_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + + public function testUpdatePaymentLink() + { + $this->expectsRequest('post', '/v1/payment_links/plink_xxxxxxxxxxxxx'); + $result = $this->client->paymentLinks->update( + 'plink_xxxxxxxxxxxxx', + ['active' => false] + ); + static::assertInstanceOf(\Stripe\PaymentLink::class, $result); + } + + public function testListPaymentMethod() + { + $this->expectsRequest('get', '/v1/payment_methods'); + $result = $this->client->paymentMethods->all( + ['customer' => 'cus_xxxxxxxxxxxxx', 'type' => 'card'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result->data[0]); + } + + public function testCreatePaymentMethod() + { + $this->expectsRequest('post', '/v1/payment_methods'); + $result = $this->client->paymentMethods->create( + [ + 'type' => 'card', + 'card' => [ + 'number' => '4242424242424242', + 'exp_month' => 5, + 'exp_year' => 2023, + 'cvc' => '314', + ], + ] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + + public function testRetrievePaymentMethod() + { + $this->expectsRequest('get', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); + $result = $this->client->paymentMethods->retrieve('pm_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + + public function testUpdatePaymentMethod() + { + $this->expectsRequest('post', '/v1/payment_methods/pm_xxxxxxxxxxxxx'); + $result = $this->client->paymentMethods->update( + 'pm_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + + public function testAttachPaymentMethod() + { + $this->expectsRequest( + 'post', + '/v1/payment_methods/pm_xxxxxxxxxxxxx/attach' + ); + $result = $this->client->paymentMethods->attach( + 'pm_xxxxxxxxxxxxx', + ['customer' => 'cus_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + + public function testDetachPaymentMethod() + { + $this->expectsRequest( + 'post', + '/v1/payment_methods/pm_xxxxxxxxxxxxx/detach' + ); + $result = $this->client->paymentMethods->detach('pm_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\PaymentMethod::class, $result); + } + + public function testListPayout() + { + $this->expectsRequest('get', '/v1/payouts'); + $result = $this->client->payouts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Payout::class, $result->data[0]); + } + + public function testCreatePayout() + { + $this->expectsRequest('post', '/v1/payouts'); + $result = $this->client->payouts->create( + ['amount' => 1100, 'currency' => 'usd'] + ); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + + public function testRetrievePayout() + { + $this->expectsRequest('get', '/v1/payouts/po_xxxxxxxxxxxxx'); + $result = $this->client->payouts->retrieve('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + + public function testUpdatePayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx'); + $result = $this->client->payouts->update( + 'po_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + + public function testCancelPayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/cancel'); + $result = $this->client->payouts->cancel('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + + public function testReversePayout() + { + $this->expectsRequest('post', '/v1/payouts/po_xxxxxxxxxxxxx/reverse'); + $result = $this->client->payouts->reverse('po_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Payout::class, $result); + } + + public function testListPlan() + { + $this->expectsRequest('get', '/v1/plans'); + $result = $this->client->plans->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Plan::class, $result->data[0]); + } + + public function testCreatePlan() + { + $this->expectsRequest('post', '/v1/plans'); + $result = $this->client->plans->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'interval' => 'month', + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + + public function testDeletePlan() + { + $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + + public function testRetrievePlan() + { + $this->expectsRequest('get', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->retrieve('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + + public function testUpdatePlan() + { + $this->expectsRequest('post', '/v1/plans/price_xxxxxxxxxxxxx'); + $result = $this->client->plans->update( + 'price_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Plan::class, $result); + } + + public function testListPrice() + { + $this->expectsRequest('get', '/v1/prices'); + $result = $this->client->prices->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); + } + + public function testCreatePrice2() + { + $this->expectsRequest('post', '/v1/prices'); + $result = $this->client->prices->create( + [ + 'unit_amount' => 2000, + 'currency' => 'usd', + 'recurring' => ['interval' => 'month'], + 'product' => 'prod_xxxxxxxxxxxxx', + ] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + + public function testRetrievePrice() + { + $this->expectsRequest('get', '/v1/prices/price_xxxxxxxxxxxxx'); + $result = $this->client->prices->retrieve('price_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + + public function testUpdatePrice() + { + $this->expectsRequest('post', '/v1/prices/price_xxxxxxxxxxxxx'); + $result = $this->client->prices->update( + 'price_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Price::class, $result); + } + + public function testSearchPrice() + { + $this->expectsRequest('get', '/v1/prices/search'); + $result = $this->client->prices->search( + ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Price::class, $result->data[0]); + } + + public function testListProduct() + { + $this->expectsRequest('get', '/v1/products'); + $result = $this->client->products->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); + } + + public function testCreateProduct() + { + $this->expectsRequest('post', '/v1/products'); + $result = $this->client->products->create(['name' => 'Gold Special']); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + + public function testDeleteProduct() + { + $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + + public function testRetrieveProduct() + { + $this->expectsRequest('get', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->retrieve('prod_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + + public function testUpdateProduct() + { + $this->expectsRequest('post', '/v1/products/prod_xxxxxxxxxxxxx'); + $result = $this->client->products->update( + 'prod_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Product::class, $result); + } + + public function testSearchProduct() + { + $this->expectsRequest('get', '/v1/products/search'); + $result = $this->client->products->search( + ['query' => 'active:\'true\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Product::class, $result->data[0]); + } + + public function testListPromotionCode() + { + $this->expectsRequest('get', '/v1/promotion_codes'); + $result = $this->client->promotionCodes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result->data[0]); + } + + public function testCreatePromotionCode() + { + $this->expectsRequest('post', '/v1/promotion_codes'); + $result = $this->client->promotionCodes->create(['coupon' => 'Z4OV52SU']); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + + public function testRetrievePromotionCode() + { + $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $result = $this->client->promotionCodes->retrieve( + 'promo_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + + public function testUpdatePromotionCode() + { + $this->expectsRequest('post', '/v1/promotion_codes/promo_xxxxxxxxxxxxx'); + $result = $this->client->promotionCodes->update( + 'promo_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\PromotionCode::class, $result); + } + + public function testListQuote() + { + $this->expectsRequest('get', '/v1/quotes'); + $result = $this->client->quotes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Quote::class, $result->data[0]); + } + + public function testCreateQuote() + { + $this->expectsRequest('post', '/v1/quotes'); + $result = $this->client->quotes->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]], + ] + ); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testRetrieveQuote() + { + $this->expectsRequest('get', '/v1/quotes/qt_xxxxxxxxxxxxx'); + $result = $this->client->quotes->retrieve('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testUpdateQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx'); + $result = $this->client->quotes->update( + 'qt_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testAcceptQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/accept'); + $result = $this->client->quotes->accept('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testCancelQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/cancel'); + $result = $this->client->quotes->cancel('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testFinalizeQuoteQuote() + { + $this->expectsRequest('post', '/v1/quotes/qt_xxxxxxxxxxxxx/finalize'); + $result = $this->client->quotes->finalizeQuote('qt_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Quote::class, $result); + } + + public function testListEarlyFraudWarning() + { + $this->expectsRequest('get', '/v1/radar/early_fraud_warnings'); + $result = $this->client->radar->earlyFraudWarnings->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result->data[0]); + } + + public function testRetrieveEarlyFraudWarning() + { + $this->expectsRequest( + 'get', + '/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->earlyFraudWarnings->retrieve( + 'issfr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\EarlyFraudWarning::class, $result); + } + + public function testListValueListItem() + { + $this->expectsRequest('get', '/v1/radar/value_list_items'); + $result = $this->client->radar->valueListItems->all( + ['limit' => 3, 'value_list' => 'rsl_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result->data[0]); + } + + public function testCreateValueListItem() + { + $this->expectsRequest('post', '/v1/radar/value_list_items'); + $result = $this->client->radar->valueListItems->create( + ['value_list' => 'rsl_xxxxxxxxxxxxx', 'value' => '1.2.3.4'] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + + public function testDeleteValueListItem() + { + $this->expectsRequest( + 'delete', + '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueListItems->delete( + 'rsli_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + + public function testRetrieveValueListItem() + { + $this->expectsRequest( + 'get', + '/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx' + ); + $result = $this->client->radar->valueListItems->retrieve( + 'rsli_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueListItem::class, $result); + } + + public function testListValueList() + { + $this->expectsRequest('get', '/v1/radar/value_lists'); + $result = $this->client->radar->valueLists->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result->data[0]); + } + + public function testCreateValueList() + { + $this->expectsRequest('post', '/v1/radar/value_lists'); + $result = $this->client->radar->valueLists->create( + [ + 'alias' => 'custom_ip_xxxxxxxxxxxxx', + 'name' => 'Custom IP Blocklist', + 'item_type' => 'ip_address', + ] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + + public function testDeleteValueList() + { + $this->expectsRequest('delete', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->delete('rsl_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + + public function testRetrieveValueList() + { + $this->expectsRequest('get', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->retrieve( + 'rsl_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + + public function testUpdateValueList() + { + $this->expectsRequest('post', '/v1/radar/value_lists/rsl_xxxxxxxxxxxxx'); + $result = $this->client->radar->valueLists->update( + 'rsl_xxxxxxxxxxxxx', + ['name' => 'Updated IP Block List'] + ); + static::assertInstanceOf(\Stripe\Radar\ValueList::class, $result); + } + + public function testListRefund() + { + $this->expectsRequest('get', '/v1/refunds'); + $result = $this->client->refunds->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Refund::class, $result->data[0]); + } + + public function testCreateRefund() + { + $this->expectsRequest('post', '/v1/refunds'); + $result = $this->client->refunds->create(['charge' => 'ch_xxxxxxxxxxxxx']); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + + public function testRetrieveRefund() + { + $this->expectsRequest('get', '/v1/refunds/re_xxxxxxxxxxxxx'); + $result = $this->client->refunds->retrieve('re_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + + public function testUpdateRefund() + { + $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx'); + $result = $this->client->refunds->update( + 're_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + + public function testCancelRefund() + { + $this->expectsRequest('post', '/v1/refunds/re_xxxxxxxxxxxxx/cancel'); + $result = $this->client->refunds->cancel('re_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Refund::class, $result); + } + + public function testListReportRun() + { + $this->expectsRequest('get', '/v1/reporting/report_runs'); + $result = $this->client->reporting->reportRuns->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result->data[0]); + } + + public function testCreateReportRun() + { + $this->expectsRequest('post', '/v1/reporting/report_runs'); + $result = $this->client->reporting->reportRuns->create( + [ + 'report_type' => 'balance.summary.1', + 'parameters' => [ + 'interval_start' => 1522540800, + 'interval_end' => 1525132800, + ], + ] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); + } + + public function testRetrieveReportRun() + { + $this->expectsRequest('get', '/v1/reporting/report_runs/frr_xxxxxxxxxxxxx'); + $result = $this->client->reporting->reportRuns->retrieve( + 'frr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportRun::class, $result); + } + + public function testListReportType() + { + $this->expectsRequest('get', '/v1/reporting/report_types'); + $result = $this->client->reporting->reportTypes->all([]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result->data[0]); + } + + public function testRetrieveReportType() + { + $this->expectsRequest( + 'get', + '/v1/reporting/report_types/balance.summary.1' + ); + $result = $this->client->reporting->reportTypes->retrieve( + 'balance.summary.1', + [] + ); + static::assertInstanceOf(\Stripe\Reporting\ReportType::class, $result); + } + + public function testListReview() + { + $this->expectsRequest('get', '/v1/reviews'); + $result = $this->client->reviews->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Review::class, $result->data[0]); + } + + public function testRetrieveReview() + { + $this->expectsRequest('get', '/v1/reviews/prv_xxxxxxxxxxxxx'); + $result = $this->client->reviews->retrieve('prv_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Review::class, $result); + } + + public function testApproveReview() + { + $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve'); + $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Review::class, $result); + } + + public function testListSetupIntent() + { + $this->expectsRequest('get', '/v1/setup_intents'); + $result = $this->client->setupIntents->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result->data[0]); + } + + public function testCreateSetupIntent() + { + $this->expectsRequest('post', '/v1/setup_intents'); + $result = $this->client->setupIntents->create( + ['payment_method_types' => ['card']] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testRetrieveSetupIntent() + { + $this->expectsRequest('get', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); + $result = $this->client->setupIntents->retrieve('seti_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testUpdateSetupIntent() + { + $this->expectsRequest('post', '/v1/setup_intents/seti_xxxxxxxxxxxxx'); + $result = $this->client->setupIntents->update( + 'seti_xxxxxxxxxxxxx', + ['metadata' => ['user_id' => '3435453']] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testCancelSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->setupIntents->cancel('seti_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testConfirmSetupIntent() + { + $this->expectsRequest( + 'post', + '/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm' + ); + $result = $this->client->setupIntents->confirm( + 'seti_xxxxxxxxxxxxx', + ['payment_method' => 'pm_card_visa'] + ); + static::assertInstanceOf(\Stripe\SetupIntent::class, $result); + } + + public function testListShippingRate2() + { + $this->expectsRequest('get', '/v1/shipping_rates'); + $result = $this->client->shippingRates->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result->data[0]); + } + + public function testCreateShippingRate2() + { + $this->expectsRequest('post', '/v1/shipping_rates'); + $result = $this->client->shippingRates->create( + [ + 'display_name' => 'Ground shipping', + 'type' => 'fixed_amount', + 'fixed_amount' => ['amount' => 500, 'currency' => 'usd'], + ] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + + public function testRetrieveShippingRate() + { + $this->expectsRequest('get', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); + $result = $this->client->shippingRates->retrieve('shr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + + public function testUpdateShippingRate() + { + $this->expectsRequest('post', '/v1/shipping_rates/shr_xxxxxxxxxxxxx'); + $result = $this->client->shippingRates->update( + 'shr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\ShippingRate::class, $result); + } + + public function testListScheduledQueryRun() + { + $this->expectsRequest('get', '/v1/sigma/scheduled_query_runs'); + $result = $this->client->sigma->scheduledQueryRuns->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result->data[0]); + } + + public function testRetrieveScheduledQueryRun() + { + $this->expectsRequest( + 'get', + '/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx' + ); + $result = $this->client->sigma->scheduledQueryRuns->retrieve( + 'sqr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Sigma\ScheduledQueryRun::class, $result); + } + + public function testRetrieveSource() + { + $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + + public function testRetrieveSource2() + { + $this->expectsRequest('get', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->retrieve('src_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + + public function testUpdateSource() + { + $this->expectsRequest('post', '/v1/sources/src_xxxxxxxxxxxxx'); + $result = $this->client->sources->update( + 'src_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Source::class, $result); + } + + public function testListSubscriptionItem() + { + $this->expectsRequest('get', '/v1/subscription_items'); + $result = $this->client->subscriptionItems->all( + ['subscription' => 'sub_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result->data[0]); + } + + public function testCreateSubscriptionItem() + { + $this->expectsRequest('post', '/v1/subscription_items'); + $result = $this->client->subscriptionItems->create( + [ + 'subscription' => 'sub_xxxxxxxxxxxxx', + 'price' => 'price_xxxxxxxxxxxxx', + 'quantity' => 2, + ] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + + public function testDeleteSubscriptionItem() + { + $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + + public function testRetrieveSubscriptionItem() + { + $this->expectsRequest('get', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->retrieve( + 'si_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + + public function testUpdateSubscriptionItem() + { + $this->expectsRequest('post', '/v1/subscription_items/si_xxxxxxxxxxxxx'); + $result = $this->client->subscriptionItems->update( + 'si_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\SubscriptionItem::class, $result); + } + + public function testListUsageRecordSummary() + { + $this->expectsRequest( + 'get', + '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries' + ); + $result = $this->client->subscriptionItems->allUsageRecordSummaries( + 'si_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\UsageRecordSummary::class, $result->data[0]); + } + + public function testCreateUsageRecord() + { + $this->expectsRequest( + 'post', + '/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records' + ); + $result = $this->client->subscriptionItems->createUsageRecord( + 'si_xxxxxxxxxxxxx', + ['quantity' => 100, 'timestamp' => 1571252444] + ); + static::assertInstanceOf(\Stripe\UsageRecord::class, $result); + } + + public function testListSubscriptionSchedule() + { + $this->expectsRequest('get', '/v1/subscription_schedules'); + $result = $this->client->subscriptionSchedules->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result->data[0]); + } + + public function testCreateSubscriptionSchedule() + { + $this->expectsRequest('post', '/v1/subscription_schedules'); + $result = $this->client->subscriptionSchedules->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'start_date' => 1652909005, + 'end_behavior' => 'release', + 'phases' => [ + [ + 'items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 1]], + 'iterations' => 12, + ], + ], + ] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + + public function testRetrieveSubscriptionSchedule() + { + $this->expectsRequest( + 'get', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionSchedules->retrieve( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + + public function testUpdateSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx' + ); + $result = $this->client->subscriptionSchedules->update( + 'sub_sched_xxxxxxxxxxxxx', + ['end_behavior' => 'release'] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + + public function testCancelSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->subscriptionSchedules->cancel( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + + public function testReleaseSubscriptionSchedule() + { + $this->expectsRequest( + 'post', + '/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release' + ); + $result = $this->client->subscriptionSchedules->release( + 'sub_sched_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\SubscriptionSchedule::class, $result); + } + + public function testListSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions'); + $result = $this->client->subscriptions->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); + } + + public function testCreateSubscription() + { + $this->expectsRequest('post', '/v1/subscriptions'); + $result = $this->client->subscriptions->create( + [ + 'customer' => 'cus_xxxxxxxxxxxxx', + 'items' => [['price' => 'price_xxxxxxxxxxxxx']], + ] + ); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + + public function testCancelSubscription() + { + $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + + public function testRetrieveSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->retrieve('sub_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + + public function testUpdateSubscription() + { + $this->expectsRequest('post', '/v1/subscriptions/sub_xxxxxxxxxxxxx'); + $result = $this->client->subscriptions->update( + 'sub_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Subscription::class, $result); + } + + public function testSearchSubscription() + { + $this->expectsRequest('get', '/v1/subscriptions/search'); + $result = $this->client->subscriptions->search( + ['query' => 'status:\'active\' AND metadata[\'order_id\']:\'6735\''] + ); + static::assertInstanceOf(\Stripe\SearchResult::class, $result); + static::assertInstanceOf(\Stripe\Subscription::class, $result->data[0]); + } + + public function testListTaxCode() + { + $this->expectsRequest('get', '/v1/tax_codes'); + $result = $this->client->taxCodes->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxCode::class, $result->data[0]); + } + + public function testRetrieveTaxCode() + { + $this->expectsRequest('get', '/v1/tax_codes/txcd_xxxxxxxxxxxxx'); + $result = $this->client->taxCodes->retrieve('txcd_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\TaxCode::class, $result); + } + + public function testListTaxRate() + { + $this->expectsRequest('get', '/v1/tax_rates'); + $result = $this->client->taxRates->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TaxRate::class, $result->data[0]); + } + + public function testCreateTaxRate() + { + $this->expectsRequest('post', '/v1/tax_rates'); + $result = $this->client->taxRates->create( + [ + 'display_name' => 'VAT', + 'description' => 'VAT Germany', + 'jurisdiction' => 'DE', + 'percentage' => 16, + 'inclusive' => false, + ] + ); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + + public function testRetrieveTaxRate() + { + $this->expectsRequest('get', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); + $result = $this->client->taxRates->retrieve('txr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + + public function testUpdateTaxRate() + { + $this->expectsRequest('post', '/v1/tax_rates/txr_xxxxxxxxxxxxx'); + $result = $this->client->taxRates->update( + 'txr_xxxxxxxxxxxxx', + ['active' => false] + ); + static::assertInstanceOf(\Stripe\TaxRate::class, $result); + } + + public function testListConfiguration3() + { + $this->expectsRequest('get', '/v1/terminal/configurations'); + $result = $this->client->terminal->configurations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result->data[0]); + } + + public function testDeleteConfiguration2() + { + $this->expectsRequest( + 'delete', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->delete( + 'tmc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testRetrieveConfiguration3() + { + $this->expectsRequest( + 'get', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->retrieve( + 'tmc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testUpdateConfiguration3() + { + $this->expectsRequest( + 'post', + '/v1/terminal/configurations/tmc_xxxxxxxxxxxxx' + ); + $result = $this->client->terminal->configurations->update( + 'tmc_xxxxxxxxxxxxx', + ['bbpos_wisepos_e' => ['splashscreen' => 'file_xxxxxxxxxxxxx']] + ); + static::assertInstanceOf(\Stripe\Terminal\Configuration::class, $result); + } + + public function testCreateConnectionToken() + { + $this->expectsRequest('post', '/v1/terminal/connection_tokens'); + $result = $this->client->terminal->connectionTokens->create([]); + static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result); + } + + public function testListLocation() + { + $this->expectsRequest('get', '/v1/terminal/locations'); + $result = $this->client->terminal->locations->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result->data[0]); + } + + public function testCreateLocation() + { + $this->expectsRequest('post', '/v1/terminal/locations'); + $result = $this->client->terminal->locations->create( + [ + 'display_name' => 'My First Store', + 'address' => [ + 'line1' => '1234 Main Street', + 'city' => 'San Francisco', + 'country' => 'US', + 'postal_code' => '94111', + ], + ] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + + public function testDeleteLocation() + { + $this->expectsRequest('delete', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->delete( + 'tml_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + + public function testRetrieveLocation() + { + $this->expectsRequest('get', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->retrieve( + 'tml_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + + public function testUpdateLocation() + { + $this->expectsRequest('post', '/v1/terminal/locations/tml_xxxxxxxxxxxxx'); + $result = $this->client->terminal->locations->update( + 'tml_xxxxxxxxxxxxx', + ['display_name' => 'My First Store'] + ); + static::assertInstanceOf(\Stripe\Terminal\Location::class, $result); + } + + public function testListReader() + { + $this->expectsRequest('get', '/v1/terminal/readers'); + $result = $this->client->terminal->readers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result->data[0]); + } + + public function testCreateReader() + { + $this->expectsRequest('post', '/v1/terminal/readers'); + $result = $this->client->terminal->readers->create( + [ + 'registration_code' => 'puppies-plug-could', + 'label' => 'Blue Rabbit', + 'location' => 'tml_1234', + ] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testDeleteReader() + { + $this->expectsRequest('delete', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->delete('tmr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testRetrieveReader() + { + $this->expectsRequest('get', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->retrieve( + 'tmr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testUpdateReader() + { + $this->expectsRequest('post', '/v1/terminal/readers/tmr_xxxxxxxxxxxxx'); + $result = $this->client->terminal->readers->update( + 'tmr_xxxxxxxxxxxxx', + ['label' => 'Blue Rabbit'] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testCancelActionReader() + { + $this->expectsRequest( + 'post', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action' + ); + $result = $this->client->terminal->readers->cancelAction( + 'tmr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testProcessPaymentIntentReader() + { + $this->expectsRequest( + 'post', + '/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent' + ); + $result = $this->client->terminal->readers->processPaymentIntent( + 'tmr_xxxxxxxxxxxxx', + ['payment_intent' => 'pi_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result); + } + + public function testListTestClock2() + { + $this->expectsRequest('get', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result->data[0]); + } + + public function testCreateTestClock2() + { + $this->expectsRequest('post', '/v1/test_helpers/test_clocks'); + $result = $this->client->testHelpers->testClocks->create( + ['frozen_time' => 1577836800] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testDeleteTestClock2() + { + $this->expectsRequest( + 'delete', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' + ); + $result = $this->client->testHelpers->testClocks->delete( + 'clock_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testRetrieveTestClock2() + { + $this->expectsRequest( + 'get', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx' + ); + $result = $this->client->testHelpers->testClocks->retrieve( + 'clock_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testAdvanceTestClock2() + { + $this->expectsRequest( + 'post', + '/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance' + ); + $result = $this->client->testHelpers->testClocks->advance( + 'clock_xxxxxxxxxxxxx', + ['frozen_time' => 1652390605] + ); + static::assertInstanceOf(\Stripe\TestHelpers\TestClock::class, $result); + } + + public function testCreateToken2() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'bank_account' => [ + 'country' => 'US', + 'currency' => 'usd', + 'account_holder_name' => 'Jenny Rosen', + 'account_holder_type' => 'individual', + 'routing_number' => '110000000', + 'account_number' => '000123456789', + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testCreateToken3() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + ['pii' => ['id_number' => '000000000']] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testCreateToken4() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'account' => [ + 'individual' => ['first_name' => 'Jane', 'last_name' => 'Doe'], + 'tos_shown_and_accepted' => true, + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testCreateToken5() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create( + [ + 'person' => [ + 'first_name' => 'Jane', + 'last_name' => 'Doe', + 'relationship' => ['owner' => true], + ], + ] + ); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testCreateToken6() + { + $this->expectsRequest('post', '/v1/tokens'); + $result = $this->client->tokens->create(['cvc_update' => ['cvc' => '123']]); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testRetrieveToken() + { + $this->expectsRequest('get', '/v1/tokens/tok_xxxx'); + $result = $this->client->tokens->retrieve('tok_xxxx', []); + static::assertInstanceOf(\Stripe\Token::class, $result); + } + + public function testListTopup() + { + $this->expectsRequest('get', '/v1/topups'); + $result = $this->client->topups->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Topup::class, $result->data[0]); + } + + public function testCreateTopup() + { + $this->expectsRequest('post', '/v1/topups'); + $result = $this->client->topups->create( + [ + 'amount' => 2000, + 'currency' => 'usd', + 'description' => 'Top-up for Jenny Rosen', + 'statement_descriptor' => 'Top-up', + ] + ); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + + public function testRetrieveTopup() + { + $this->expectsRequest('get', '/v1/topups/tu_xxxxxxxxxxxxx'); + $result = $this->client->topups->retrieve('tu_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + + public function testUpdateTopup() + { + $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx'); + $result = $this->client->topups->update( + 'tu_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + + public function testCancelTopup() + { + $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel'); + $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Topup::class, $result); + } + + public function testListTransfer() + { + $this->expectsRequest('get', '/v1/transfers'); + $result = $this->client->transfers->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Transfer::class, $result->data[0]); + } + + public function testCreateTransfer() + { + $this->expectsRequest('post', '/v1/transfers'); + $result = $this->client->transfers->create( + [ + 'amount' => 400, + 'currency' => 'usd', + 'destination' => 'acct_xxxxxxxxxxxxx', + 'transfer_group' => 'ORDER_95', + ] + ); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + + public function testRetrieveTransfer() + { + $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx'); + $result = $this->client->transfers->retrieve('tr_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + + public function testUpdateTransfer() + { + $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx'); + $result = $this->client->transfers->update( + 'tr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Transfer::class, $result); + } + + public function testListTransferReversal() + { + $this->expectsRequest('get', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $result = $this->client->transfers->allReversals( + 'tr_xxxxxxxxxxxxx', + ['limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result->data[0]); + } + + public function testCreateTransferReversal() + { + $this->expectsRequest('post', '/v1/transfers/tr_xxxxxxxxxxxxx/reversals'); + $result = $this->client->transfers->createReversal( + 'tr_xxxxxxxxxxxxx', + ['amount' => 100] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + + public function testRetrieveTransferReversal() + { + $this->expectsRequest( + 'get', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' + ); + $result = $this->client->transfers->retrieveReversal( + 'tr_xxxxxxxxxxxxx', + 'trr_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + + public function testUpdateTransferReversal() + { + $this->expectsRequest( + 'post', + '/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx' + ); + $result = $this->client->transfers->updateReversal( + 'tr_xxxxxxxxxxxxx', + 'trr_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\TransferReversal::class, $result); + } + + public function testListCreditReversal() + { + $this->expectsRequest('get', '/v1/treasury/credit_reversals'); + $result = $this->client->treasury->creditReversals->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result->data[0]); + } + + public function testCreateCreditReversal() + { + $this->expectsRequest('post', '/v1/treasury/credit_reversals'); + $result = $this->client->treasury->creditReversals->create( + ['received_credit' => 'rc_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); + } + + public function testRetrieveCreditReversal() + { + $this->expectsRequest( + 'get', + '/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->creditReversals->retrieve( + 'credrev_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\CreditReversal::class, $result); + } + + public function testListDebitReversal() + { + $this->expectsRequest('get', '/v1/treasury/debit_reversals'); + $result = $this->client->treasury->debitReversals->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result->data[0]); + } + + public function testCreateDebitReversal() + { + $this->expectsRequest('post', '/v1/treasury/debit_reversals'); + $result = $this->client->treasury->debitReversals->create( + ['received_debit' => 'rd_xxxxxxxxxxxxx'] + ); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); + } + + public function testRetrieveDebitReversal() + { + $this->expectsRequest( + 'get', + '/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->debitReversals->retrieve( + 'debrev_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\DebitReversal::class, $result); + } + + public function testListFinancialAccount() + { + $this->expectsRequest('get', '/v1/treasury/financial_accounts'); + $result = $this->client->treasury->financialAccounts->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result->data[0]); + } + + public function testCreateFinancialAccount() + { + $this->expectsRequest('post', '/v1/treasury/financial_accounts'); + $result = $this->client->treasury->financialAccounts->create( + ['supported_currencies' => ['usd'], 'features' => []] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + + public function testRetrieveFinancialAccount() + { + $this->expectsRequest( + 'get', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->financialAccounts->retrieve( + 'fa_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + + public function testUpdateFinancialAccount() + { + $this->expectsRequest( + 'post', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->financialAccounts->update( + 'fa_xxxxxxxxxxxxx', + ['metadata' => ['order_id' => '6735']] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccount::class, $result); + } + + public function testRetrieveFeaturesFinancialAccount() + { + $this->expectsRequest( + 'get', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' + ); + $result = $this->client->treasury->financialAccounts->retrieveFeatures( + 'fa_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); + } + + public function testUpdateFeaturesFinancialAccount() + { + $this->expectsRequest( + 'post', + '/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features' + ); + $result = $this->client->treasury->financialAccounts->updateFeatures( + 'fa_xxxxxxxxxxxxx', + ['card_issuing' => ['requested' => false]] + ); + static::assertInstanceOf(\Stripe\Treasury\FinancialAccountFeatures::class, $result); + } + + public function testListInboundTransfer() + { + $this->expectsRequest('get', '/v1/treasury/inbound_transfers'); + $result = $this->client->treasury->inboundTransfers->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result->data[0]); + } + + public function testCreateInboundTransfer() + { + $this->expectsRequest('post', '/v1/treasury/inbound_transfers'); + $result = $this->client->treasury->inboundTransfers->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'amount' => 10000, + 'currency' => 'usd', + 'origin_payment_method' => 'pm_xxxxxxxxxxxxx', + 'description' => 'InboundTransfer from my bank account', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testRetrieveInboundTransfer() + { + $this->expectsRequest( + 'get', + '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->inboundTransfers->retrieve( + 'ibt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testCancelInboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->inboundTransfers->cancel( + 'ibt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\InboundTransfer::class, $result); + } + + public function testListOutboundPayment() + { + $this->expectsRequest('get', '/v1/treasury/outbound_payments'); + $result = $this->client->treasury->outboundPayments->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result->data[0]); + } + + public function testCreateOutboundPayment() + { + $this->expectsRequest('post', '/v1/treasury/outbound_payments'); + $result = $this->client->treasury->outboundPayments->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'amount' => 10000, + 'currency' => 'usd', + 'customer' => 'cu_xxxxxxxxxxxxx', + 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', + 'description' => 'OutboundPayment to a 3rd party', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + + public function testRetrieveOutboundPayment() + { + $this->expectsRequest( + 'get', + '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->outboundPayments->retrieve( + 'obp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + + public function testCancelOutboundPayment() + { + $this->expectsRequest( + 'post', + '/v1/treasury/outbound_payments/obp_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->outboundPayments->cancel( + 'obp_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundPayment::class, $result); + } + + public function testListOutboundTransfer() + { + $this->expectsRequest('get', '/v1/treasury/outbound_transfers'); + $result = $this->client->treasury->outboundTransfers->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result->data[0]); + } + + public function testCreateOutboundTransfer() + { + $this->expectsRequest('post', '/v1/treasury/outbound_transfers'); + $result = $this->client->treasury->outboundTransfers->create( + [ + 'financial_account' => 'fa_xxxxxxxxxxxxx', + 'destination_payment_method' => 'pm_xxxxxxxxxxxxx', + 'amount' => 500, + 'currency' => 'usd', + 'description' => 'OutboundTransfer to my external bank account', + ] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testRetrieveOutboundTransfer() + { + $this->expectsRequest( + 'get', + '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->outboundTransfers->retrieve( + 'obt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testCancelOutboundTransfer() + { + $this->expectsRequest( + 'post', + '/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel' + ); + $result = $this->client->treasury->outboundTransfers->cancel( + 'obt_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\OutboundTransfer::class, $result); + } + + public function testListReceivedCredit() + { + $this->expectsRequest('get', '/v1/treasury/received_credits'); + $result = $this->client->treasury->receivedCredits->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result->data[0]); + } + + public function testRetrieveReceivedCredit() + { + $this->expectsRequest( + 'get', + '/v1/treasury/received_credits/rc_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->receivedCredits->retrieve( + 'rc_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedCredit::class, $result); + } + + public function testListReceivedDebit() + { + $this->expectsRequest('get', '/v1/treasury/received_debits'); + $result = $this->client->treasury->receivedDebits->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result->data[0]); + } + + public function testRetrieveReceivedDebit() + { + $this->expectsRequest( + 'get', + '/v1/treasury/received_debits/rd_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->receivedDebits->retrieve( + 'rd_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\ReceivedDebit::class, $result); + } + + public function testListTransactionEntry() + { + $this->expectsRequest('get', '/v1/treasury/transaction_entries'); + $result = $this->client->treasury->transactionEntries->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result->data[0]); + } + + public function testRetrieveTransactionEntry() + { + $this->expectsRequest( + 'get', + '/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->transactionEntries->retrieve( + 'trxne_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\TransactionEntry::class, $result); + } + + public function testListTransaction2() + { + $this->expectsRequest('get', '/v1/treasury/transactions'); + $result = $this->client->treasury->transactions->all( + ['financial_account' => 'fa_xxxxxxxxxxxxx', 'limit' => 3] + ); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result->data[0]); + } + + public function testRetrieveTransaction2() + { + $this->expectsRequest( + 'get', + '/v1/treasury/transactions/trxn_xxxxxxxxxxxxx' + ); + $result = $this->client->treasury->transactions->retrieve( + 'trxn_xxxxxxxxxxxxx', + [] + ); + static::assertInstanceOf(\Stripe\Treasury\Transaction::class, $result); + } + + public function testListWebhookEndpoint() + { + $this->expectsRequest('get', '/v1/webhook_endpoints'); + $result = $this->client->webhookEndpoints->all(['limit' => 3]); + static::assertInstanceOf(\Stripe\Collection::class, $result); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result->data[0]); + } + + public function testDeleteWebhookEndpoint() + { + $this->expectsRequest('delete', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->delete('we_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } + + public function testRetrieveWebhookEndpoint() + { + $this->expectsRequest('get', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->retrieve('we_xxxxxxxxxxxxx', []); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } + + public function testUpdateWebhookEndpoint() + { + $this->expectsRequest('post', '/v1/webhook_endpoints/we_xxxxxxxxxxxxx'); + $result = $this->client->webhookEndpoints->update( + 'we_xxxxxxxxxxxxx', + ['url' => 'https://example.com/new_endpoint'] + ); + static::assertInstanceOf(\Stripe\WebhookEndpoint::class, $result); + } +}