From 932feffeb2b0a6d013f89b56aa7f8cb50c4ceef7 Mon Sep 17 00:00:00 2001
From: Yejia Chen
Date: Thu, 3 Feb 2022 15:07:56 -0800
Subject: [PATCH 1/2] Codegen for openapi 10fe9f5
---
init.php | 3 +-
lib/Account.php | 8 +-
lib/AccountLink.php | 2 +-
lib/ApplePayDomain.php | 2 +-
lib/ApplicationFee.php | 2 +-
lib/ApplicationFeeRefund.php | 3 +-
lib/Balance.php | 3 +-
lib/BalanceTransaction.php | 2 +-
lib/BankAccount.php | 2 +-
lib/BillingPortal/Configuration.php | 2 +-
lib/BillingPortal/Session.php | 2 +-
lib/BitcoinReceiver.php | 2 +-
lib/BitcoinTransaction.php | 3 +-
lib/Capability.php | 2 +-
lib/Card.php | 2 +-
lib/Charge.php | 2 +-
lib/Checkout/Session.php | 2 +-
lib/CountrySpec.php | 2 +-
lib/Coupon.php | 2 +-
lib/CreditNote.php | 2 +-
lib/CreditNoteLineItem.php | 3 +-
lib/Customer.php | 4 +-
lib/CustomerBalanceTransaction.php | 3 +-
lib/Dispute.php | 2 +-
lib/EphemeralKey.php | 6 +-
lib/Event.php | 2 +-
lib/ExchangeRate.php | 2 +-
lib/File.php | 2 +-
lib/FileLink.php | 2 +-
lib/Identity/VerificationReport.php | 2 +-
lib/Identity/VerificationSession.php | 2 +-
lib/Invoice.php | 3 +-
lib/InvoiceItem.php | 2 +-
lib/InvoiceLineItem.php | 3 +-
lib/Issuing/Authorization.php | 2 +-
lib/Issuing/Card.php | 2 +-
lib/Issuing/Cardholder.php | 2 +-
lib/Issuing/Dispute.php | 2 +-
lib/Issuing/Transaction.php | 2 +-
lib/LineItem.php | 2 +-
lib/LoginLink.php | 3 +-
lib/Mandate.php | 2 +-
lib/Order.php | 2 +-
lib/OrderReturn.php | 2 +-
lib/PaymentIntent.php | 4 +-
lib/PaymentLink.php | 3 +-
lib/PaymentMethod.php | 2 +-
lib/Payout.php | 2 +-
lib/Person.php | 2 +-
lib/Plan.php | 2 +-
lib/Price.php | 2 +-
lib/Product.php | 2 +-
lib/PromotionCode.php | 2 +-
lib/Quote.php | 4 +-
lib/Radar/EarlyFraudWarning.php | 2 +-
lib/Radar/ValueList.php | 2 +-
lib/Radar/ValueListItem.php | 2 +-
lib/Recipient.php | 2 +-
lib/Refund.php | 5 +-
lib/Reporting/ReportRun.php | 2 +-
lib/Reporting/ReportType.php | 2 +-
lib/Review.php | 2 +-
lib/SKU.php | 2 +-
lib/Service/AccountLinkService.php | 2 +-
lib/Service/AccountService.php | 2 +-
lib/Service/ApplePayDomainService.php | 2 +-
lib/Service/ApplicationFeeService.php | 2 +-
lib/Service/BalanceService.php | 2 +-
lib/Service/BalanceTransactionService.php | 2 +-
.../BillingPortalServiceFactory.php | 5 +-
.../BillingPortal/ConfigurationService.php | 4 +-
lib/Service/BillingPortal/SessionService.php | 2 +-
lib/Service/ChargeService.php | 2 +-
.../Checkout/CheckoutServiceFactory.php | 3 +-
lib/Service/Checkout/SessionService.php | 4 +-
lib/Service/CoreServiceFactory.php | 113 +-
lib/Service/CountrySpecService.php | 2 +-
lib/Service/CouponService.php | 2 +-
lib/Service/CreditNoteService.php | 4 +-
lib/Service/CustomerService.php | 4 +-
lib/Service/DisputeService.php | 2 +-
lib/Service/EphemeralKeyService.php | 2 +-
lib/Service/EventService.php | 2 +-
lib/Service/ExchangeRateService.php | 2 +-
lib/Service/FileLinkService.php | 2 +-
lib/Service/FileService.php | 2 +-
.../Identity/IdentityServiceFactory.php | 5 +-
.../Identity/VerificationReportService.php | 4 +-
.../Identity/VerificationSessionService.php | 4 +-
lib/Service/InvoiceItemService.php | 2 +-
lib/Service/InvoiceService.php | 2 +-
lib/Service/Issuing/AuthorizationService.php | 2 +-
lib/Service/Issuing/CardService.php | 2 +-
lib/Service/Issuing/CardholderService.php | 2 +-
lib/Service/Issuing/DisputeService.php | 2 +-
lib/Service/Issuing/IssuingServiceFactory.php | 11 +-
lib/Service/Issuing/TransactionService.php | 2 +-
lib/Service/MandateService.php | 2 +-
lib/Service/OrderReturnService.php | 2 +-
lib/Service/OrderService.php | 2 +-
lib/Service/PaymentIntentService.php | 2 +-
lib/Service/PaymentLinkService.php | 2 +-
lib/Service/PaymentMethodService.php | 4 +-
lib/Service/PayoutService.php | 2 +-
lib/Service/PlanService.php | 2 +-
lib/Service/PriceService.php | 2 +-
lib/Service/ProductService.php | 2 +-
lib/Service/PromotionCodeService.php | 2 +-
lib/Service/QuoteService.php | 12 +-
.../Radar/EarlyFraudWarningService.php | 2 +-
lib/Service/Radar/RadarServiceFactory.php | 7 +-
lib/Service/Radar/ValueListItemService.php | 2 +-
lib/Service/Radar/ValueListService.php | 2 +-
lib/Service/RefundService.php | 2 +-
lib/Service/Reporting/ReportRunService.php | 4 +-
lib/Service/Reporting/ReportTypeService.php | 4 +-
.../Reporting/ReportingServiceFactory.php | 5 +-
lib/Service/ReviewService.php | 2 +-
lib/Service/SetupAttemptService.php | 2 +-
lib/Service/SetupIntentService.php | 2 +-
lib/Service/ShippingRateService.php | 2 +-
.../Sigma/ScheduledQueryRunService.php | 2 +-
lib/Service/Sigma/SigmaServiceFactory.php | 3 +-
lib/Service/SkuService.php | 2 +-
lib/Service/SourceService.php | 2 +-
lib/Service/SubscriptionItemService.php | 2 +-
lib/Service/SubscriptionScheduleService.php | 2 +-
lib/Service/SubscriptionService.php | 2 +-
lib/Service/TaxCodeService.php | 2 +-
lib/Service/TaxRateService.php | 4 +-
.../Terminal/ConnectionTokenService.php | 2 +-
lib/Service/Terminal/LocationService.php | 2 +-
lib/Service/Terminal/ReaderService.php | 2 +-
.../Terminal/TerminalServiceFactory.php | 7 +-
lib/Service/TokenService.php | 2 +-
lib/Service/TopupService.php | 4 +-
lib/Service/TransferService.php | 2 +-
lib/Service/WebhookEndpointService.php | 2 +-
lib/SetupAttempt.php | 2 +-
lib/SetupIntent.php | 2 +-
lib/ShippingRate.php | 2 +-
lib/Sigma/ScheduledQueryRun.php | 2 +-
lib/Source.php | 2 +-
lib/StripeClient.php | 1 -
lib/Subscription.php | 3 +-
lib/SubscriptionItem.php | 2 +-
lib/SubscriptionSchedule.php | 2 +-
lib/TaxCode.php | 2 +-
lib/TaxId.php | 2 +-
lib/TaxRate.php | 2 +-
lib/Terminal/ConnectionToken.php | 2 +-
lib/Terminal/Location.php | 2 +-
lib/Terminal/Reader.php | 2 +-
lib/ThreeDSecure.php | 2 +-
lib/Token.php | 2 +-
lib/Topup.php | 2 +-
lib/Transfer.php | 2 +-
lib/TransferReversal.php | 3 +-
lib/UsageRecord.php | 3 +-
lib/UsageRecordSummary.php | 3 +-
lib/Util/ObjectTypes.php | 196 +-
lib/WebhookEndpoint.php | 2 +-
tests/Stripe/GeneratedExamplesTest.php | 5123 ++++++++---------
163 files changed, 2787 insertions(+), 3059 deletions(-)
diff --git a/init.php b/init.php
index 70cfdde68..798bb586f 100644
--- a/init.php
+++ b/init.php
@@ -1,5 +1,4 @@
serializeParameters() : $v;
if ([] !== $update) {
- if (!$originalValue
- || !\array_key_exists($i, $originalValue)
- || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
+ if (!$originalValue ||
+ !\array_key_exists($i, $originalValue) ||
+ ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
$updateArr[$i] = $update;
}
}
@@ -213,6 +212,7 @@ public function reject($params = null, $opts = null)
return $this;
}
+
/*
* Capabilities methods
* We can not add the capabilities() method today as the Account object already has a
diff --git a/lib/AccountLink.php b/lib/AccountLink.php
index 24a9e68aa..259588100 100644
--- a/lib/AccountLink.php
+++ b/lib/AccountLink.php
@@ -1,5 +1,4 @@
_save($opts);
}
+
}
diff --git a/lib/Balance.php b/lib/Balance.php
index 0fdc2850c..428cec866 100644
--- a/lib/Balance.php
+++ b/lib/Balance.php
@@ -1,5 +1,4 @@
instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom(['discount' => null], $opts, true);
-
return $this;
}
/**
* @param null|array $params
* @param null|array|string $opts
- * @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
@@ -99,6 +96,7 @@ public static function allPaymentMethods($id, $params = null, $opts = null)
return $obj;
}
+
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
/**
diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php
index 8c306760d..6d6181984 100644
--- a/lib/CustomerBalanceTransaction.php
+++ b/lib/CustomerBalanceTransaction.php
@@ -1,5 +1,4 @@
Indicates that you intend to make future payments with this PaymentIntent's payment method.
Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.
When processing card payments, Stripe also uses setup_future_usage
to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
* @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent.
- * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
+ * @property null|string|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Account|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
* @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
* @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
* @property string $status Status of this PaymentIntent, one of requires_payment_method
, requires_confirmation
, requires_action
, processing
, requires_capture
, canceled
, or succeeded
. Read more about each PaymentIntent status.
@@ -124,4 +123,5 @@ public function confirm($params = null, $opts = null)
return $this;
}
+
}
diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php
index c0399fe2c..862cf922b 100644
--- a/lib/PaymentLink.php
+++ b/lib/PaymentLink.php
@@ -1,5 +1,4 @@
request('post', '/v1/account_links', $params, $opts);
}
+
}
diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php
index 28d094ec2..1fea1e384 100644
--- a/lib/Service/AccountService.php
+++ b/lib/Service/AccountService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/ApplePayDomainService.php b/lib/Service/ApplePayDomainService.php
index 6577b6b62..84675d668 100644
--- a/lib/Service/ApplePayDomainService.php
+++ b/lib/Service/ApplePayDomainService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/ApplicationFeeService.php b/lib/Service/ApplicationFeeService.php
index c05c3cd59..55f4f0a5e 100644
--- a/lib/Service/ApplicationFeeService.php
+++ b/lib/Service/ApplicationFeeService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts);
}
+
}
diff --git a/lib/Service/BalanceService.php b/lib/Service/BalanceService.php
index 0f55385f1..79da649b4 100644
--- a/lib/Service/BalanceService.php
+++ b/lib/Service/BalanceService.php
@@ -1,5 +1,4 @@
request('get', '/v1/balance', $params, $opts);
}
+
}
diff --git a/lib/Service/BalanceTransactionService.php b/lib/Service/BalanceTransactionService.php
index fb1da5018..46d880200 100644
--- a/lib/Service/BalanceTransactionService.php
+++ b/lib/Service/BalanceTransactionService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/lib/Service/BillingPortal/BillingPortalServiceFactory.php
index 23a4d30b2..91e569288 100644
--- a/lib/Service/BillingPortal/BillingPortalServiceFactory.php
+++ b/lib/Service/BillingPortal/BillingPortalServiceFactory.php
@@ -1,5 +1,4 @@
*/
private static $classMap = [
- 'configurations' => ConfigurationService::class,
- 'sessions' => SessionService::class,
+ 'configurations' => ConfigurationService::class,
+ 'sessions' => SessionService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/BillingPortal/ConfigurationService.php b/lib/Service/BillingPortal/ConfigurationService.php
index 5a0d70db7..e9f9a1fd9 100644
--- a/lib/Service/BillingPortal/ConfigurationService.php
+++ b/lib/Service/BillingPortal/ConfigurationService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/BillingPortal/SessionService.php b/lib/Service/BillingPortal/SessionService.php
index 6b3e60263..588e78c66 100644
--- a/lib/Service/BillingPortal/SessionService.php
+++ b/lib/Service/BillingPortal/SessionService.php
@@ -1,5 +1,4 @@
request('post', '/v1/billing_portal/sessions', $params, $opts);
}
+
}
diff --git a/lib/Service/ChargeService.php b/lib/Service/ChargeService.php
index f8960edfb..87ac426e8 100644
--- a/lib/Service/ChargeService.php
+++ b/lib/Service/ChargeService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Checkout/CheckoutServiceFactory.php b/lib/Service/Checkout/CheckoutServiceFactory.php
index bb26a837f..64993f805 100644
--- a/lib/Service/Checkout/CheckoutServiceFactory.php
+++ b/lib/Service/Checkout/CheckoutServiceFactory.php
@@ -1,5 +1,4 @@
*/
private static $classMap = [
- 'sessions' => SessionService::class,
+ 'sessions' => SessionService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/Checkout/SessionService.php b/lib/Service/Checkout/SessionService.php
index b42ab8a17..daa3c5b6e 100644
--- a/lib/Service/Checkout/SessionService.php
+++ b/lib/Service/Checkout/SessionService.php
@@ -1,5 +1,4 @@
open.
+ * A Session can be expired when it is in one of these statuses: open
*
* After it expires, a customer can’t complete a Session and customers loading the
* Session see a message saying the Session is expired.
@@ -89,4 +88,5 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php
index edaadd3fa..036ca3ae7 100644
--- a/lib/Service/CoreServiceFactory.php
+++ b/lib/Service/CoreServiceFactory.php
@@ -1,5 +1,4 @@
*/
private static $classMap = [
- 'accountLinks' => AccountLinkService::class,
- 'accounts' => AccountService::class,
- 'applePayDomains' => ApplePayDomainService::class,
- 'applicationFees' => ApplicationFeeService::class,
- 'balance' => BalanceService::class,
- 'balanceTransactions' => BalanceTransactionService::class,
- 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class,
- 'charges' => ChargeService::class,
- 'checkout' => Checkout\CheckoutServiceFactory::class,
- 'countrySpecs' => CountrySpecService::class,
- 'coupons' => CouponService::class,
- 'creditNotes' => CreditNoteService::class,
- 'customers' => CustomerService::class,
- 'disputes' => DisputeService::class,
- 'ephemeralKeys' => EphemeralKeyService::class,
- 'events' => EventService::class,
- 'exchangeRates' => ExchangeRateService::class,
- 'fileLinks' => FileLinkService::class,
- 'files' => FileService::class,
- 'identity' => Identity\IdentityServiceFactory::class,
- 'invoiceItems' => InvoiceItemService::class,
- 'invoices' => InvoiceService::class,
- 'issuing' => Issuing\IssuingServiceFactory::class,
- 'mandates' => MandateService::class,
- 'oauth' => OAuthService::class,
- 'orderReturns' => OrderReturnService::class,
- 'orders' => OrderService::class,
- 'paymentIntents' => PaymentIntentService::class,
- 'paymentLinks' => PaymentLinkService::class,
- 'paymentMethods' => PaymentMethodService::class,
- 'payouts' => PayoutService::class,
- 'plans' => PlanService::class,
- 'prices' => PriceService::class,
- 'products' => ProductService::class,
- 'promotionCodes' => PromotionCodeService::class,
- 'quotes' => QuoteService::class,
- 'radar' => Radar\RadarServiceFactory::class,
- 'refunds' => RefundService::class,
- 'reporting' => Reporting\ReportingServiceFactory::class,
- 'reviews' => ReviewService::class,
- 'setupAttempts' => SetupAttemptService::class,
- 'setupIntents' => SetupIntentService::class,
- 'shippingRates' => ShippingRateService::class,
- 'sigma' => Sigma\SigmaServiceFactory::class,
- 'skus' => SkuService::class,
- 'sources' => SourceService::class,
- 'subscriptionItems' => SubscriptionItemService::class,
- 'subscriptions' => SubscriptionService::class,
- 'subscriptionSchedules' => SubscriptionScheduleService::class,
- 'taxCodes' => TaxCodeService::class,
- 'taxRates' => TaxRateService::class,
- 'terminal' => Terminal\TerminalServiceFactory::class,
- 'tokens' => TokenService::class,
- 'topups' => TopupService::class,
- 'transfers' => TransferService::class,
- 'webhookEndpoints' => WebhookEndpointService::class,
+ 'accountLinks' => AccountLinkService::class,
+ 'accounts' => AccountService::class,
+ 'applePayDomains' => ApplePayDomainService::class,
+ 'applicationFees' => ApplicationFeeService::class,
+ 'balance' => BalanceService::class,
+ 'balanceTransactions' => BalanceTransactionService::class,
+ 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class,
+ 'charges' => ChargeService::class,
+ 'checkout' => Checkout\CheckoutServiceFactory::class,
+ 'countrySpecs' => CountrySpecService::class,
+ 'coupons' => CouponService::class,
+ 'creditNotes' => CreditNoteService::class,
+ 'customers' => CustomerService::class,
+ 'disputes' => DisputeService::class,
+ 'ephemeralKeys' => EphemeralKeyService::class,
+ 'events' => EventService::class,
+ 'exchangeRates' => ExchangeRateService::class,
+ 'fileLinks' => FileLinkService::class,
+ 'files' => FileService::class,
+ 'identity' => Identity\IdentityServiceFactory::class,
+ 'invoiceItems' => InvoiceItemService::class,
+ 'invoices' => InvoiceService::class,
+ 'issuing' => Issuing\IssuingServiceFactory::class,
+ 'mandates' => MandateService::class,
+ 'oauth' => OAuthService::class,
+ 'orderReturns' => OrderReturnService::class,
+ 'orders' => OrderService::class,
+ 'paymentIntents' => PaymentIntentService::class,
+ 'paymentLinks' => PaymentLinkService::class,
+ 'paymentMethods' => PaymentMethodService::class,
+ 'payouts' => PayoutService::class,
+ 'plans' => PlanService::class,
+ 'prices' => PriceService::class,
+ 'products' => ProductService::class,
+ 'promotionCodes' => PromotionCodeService::class,
+ 'quotes' => QuoteService::class,
+ 'radar' => Radar\RadarServiceFactory::class,
+ 'refunds' => RefundService::class,
+ 'reporting' => Reporting\ReportingServiceFactory::class,
+ 'reviews' => ReviewService::class,
+ 'setupAttempts' => SetupAttemptService::class,
+ 'setupIntents' => SetupIntentService::class,
+ 'shippingRates' => ShippingRateService::class,
+ 'sigma' => Sigma\SigmaServiceFactory::class,
+ 'skus' => SkuService::class,
+ 'sources' => SourceService::class,
+ 'subscriptionItems' => SubscriptionItemService::class,
+ 'subscriptions' => SubscriptionService::class,
+ 'subscriptionSchedules' => SubscriptionScheduleService::class,
+ 'taxCodes' => TaxCodeService::class,
+ 'taxRates' => TaxRateService::class,
+ 'terminal' => Terminal\TerminalServiceFactory::class,
+ 'tokens' => TokenService::class,
+ 'topups' => TopupService::class,
+ 'transfers' => TransferService::class,
+ 'webhookEndpoints' => WebhookEndpointService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php
index 573444fd3..3b5d43fd5 100644
--- a/lib/Service/CountrySpecService.php
+++ b/lib/Service/CountrySpecService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/CouponService.php b/lib/Service/CouponService.php
index 82a880f53..76bf0a90d 100644
--- a/lib/Service/CouponService.php
+++ b/lib/Service/CouponService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/CreditNoteService.php b/lib/Service/CreditNoteService.php
index 23681402e..1a3dd0998 100644
--- a/lib/Service/CreditNoteService.php
+++ b/lib/Service/CreditNoteService.php
@@ -1,5 +1,4 @@
status=open invoice, a credit note reduces its
* amount_due
. For a status=paid
invoice, a credit note
* does not affect its amount_due
. Instead, it can result in any
- * combination of the following:.
+ * combination of the following:
*
* - Refund: create a new refund (using
refund_amount
) or link
* an existing refund (using refund
). - Customer balance
@@ -153,4 +152,5 @@ public function voidCreditNote($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php
index c05633cde..f9aa98b41 100644
--- a/lib/Service/CustomerService.php
+++ b/lib/Service/CustomerService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts);
}
+
}
diff --git a/lib/Service/DisputeService.php b/lib/Service/DisputeService.php
index 4eb1542bf..4dcbefc8a 100644
--- a/lib/Service/DisputeService.php
+++ b/lib/Service/DisputeService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/EphemeralKeyService.php b/lib/Service/EphemeralKeyService.php
index 3ca14c904..ab496fd3f 100644
--- a/lib/Service/EphemeralKeyService.php
+++ b/lib/Service/EphemeralKeyService.php
@@ -1,5 +1,4 @@
request('post', '/v1/ephemeral_keys', $params, $opts);
}
+
}
diff --git a/lib/Service/EventService.php b/lib/Service/EventService.php
index 430b35abf..c589717d6 100644
--- a/lib/Service/EventService.php
+++ b/lib/Service/EventService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/ExchangeRateService.php b/lib/Service/ExchangeRateService.php
index fc78410c7..543f55182 100644
--- a/lib/Service/ExchangeRateService.php
+++ b/lib/Service/ExchangeRateService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/FileLinkService.php b/lib/Service/FileLinkService.php
index 7a3a435dd..238b016e4 100644
--- a/lib/Service/FileLinkService.php
+++ b/lib/Service/FileLinkService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php
index 148428849..5c59ab9f1 100644
--- a/lib/Service/FileService.php
+++ b/lib/Service/FileService.php
@@ -1,5 +1,4 @@
request('post', '/v1/files', $flatParams, $opts);
}
+
}
diff --git a/lib/Service/Identity/IdentityServiceFactory.php b/lib/Service/Identity/IdentityServiceFactory.php
index cf6314628..86778ea1d 100644
--- a/lib/Service/Identity/IdentityServiceFactory.php
+++ b/lib/Service/Identity/IdentityServiceFactory.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 0393cd565..09a678a02 100644
--- a/lib/Service/Identity/VerificationReportService.php
+++ b/lib/Service/Identity/VerificationReportService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Identity/VerificationSessionService.php b/lib/Service/Identity/VerificationSessionService.php
index 1a763bef3..793ceefbd 100644
--- a/lib/Service/Identity/VerificationSessionService.php
+++ b/lib/Service/Identity/VerificationSessionService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/InvoiceItemService.php b/lib/Service/InvoiceItemService.php
index 0f0b9e91f..ada3b4c92 100644
--- a/lib/Service/InvoiceItemService.php
+++ b/lib/Service/InvoiceItemService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/InvoiceService.php b/lib/Service/InvoiceService.php
index 4e2efe696..f15914b76 100644
--- a/lib/Service/InvoiceService.php
+++ b/lib/Service/InvoiceService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Issuing/AuthorizationService.php b/lib/Service/Issuing/AuthorizationService.php
index 6fff70e7e..1ad04b32b 100644
--- a/lib/Service/Issuing/AuthorizationService.php
+++ b/lib/Service/Issuing/AuthorizationService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Issuing/CardService.php b/lib/Service/Issuing/CardService.php
index 346d54afa..2d9214664 100644
--- a/lib/Service/Issuing/CardService.php
+++ b/lib/Service/Issuing/CardService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Issuing/CardholderService.php b/lib/Service/Issuing/CardholderService.php
index 5731b1bf1..e228463c7 100644
--- a/lib/Service/Issuing/CardholderService.php
+++ b/lib/Service/Issuing/CardholderService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Issuing/DisputeService.php b/lib/Service/Issuing/DisputeService.php
index ab5df5f3e..242292d0b 100644
--- a/lib/Service/Issuing/DisputeService.php
+++ b/lib/Service/Issuing/DisputeService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php
index a8d5d0f81..f6cd75961 100644
--- a/lib/Service/Issuing/IssuingServiceFactory.php
+++ b/lib/Service/Issuing/IssuingServiceFactory.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 8fb0ee2ac..15e024afa 100644
--- a/lib/Service/Issuing/TransactionService.php
+++ b/lib/Service/Issuing/TransactionService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/MandateService.php b/lib/Service/MandateService.php
index 156bff0a0..eea044d7e 100644
--- a/lib/Service/MandateService.php
+++ b/lib/Service/MandateService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/OrderReturnService.php b/lib/Service/OrderReturnService.php
index 6183166c5..c2dc541ff 100644
--- a/lib/Service/OrderReturnService.php
+++ b/lib/Service/OrderReturnService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/OrderService.php b/lib/Service/OrderService.php
index fa658fa7b..ff1dc397a 100644
--- a/lib/Service/OrderService.php
+++ b/lib/Service/OrderService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php
index 912cec14d..6fb229232 100644
--- a/lib/Service/PaymentIntentService.php
+++ b/lib/Service/PaymentIntentService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PaymentLinkService.php b/lib/Service/PaymentLinkService.php
index 323d997b7..ea92ada83 100644
--- a/lib/Service/PaymentLinkService.php
+++ b/lib/Service/PaymentLinkService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PaymentMethodService.php b/lib/Service/PaymentMethodService.php
index e7f341a0b..089f12bf7 100644
--- a/lib/Service/PaymentMethodService.php
+++ b/lib/Service/PaymentMethodService.php
@@ -1,5 +1,4 @@
List a Customer’s
- * PaymentMethods.
+ * PaymentMethods
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
@@ -126,4 +125,5 @@ public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PayoutService.php b/lib/Service/PayoutService.php
index 547e22da6..379110c6c 100644
--- a/lib/Service/PayoutService.php
+++ b/lib/Service/PayoutService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PlanService.php b/lib/Service/PlanService.php
index 16625d27a..0f9e5cd11 100644
--- a/lib/Service/PlanService.php
+++ b/lib/Service/PlanService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PriceService.php b/lib/Service/PriceService.php
index cc44f69c9..bc832e943 100644
--- a/lib/Service/PriceService.php
+++ b/lib/Service/PriceService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/ProductService.php b/lib/Service/ProductService.php
index 850cea56f..f5362271c 100644
--- a/lib/Service/ProductService.php
+++ b/lib/Service/ProductService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/PromotionCodeService.php b/lib/Service/PromotionCodeService.php
index e4c3d202a..1b6ec631c 100644
--- a/lib/Service/PromotionCodeService.php
+++ b/lib/Service/PromotionCodeService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/QuoteService.php b/lib/Service/QuoteService.php
index 96f12a5c3..280112cb2 100644
--- a/lib/Service/QuoteService.php
+++ b/lib/Service/QuoteService.php
@@ -1,5 +1,4 @@
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 7b0973483..bf27457a4 100644
--- a/lib/Service/Radar/EarlyFraudWarningService.php
+++ b/lib/Service/Radar/EarlyFraudWarningService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Radar/RadarServiceFactory.php b/lib/Service/Radar/RadarServiceFactory.php
index b093c6717..2305ce475 100644
--- a/lib/Service/Radar/RadarServiceFactory.php
+++ b/lib/Service/Radar/RadarServiceFactory.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 89eba2a7a..1dff63e4a 100644
--- a/lib/Service/Radar/ValueListItemService.php
+++ b/lib/Service/Radar/ValueListItemService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Radar/ValueListService.php b/lib/Service/Radar/ValueListService.php
index 64ac2ee79..ce21935e2 100644
--- a/lib/Service/Radar/ValueListService.php
+++ b/lib/Service/Radar/ValueListService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/RefundService.php b/lib/Service/RefundService.php
index 49b4267e4..861220b3b 100644
--- a/lib/Service/RefundService.php
+++ b/lib/Service/RefundService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Reporting/ReportRunService.php b/lib/Service/Reporting/ReportRunService.php
index 692420cd4..f71fb9db4 100644
--- a/lib/Service/Reporting/ReportRunService.php
+++ b/lib/Service/Reporting/ReportRunService.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
@@ -52,4 +51,5 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Reporting/ReportTypeService.php b/lib/Service/Reporting/ReportTypeService.php
index e1b4ea521..48b499673 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
@@ -37,4 +36,5 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts);
}
+
}
diff --git a/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 ea152f23e..99aa7fc3e 100644
--- a/lib/Service/ReviewService.php
+++ b/lib/Service/ReviewService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/SetupAttemptService.php b/lib/Service/SetupAttemptService.php
index 7376ea13e..f8e6af81f 100644
--- a/lib/Service/SetupAttemptService.php
+++ b/lib/Service/SetupAttemptService.php
@@ -1,5 +1,4 @@
requestCollection('get', '/v1/setup_attempts', $params, $opts);
}
+
}
diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php
index 3cbec506f..caa0d83f8 100644
--- a/lib/Service/SetupIntentService.php
+++ b/lib/Service/SetupIntentService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/ShippingRateService.php b/lib/Service/ShippingRateService.php
index d7b55a8b3..d95b5106b 100644
--- a/lib/Service/ShippingRateService.php
+++ b/lib/Service/ShippingRateService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Sigma/ScheduledQueryRunService.php b/lib/Service/Sigma/ScheduledQueryRunService.php
index 92641751b..d39bd4dfd 100644
--- a/lib/Service/Sigma/ScheduledQueryRunService.php
+++ b/lib/Service/Sigma/ScheduledQueryRunService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Sigma/SigmaServiceFactory.php b/lib/Service/Sigma/SigmaServiceFactory.php
index 356750f47..0c7d5e582 100644
--- a/lib/Service/Sigma/SigmaServiceFactory.php
+++ b/lib/Service/Sigma/SigmaServiceFactory.php
@@ -1,5 +1,4 @@
*/
private static $classMap = [
- 'scheduledQueryRuns' => ScheduledQueryRunService::class,
+ 'scheduledQueryRuns' => ScheduledQueryRunService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/SkuService.php b/lib/Service/SkuService.php
index 8934f2064..d675d9446 100644
--- a/lib/Service/SkuService.php
+++ b/lib/Service/SkuService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/SourceService.php b/lib/Service/SourceService.php
index c6cc05964..177fc359e 100644
--- a/lib/Service/SourceService.php
+++ b/lib/Service/SourceService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/SubscriptionItemService.php b/lib/Service/SubscriptionItemService.php
index 3b2aa2b12..fcd6245a3 100644
--- a/lib/Service/SubscriptionItemService.php
+++ b/lib/Service/SubscriptionItemService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/SubscriptionScheduleService.php b/lib/Service/SubscriptionScheduleService.php
index 9eed46060..a79829f49 100644
--- a/lib/Service/SubscriptionScheduleService.php
+++ b/lib/Service/SubscriptionScheduleService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php
index f3ac768c8..2016500a7 100644
--- a/lib/Service/SubscriptionService.php
+++ b/lib/Service/SubscriptionService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/TaxCodeService.php b/lib/Service/TaxCodeService.php
index 007b77136..edea8514d 100644
--- a/lib/Service/TaxCodeService.php
+++ b/lib/Service/TaxCodeService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/TaxRateService.php b/lib/Service/TaxRateService.php
index 7cee1fead..3e2ba167b 100644
--- a/lib/Service/TaxRateService.php
+++ b/lib/Service/TaxRateService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Terminal/ConnectionTokenService.php b/lib/Service/Terminal/ConnectionTokenService.php
index 7b25b2315..6be12add5 100644
--- a/lib/Service/Terminal/ConnectionTokenService.php
+++ b/lib/Service/Terminal/ConnectionTokenService.php
@@ -1,5 +1,4 @@
request('post', '/v1/terminal/connection_tokens', $params, $opts);
}
+
}
diff --git a/lib/Service/Terminal/LocationService.php b/lib/Service/Terminal/LocationService.php
index 5a217bea4..c1ae02631 100644
--- a/lib/Service/Terminal/LocationService.php
+++ b/lib/Service/Terminal/LocationService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Terminal/ReaderService.php b/lib/Service/Terminal/ReaderService.php
index 765015c83..a36064fc6 100644
--- a/lib/Service/Terminal/ReaderService.php
+++ b/lib/Service/Terminal/ReaderService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/Terminal/TerminalServiceFactory.php b/lib/Service/Terminal/TerminalServiceFactory.php
index c70ac873b..48aea405d 100644
--- a/lib/Service/Terminal/TerminalServiceFactory.php
+++ b/lib/Service/Terminal/TerminalServiceFactory.php
@@ -1,5 +1,4 @@
*/
private static $classMap = [
- 'connectionTokens' => ConnectionTokenService::class,
- 'locations' => LocationService::class,
- 'readers' => ReaderService::class,
+ 'connectionTokens' => ConnectionTokenService::class,
+ 'locations' => LocationService::class,
+ 'readers' => ReaderService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php
index 1c72759f6..f50c511a8 100644
--- a/lib/Service/TokenService.php
+++ b/lib/Service/TokenService.php
@@ -1,5 +1,4 @@
request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/TopupService.php b/lib/Service/TopupService.php
index 059dc2090..d71279129 100644
--- a/lib/Service/TopupService.php
+++ b/lib/Service/TopupService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/Service/TransferService.php b/lib/Service/TransferService.php
index 150bbf731..3a2f184e1 100644
--- a/lib/Service/TransferService.php
+++ b/lib/Service/TransferService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
}
+
}
diff --git a/lib/Service/WebhookEndpointService.php b/lib/Service/WebhookEndpointService.php
index 01e642249..ac7988461 100644
--- a/lib/Service/WebhookEndpointService.php
+++ b/lib/Service/WebhookEndpointService.php
@@ -1,5 +1,4 @@
request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts);
}
+
}
diff --git a/lib/SetupAttempt.php b/lib/SetupAttempt.php
index 6c83b686c..e7dd51867 100644
--- a/lib/SetupAttempt.php
+++ b/lib/SetupAttempt.php
@@ -1,5 +1,4 @@
instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom(['discount' => null], $opts, true);
-
return $this;
}
+
}
diff --git a/lib/SubscriptionItem.php b/lib/SubscriptionItem.php
index 5bd25b252..7aeb9eac7 100644
--- a/lib/SubscriptionItem.php
+++ b/lib/SubscriptionItem.php
@@ -1,5 +1,4 @@
_save($opts);
}
+
}
diff --git a/lib/UsageRecord.php b/lib/UsageRecord.php
index 552298276..564dd8ecd 100644
--- a/lib/UsageRecord.php
+++ b/lib/UsageRecord.php
@@ -1,5 +1,4 @@
\Stripe\Account::class,
- \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class,
- \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class,
- \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class,
- \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class,
- \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class,
- \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class,
- \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class,
- \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class,
- \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class,
- \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class,
- \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class,
- \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class,
- \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class,
- \Stripe\Card::OBJECT_NAME => \Stripe\Card::class,
- \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class,
- \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class,
- \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class,
- \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class,
- \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class,
- \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class,
- \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class,
- \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class,
- \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class,
- \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class,
- \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class,
- \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class,
- \Stripe\Event::OBJECT_NAME => \Stripe\Event::class,
- \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class,
- \Stripe\File::OBJECT_NAME => \Stripe\File::class,
- \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class,
- \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class,
- \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class,
- \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class,
- \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class,
- \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class,
- \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class,
- \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class,
- \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class,
- \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class,
- \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class,
- \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,
- \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class,
- \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class,
- \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class,
- \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class,
- \Stripe\Order::OBJECT_NAME => \Stripe\Order::class,
- \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class,
- \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class,
- \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class,
- \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class,
- \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,
- \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
- \Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
- \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class,
- \Stripe\Price::OBJECT_NAME => \Stripe\Price::class,
- \Stripe\Product::OBJECT_NAME => \Stripe\Product::class,
- \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class,
- \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class,
- \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class,
- \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class,
- \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class,
- \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class,
- \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class,
- \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class,
- \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
- \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
- \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
- \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class,
- \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
- \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class,
- \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
- \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
- \Stripe\Source::OBJECT_NAME => \Stripe\Source::class,
- \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class,
- \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
- \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
- \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
- \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
- \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
- \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
- \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
- \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class,
- \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class,
- \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class,
- \Stripe\Token::OBJECT_NAME => \Stripe\Token::class,
- \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class,
- \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class,
- \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class,
- \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class,
- \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class,
- \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class,
- ];
+ /**
+ * @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\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class,
+ \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class,
+ \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class,
+ \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class,
+ \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class,
+ \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class,
+ \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class,
+ \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class,
+ \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class,
+ \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class,
+ \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class,
+ \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class,
+ \Stripe\Card::OBJECT_NAME => \Stripe\Card::class,
+ \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class,
+ \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class,
+ \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class,
+ \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class,
+ \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class,
+ \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class,
+ \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class,
+ \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class,
+ \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class,
+ \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class,
+ \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class,
+ \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class,
+ \Stripe\Event::OBJECT_NAME => \Stripe\Event::class,
+ \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class,
+ \Stripe\File::OBJECT_NAME => \Stripe\File::class,
+ \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class,
+ \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class,
+ \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class,
+ \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class,
+ \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class,
+ \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class,
+ \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class,
+ \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class,
+ \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class,
+ \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class,
+ \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class,
+ \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,
+ \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class,
+ \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class,
+ \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class,
+ \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class,
+ \Stripe\Order::OBJECT_NAME => \Stripe\Order::class,
+ \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class,
+ \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class,
+ \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class,
+ \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class,
+ \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,
+ \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
+ \Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
+ \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class,
+ \Stripe\Price::OBJECT_NAME => \Stripe\Price::class,
+ \Stripe\Product::OBJECT_NAME => \Stripe\Product::class,
+ \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class,
+ \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class,
+ \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class,
+ \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class,
+ \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class,
+ \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class,
+ \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class,
+ \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class,
+ \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
+ \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
+ \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
+ \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class,
+ \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
+ \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class,
+ \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
+ \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
+ \Stripe\Source::OBJECT_NAME => \Stripe\Source::class,
+ \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class,
+ \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
+ \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
+ \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
+ \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
+ \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
+ \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
+ \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
+ \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class,
+ \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class,
+ \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class,
+ \Stripe\Token::OBJECT_NAME => \Stripe\Token::class,
+ \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class,
+ \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class,
+ \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class,
+ \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class,
+ \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class,
+ \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class,
+ ];
}
diff --git a/lib/WebhookEndpoint.php b/lib/WebhookEndpoint.php
index 96333d132..b7cf80c94 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 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 testRetrieveBalanceTransaction()
- {
- $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx');
- $result = $this->client->balanceTransactions->retrieve(
- 'txn_xxxxxxxxxxxxx',
- []
- );
- static::assertInstanceOf(\Stripe\BalanceTransaction::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 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 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 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 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 testDeleteCustomer()
- {
- $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx');
- $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Customer::class, $result);
- }
-
- 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 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 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 testRetrieveEvent()
- {
- $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx');
- $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Event::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 testRetrieveFile()
- {
- $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx');
- $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\File::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 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 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 testRetrieveMandate()
- {
- $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx');
- $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Mandate::class, $result);
- }
-
- public function testCreatePaymentIntent()
- {
- $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 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 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 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 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 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 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 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 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 testListSetupAttempt()
- {
- $this->expectsRequest('get', '/v1/setup_attempts');
- $result = $this->client->setupAttempts->all(
- ['setup_intent' => 'seti_xxxxxxxxxxxxx', 'limit' => 3]
- );
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\SetupAttempt::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 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 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 testCreateProduct()
- {
- $this->expectsRequest('post', '/v1/products');
- $result = $this->client->products->create(['name' => 'Gold Special']);
- 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 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 testDeleteProduct()
- {
- $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx');
- $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Product::class, $result);
- }
-
- public function testCreatePrice()
- {
- $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 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 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 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 testCreateToken()
- {
- $this->expectsRequest('post', '/v1/tokens');
- $result = $this->client->tokens->create(
- [
- 'card' => [
- 'number' => '4242424242424242',
- 'exp_month' => '5',
- 'exp_year' => '2022',
- 'cvc' => '314',
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Token::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 testCreatePaymentMethod()
- {
- $this->expectsRequest('post', '/v1/payment_methods');
- $result = $this->client->paymentMethods->create(
- [
- 'type' => 'card',
- 'card' => [
- 'number' => '4242424242424242',
- 'exp_month' => 5,
- 'exp_year' => 2022,
- '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 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 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 testRetrieveSource()
- {
- $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 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',
- 'payment_method_types' => ['card'],
- 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]],
- 'mode' => 'payment',
- ]
- );
- static::assertInstanceOf(\Stripe\Checkout\Session::class, $result);
- }
-
- public function testRetrieveSession()
- {
- $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 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 testCreateCoupon()
- {
- $this->expectsRequest('post', '/v1/coupons');
- $result = $this->client->coupons->create(
- [
- 'percent_off' => 25,
- 'duration' => 'repeating',
- 'duration_in_months' => 3,
- ]
- );
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
-
- public function testRetrieveCoupon()
- {
- $this->expectsRequest('get', '/v1/coupons/25_5OFF');
- $result = $this->client->coupons->retrieve('25_5OFF', []);
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
-
- public function testUpdateCoupon()
- {
- $this->expectsRequest('post', '/v1/coupons/co_xxxxxxxxxxxxx');
- $result = $this->client->coupons->update(
- 'co_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
-
- public function testDeleteCoupon()
- {
- $this->expectsRequest('delete', '/v1/coupons/co_xxxxxxxxxxxxx');
- $result = $this->client->coupons->delete('co_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Coupon::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 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 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 testRetrieveCreditNote()
- {
- $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
- $result = $this->client->creditNotes->retrieve('cn_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\CreditNote::class, $result);
- }
-
- public function testUpdateCreditNote()
- {
- $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
- $result = $this->client->creditNotes->update(
- 'cn_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- 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 testPreviewCreditNote2()
- {
- $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 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 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 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 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 testCreateSession2()
- {
- $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 testUpdateConfiguration()
- {
- $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 testRetrieveConfiguration()
- {
- $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 testListConfiguration()
- {
- $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 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 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 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 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 testCreateInvoice()
- {
- $this->expectsRequest('post', '/v1/invoices');
- $result = $this->client->invoices->create(
- ['customer' => 'cus_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 testDeleteInvoice()
- {
- $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx');
- $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []);
- 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 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 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 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 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 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 testDeleteInvoiceItem()
- {
- $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx');
- $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\InvoiceItem::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 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 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 testDeletePlan()
- {
- $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx');
- $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Plan::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 testCreatePromotionCode()
- {
- $this->expectsRequest('post', '/v1/promotion_codes');
- $result = $this->client->promotionCodes->create(['coupon' => '25_5OFF']);
- 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 testRetrievePromotionCode()
- {
- $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx');
- $result = $this->client->promotionCodes->retrieve(
- 'promo_xxxxxxxxxxxxx',
- []
- );
- static::assertInstanceOf(\Stripe\PromotionCode::class, $result);
- }
-
- 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 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 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 testCancelSubscription()
- {
- $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx');
- $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Subscription::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 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 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 testDeleteSubscriptionItem()
- {
- $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx');
- $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SubscriptionItem::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 testCreateSubscriptionSchedule()
- {
- $this->expectsRequest('post', '/v1/subscription_schedules');
- $result = $this->client->subscriptionSchedules->create(
- [
- 'customer' => 'cus_xxxxxxxxxxxxx',
- 'start_date' => 1620753115,
- '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 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 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 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 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 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 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 testRetrieveAccount()
- {
- $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 testDeleteAccount()
- {
- $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx');
- $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []);
- 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 testListAccount()
- {
- $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 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 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 testRetrieveApplicationFee()
- {
- $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx');
- $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\ApplicationFee::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 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 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 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 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 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 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 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 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 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 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 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 testCancelTopup()
- {
- $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel');
- $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Topup::class, $result);
- }
-
- 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 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 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 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 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 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 testApproveReview()
- {
- $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve');
- $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Review::class, $result);
- }
-
- 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 testUpdateDispute2()
- {
- $this->expectsRequest('post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx');
- $result = $this->client->issuing->disputes->update(
- 'idp_xxxxxxxxxxxxx',
- [
- 'evidence' => [
- 'reason' => 'not_received',
- 'not_received' => [
- 'expected_at' => 1590000000,
- 'explanation' => '',
- 'product_description' => 'Baseball cap',
- 'product_type' => 'merchandise',
- ],
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Issuing\Dispute::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 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 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 testCreateConnectionToken()
- {
- $this->expectsRequest('post', '/v1/terminal/connection_tokens');
- $result = $this->client->terminal->connectionTokens->create([]);
- static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result);
- }
-
- 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 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 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 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 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 testRetrieveReader()
- {
- $this->expectsRequest('get', '/v1/terminal/readers/tmr_P400-123-456-789');
- $result = $this->client->terminal->readers->retrieve(
- 'tmr_P400-123-456-789',
- []
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
- }
-
- public function testUpdateReader()
- {
- $this->expectsRequest('post', '/v1/terminal/readers/tmr_P400-123-456-789');
- $result = $this->client->terminal->readers->update(
- 'tmr_P400-123-456-789',
- ['label' => 'Blue Rabbit']
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
- }
-
- public function testDeleteReader()
- {
- $this->expectsRequest(
- 'delete',
- '/v1/terminal/readers/tmr_P400-123-456-789'
- );
- $result = $this->client->terminal->readers->delete(
- 'tmr_P400-123-456-789',
- []
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::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 testCreateOrder()
- {
- $this->expectsRequest('post', '/v1/orders');
- $result = $this->client->orders->create(
- [
- 'currency' => 'usd',
- 'email' => 'jenny.rosen@example.com',
- 'items' => [['type' => 'sku', 'parent' => 'sku_xxxxxxxxxxxxx']],
- 'shipping' => [
- 'name' => 'Jenny Rosen',
- 'address' => [
- 'line1' => '1234 Main Street',
- 'city' => 'San Francisco',
- 'state' => 'CA',
- 'country' => 'US',
- 'postal_code' => '94111',
- ],
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
-
- public function testRetrieveOrder()
- {
- $this->expectsRequest('get', '/v1/orders/or_xxxxxxxxxxxxx');
- $result = $this->client->orders->retrieve('or_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
-
- public function testUpdateOrder()
- {
- $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx');
- $result = $this->client->orders->update(
- 'or_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
-
- public function testPayOrder()
- {
- $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx/pay');
- $result = $this->client->orders->pay(
- 'or_xxxxxxxxxxxxx',
- ['source' => 'tok_xxxx']
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
-
- public function testListOrder()
- {
- $this->expectsRequest('get', '/v1/orders');
- $result = $this->client->orders->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\Order::class, $result->data[0]);
- }
-
- public function testRetrieveOrderReturn()
- {
- $this->expectsRequest('get', '/v1/order_returns/orret_xxxxxxxxxxxxx');
- $result = $this->client->orderReturns->retrieve('orret_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\OrderReturn::class, $result);
- }
-
- public function testListOrderReturn()
- {
- $this->expectsRequest('get', '/v1/order_returns');
- $result = $this->client->orderReturns->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\OrderReturn::class, $result->data[0]);
- }
-
- public function testCreateSku()
- {
- $this->expectsRequest('post', '/v1/skus');
- $result = $this->client->skus->create(
- [
- 'attributes' => ['size' => 'Medium', 'gender' => 'Unisex'],
- 'price' => 1500,
- 'currency' => 'usd',
- 'inventory' => ['type' => 'finite', 'quantity' => 500],
- 'product' => 'prod_xxxxxxxxxxxxx',
- ]
- );
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
-
- public function testRetrieveSku()
- {
- $this->expectsRequest('get', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->retrieve('sku_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
-
- public function testUpdateSku()
- {
- $this->expectsRequest('post', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->update(
- 'sku_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
-
- public function testListSku()
- {
- $this->expectsRequest('get', '/v1/skus');
- $result = $this->client->skus->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\SKU::class, $result->data[0]);
- }
-
- public function testDeleteSku()
- {
- $this->expectsRequest('delete', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->delete('sku_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
-
- 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 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 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 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 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 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 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);
- }
-
- 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 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 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 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 testCreateSession3()
- {
- $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 testCreatePaymentIntent2()
- {
- $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 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 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 testRetrievePaymentLink()
- {
- $this->expectsRequest('get', '/v1/payment_links/pl_xyz');
- $result = $this->client->paymentLinks->retrieve('pl_xyz', []);
- static::assertInstanceOf(\Stripe\PaymentLink::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 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 testRetrieveBalanceTransaction()
+ {
+ $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx');
+ $result = $this->client->balanceTransactions->retrieve(
+ 'txn_xxxxxxxxxxxxx',
+ []
+ );
+ static::assertInstanceOf(\Stripe\BalanceTransaction::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 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 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 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 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 testDeleteCustomer()
+ {
+ $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx');
+ $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Customer::class, $result);
+ }
+ 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 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 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 testRetrieveEvent()
+ {
+ $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx');
+ $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Event::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 testRetrieveFile()
+ {
+ $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx');
+ $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\File::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 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 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 testRetrieveMandate()
+ {
+ $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx');
+ $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Mandate::class, $result);
+ }
+ public function testCreatePaymentIntent()
+ {
+ $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 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 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 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 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 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 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 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 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 testListSetupAttempt()
+ {
+ $this->expectsRequest('get', '/v1/setup_attempts');
+ $result = $this->client->setupAttempts->all(
+ ['setup_intent' => 'seti_xxxxxxxxxxxxx', 'limit' => 3]
+ );
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\SetupAttempt::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 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 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 testCreateProduct()
+ {
+ $this->expectsRequest('post', '/v1/products');
+ $result = $this->client->products->create(['name' => 'Gold Special']);
+ 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 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 testDeleteProduct()
+ {
+ $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx');
+ $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Product::class, $result);
+ }
+ public function testCreatePrice()
+ {
+ $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 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 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 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 testCreateToken()
+ {
+ $this->expectsRequest('post', '/v1/tokens');
+ $result = $this->client->tokens->create(
+ [
+ 'card' => [
+ 'number' => '4242424242424242',
+ 'exp_month' => '5',
+ 'exp_year' => '2022',
+ 'cvc' => '314',
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Token::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 testCreatePaymentMethod()
+ {
+ $this->expectsRequest('post', '/v1/payment_methods');
+ $result = $this->client->paymentMethods->create(
+ [
+ 'type' => 'card',
+ 'card' => [
+ 'number' => '4242424242424242',
+ 'exp_month' => 5,
+ 'exp_year' => 2022,
+ '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 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 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 testRetrieveSource()
+ {
+ $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 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',
+ 'payment_method_types' => ['card'],
+ 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]],
+ 'mode' => 'payment',
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Checkout\Session::class, $result);
+ }
+ public function testRetrieveSession()
+ {
+ $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 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 testCreateCoupon()
+ {
+ $this->expectsRequest('post', '/v1/coupons');
+ $result = $this->client->coupons->create(
+ [
+ 'percent_off' => 25,
+ 'duration' => 'repeating',
+ 'duration_in_months' => 3,
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+ public function testRetrieveCoupon()
+ {
+ $this->expectsRequest('get', '/v1/coupons/25_5OFF');
+ $result = $this->client->coupons->retrieve('25_5OFF', []);
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+ public function testUpdateCoupon()
+ {
+ $this->expectsRequest('post', '/v1/coupons/co_xxxxxxxxxxxxx');
+ $result = $this->client->coupons->update(
+ 'co_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+ public function testDeleteCoupon()
+ {
+ $this->expectsRequest('delete', '/v1/coupons/co_xxxxxxxxxxxxx');
+ $result = $this->client->coupons->delete('co_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Coupon::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 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 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 testRetrieveCreditNote()
+ {
+ $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
+ $result = $this->client->creditNotes->retrieve('cn_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\CreditNote::class, $result);
+ }
+ public function testUpdateCreditNote()
+ {
+ $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
+ $result = $this->client->creditNotes->update(
+ 'cn_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ 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 testPreviewCreditNote2()
+ {
+ $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 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 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 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 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 testCreateSession2()
+ {
+ $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 testUpdateConfiguration()
+ {
+ $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 testRetrieveConfiguration()
+ {
+ $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 testListConfiguration()
+ {
+ $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 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 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 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 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 testCreateInvoice()
+ {
+ $this->expectsRequest('post', '/v1/invoices');
+ $result = $this->client->invoices->create(
+ ['customer' => 'cus_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 testDeleteInvoice()
+ {
+ $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx');
+ $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []);
+ 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 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 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 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 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 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 testDeleteInvoiceItem()
+ {
+ $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx');
+ $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\InvoiceItem::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 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 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 testDeletePlan()
+ {
+ $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx');
+ $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Plan::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 testCreatePromotionCode()
+ {
+ $this->expectsRequest('post', '/v1/promotion_codes');
+ $result = $this->client->promotionCodes->create(['coupon' => '25_5OFF']);
+ 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 testRetrievePromotionCode()
+ {
+ $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx');
+ $result = $this->client->promotionCodes->retrieve(
+ 'promo_xxxxxxxxxxxxx',
+ []
+ );
+ static::assertInstanceOf(\Stripe\PromotionCode::class, $result);
+ }
+ 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 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 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 testCancelSubscription()
+ {
+ $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx');
+ $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Subscription::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 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 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 testDeleteSubscriptionItem()
+ {
+ $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx');
+ $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SubscriptionItem::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 testCreateSubscriptionSchedule()
+ {
+ $this->expectsRequest('post', '/v1/subscription_schedules');
+ $result = $this->client->subscriptionSchedules->create(
+ [
+ 'customer' => 'cus_xxxxxxxxxxxxx',
+ 'start_date' => 1620753115,
+ '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 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 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 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 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 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 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 testRetrieveAccount()
+ {
+ $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 testDeleteAccount()
+ {
+ $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx');
+ $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []);
+ 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 testListAccount()
+ {
+ $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 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 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 testRetrieveApplicationFee()
+ {
+ $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx');
+ $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\ApplicationFee::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 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 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 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 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 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 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 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 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 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 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 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 testCancelTopup()
+ {
+ $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel');
+ $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Topup::class, $result);
+ }
+ 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 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 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 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 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 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 testApproveReview()
+ {
+ $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve');
+ $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Review::class, $result);
+ }
+ 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 testUpdateDispute2()
+ {
+ $this->expectsRequest('post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx');
+ $result = $this->client->issuing->disputes->update(
+ 'idp_xxxxxxxxxxxxx',
+ [
+ 'evidence' => [
+ 'reason' => 'not_received',
+ 'not_received' => [
+ 'expected_at' => 1590000000,
+ 'explanation' => '',
+ 'product_description' => 'Baseball cap',
+ 'product_type' => 'merchandise',
+ ],
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Dispute::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 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 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 testCreateConnectionToken()
+ {
+ $this->expectsRequest('post', '/v1/terminal/connection_tokens');
+ $result = $this->client->terminal->connectionTokens->create([]);
+ static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result);
+ }
+ 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 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 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 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 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 testRetrieveReader()
+ {
+ $this->expectsRequest('get', '/v1/terminal/readers/tmr_P400-123-456-789');
+ $result = $this->client->terminal->readers->retrieve(
+ 'tmr_P400-123-456-789',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
+ }
+ public function testUpdateReader()
+ {
+ $this->expectsRequest('post', '/v1/terminal/readers/tmr_P400-123-456-789');
+ $result = $this->client->terminal->readers->update(
+ 'tmr_P400-123-456-789',
+ ['label' => 'Blue Rabbit']
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
+ }
+ public function testDeleteReader()
+ {
+ $this->expectsRequest(
+ 'delete',
+ '/v1/terminal/readers/tmr_P400-123-456-789'
+ );
+ $result = $this->client->terminal->readers->delete(
+ 'tmr_P400-123-456-789',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::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 testCreateOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders');
+ $result = $this->client->orders->create(
+ [
+ 'currency' => 'usd',
+ 'email' => 'jenny.rosen@example.com',
+ 'items' => [['type' => 'sku', 'parent' => 'sku_xxxxxxxxxxxxx']],
+ 'shipping' => [
+ 'name' => 'Jenny Rosen',
+ 'address' => [
+ 'line1' => '1234 Main Street',
+ 'city' => 'San Francisco',
+ 'state' => 'CA',
+ 'country' => 'US',
+ 'postal_code' => '94111',
+ ],
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+ public function testRetrieveOrder()
+ {
+ $this->expectsRequest('get', '/v1/orders/or_xxxxxxxxxxxxx');
+ $result = $this->client->orders->retrieve('or_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+ public function testUpdateOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx');
+ $result = $this->client->orders->update(
+ 'or_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+ public function testPayOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx/pay');
+ $result = $this->client->orders->pay(
+ 'or_xxxxxxxxxxxxx',
+ ['source' => 'tok_xxxx']
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+ public function testListOrder()
+ {
+ $this->expectsRequest('get', '/v1/orders');
+ $result = $this->client->orders->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\Order::class, $result->data[0]);
+ }
+ public function testRetrieveOrderReturn()
+ {
+ $this->expectsRequest('get', '/v1/order_returns/orret_xxxxxxxxxxxxx');
+ $result = $this->client->orderReturns->retrieve('orret_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\OrderReturn::class, $result);
+ }
+ public function testListOrderReturn()
+ {
+ $this->expectsRequest('get', '/v1/order_returns');
+ $result = $this->client->orderReturns->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\OrderReturn::class, $result->data[0]);
+ }
+ public function testCreateSku()
+ {
+ $this->expectsRequest('post', '/v1/skus');
+ $result = $this->client->skus->create(
+ [
+ 'attributes' => ['size' => 'Medium', 'gender' => 'Unisex'],
+ 'price' => 1500,
+ 'currency' => 'usd',
+ 'inventory' => ['type' => 'finite', 'quantity' => 500],
+ 'product' => 'prod_xxxxxxxxxxxxx',
+ ]
+ );
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+ public function testRetrieveSku()
+ {
+ $this->expectsRequest('get', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->retrieve('sku_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+ public function testUpdateSku()
+ {
+ $this->expectsRequest('post', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->update(
+ 'sku_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+ public function testListSku()
+ {
+ $this->expectsRequest('get', '/v1/skus');
+ $result = $this->client->skus->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\SKU::class, $result->data[0]);
+ }
+ public function testDeleteSku()
+ {
+ $this->expectsRequest('delete', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->delete('sku_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+ 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 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 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 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 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 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 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);
+ }
+ 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 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 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 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 testCreateSession3()
+ {
+ $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 testCreatePaymentIntent2()
+ {
+ $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 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 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 testRetrievePaymentLink()
+ {
+ $this->expectsRequest('get', '/v1/payment_links/pl_xyz');
+ $result = $this->client->paymentLinks->retrieve('pl_xyz', []);
+ static::assertInstanceOf(\Stripe\PaymentLink::class, $result);
+ }
+}
\ No newline at end of file
From a61180736ba1ec384649878081ee8fbe3dca253a Mon Sep 17 00:00:00 2001
From: Yejia Chen
Date: Thu, 3 Feb 2022 15:19:43 -0800
Subject: [PATCH 2/2] formatting
---
init.php | 1 +
lib/Account.php | 8 +-
lib/AccountLink.php | 2 +-
lib/ApplePayDomain.php | 2 +-
lib/ApplicationFee.php | 2 +-
lib/ApplicationFeeRefund.php | 3 +-
lib/Balance.php | 3 +-
lib/BalanceTransaction.php | 2 +-
lib/BankAccount.php | 2 +-
lib/BillingPortal/Configuration.php | 2 +-
lib/BillingPortal/Session.php | 2 +-
lib/BitcoinReceiver.php | 2 +-
lib/BitcoinTransaction.php | 3 +-
lib/Capability.php | 2 +-
lib/Card.php | 2 +-
lib/Charge.php | 2 +-
lib/Checkout/Session.php | 2 +-
lib/CountrySpec.php | 2 +-
lib/Coupon.php | 2 +-
lib/CreditNote.php | 2 +-
lib/CreditNoteLineItem.php | 3 +-
lib/Customer.php | 4 +-
lib/CustomerBalanceTransaction.php | 3 +-
lib/Dispute.php | 2 +-
lib/EphemeralKey.php | 6 +-
lib/Event.php | 2 +-
lib/ExchangeRate.php | 2 +-
lib/File.php | 2 +-
lib/FileLink.php | 2 +-
lib/Identity/VerificationReport.php | 2 +-
lib/Identity/VerificationSession.php | 2 +-
lib/Invoice.php | 3 +-
lib/InvoiceItem.php | 2 +-
lib/InvoiceLineItem.php | 3 +-
lib/Issuing/Authorization.php | 2 +-
lib/Issuing/Card.php | 2 +-
lib/Issuing/Cardholder.php | 2 +-
lib/Issuing/Dispute.php | 2 +-
lib/Issuing/Transaction.php | 2 +-
lib/LineItem.php | 2 +-
lib/LoginLink.php | 3 +-
lib/Mandate.php | 2 +-
lib/Order.php | 2 +-
lib/OrderReturn.php | 2 +-
lib/PaymentIntent.php | 4 +-
lib/PaymentLink.php | 3 +-
lib/PaymentMethod.php | 2 +-
lib/Payout.php | 2 +-
lib/Person.php | 2 +-
lib/Plan.php | 2 +-
lib/Price.php | 2 +-
lib/Product.php | 2 +-
lib/PromotionCode.php | 2 +-
lib/Quote.php | 4 +-
lib/Radar/EarlyFraudWarning.php | 2 +-
lib/Radar/ValueList.php | 2 +-
lib/Radar/ValueListItem.php | 2 +-
lib/Recipient.php | 2 +-
lib/Refund.php | 4 +-
lib/Reporting/ReportRun.php | 2 +-
lib/Reporting/ReportType.php | 2 +-
lib/Review.php | 2 +-
lib/SKU.php | 2 +-
lib/Service/AccountLinkService.php | 2 +-
lib/Service/AccountService.php | 2 +-
lib/Service/ApplePayDomainService.php | 2 +-
lib/Service/ApplicationFeeService.php | 2 +-
lib/Service/BalanceService.php | 2 +-
lib/Service/BalanceTransactionService.php | 2 +-
.../BillingPortalServiceFactory.php | 5 +-
.../BillingPortal/ConfigurationService.php | 4 +-
lib/Service/BillingPortal/SessionService.php | 2 +-
lib/Service/ChargeService.php | 2 +-
.../Checkout/CheckoutServiceFactory.php | 3 +-
lib/Service/Checkout/SessionService.php | 4 +-
lib/Service/CoreServiceFactory.php | 113 +-
lib/Service/CountrySpecService.php | 2 +-
lib/Service/CouponService.php | 2 +-
lib/Service/CreditNoteService.php | 4 +-
lib/Service/CustomerService.php | 4 +-
lib/Service/DisputeService.php | 2 +-
lib/Service/EphemeralKeyService.php | 2 +-
lib/Service/EventService.php | 2 +-
lib/Service/ExchangeRateService.php | 2 +-
lib/Service/FileLinkService.php | 2 +-
lib/Service/FileService.php | 2 +-
.../Identity/IdentityServiceFactory.php | 5 +-
.../Identity/VerificationReportService.php | 4 +-
.../Identity/VerificationSessionService.php | 4 +-
lib/Service/InvoiceItemService.php | 2 +-
lib/Service/InvoiceService.php | 2 +-
lib/Service/Issuing/AuthorizationService.php | 2 +-
lib/Service/Issuing/CardService.php | 2 +-
lib/Service/Issuing/CardholderService.php | 2 +-
lib/Service/Issuing/DisputeService.php | 2 +-
lib/Service/Issuing/IssuingServiceFactory.php | 11 +-
lib/Service/Issuing/TransactionService.php | 2 +-
lib/Service/MandateService.php | 2 +-
lib/Service/OrderReturnService.php | 2 +-
lib/Service/OrderService.php | 2 +-
lib/Service/PaymentIntentService.php | 2 +-
lib/Service/PaymentLinkService.php | 2 +-
lib/Service/PaymentMethodService.php | 4 +-
lib/Service/PayoutService.php | 2 +-
lib/Service/PlanService.php | 2 +-
lib/Service/PriceService.php | 2 +-
lib/Service/ProductService.php | 2 +-
lib/Service/PromotionCodeService.php | 2 +-
lib/Service/QuoteService.php | 12 +-
.../Radar/EarlyFraudWarningService.php | 2 +-
lib/Service/Radar/RadarServiceFactory.php | 7 +-
lib/Service/Radar/ValueListItemService.php | 2 +-
lib/Service/Radar/ValueListService.php | 2 +-
lib/Service/RefundService.php | 2 +-
lib/Service/Reporting/ReportRunService.php | 4 +-
lib/Service/Reporting/ReportTypeService.php | 4 +-
.../Reporting/ReportingServiceFactory.php | 5 +-
lib/Service/ReviewService.php | 2 +-
lib/Service/SetupAttemptService.php | 2 +-
lib/Service/SetupIntentService.php | 2 +-
lib/Service/ShippingRateService.php | 2 +-
.../Sigma/ScheduledQueryRunService.php | 2 +-
lib/Service/Sigma/SigmaServiceFactory.php | 3 +-
lib/Service/SkuService.php | 2 +-
lib/Service/SourceService.php | 2 +-
lib/Service/SubscriptionItemService.php | 2 +-
lib/Service/SubscriptionScheduleService.php | 2 +-
lib/Service/SubscriptionService.php | 2 +-
lib/Service/TaxCodeService.php | 2 +-
lib/Service/TaxRateService.php | 4 +-
.../Terminal/ConnectionTokenService.php | 2 +-
lib/Service/Terminal/LocationService.php | 2 +-
lib/Service/Terminal/ReaderService.php | 2 +-
.../Terminal/TerminalServiceFactory.php | 7 +-
lib/Service/TokenService.php | 2 +-
lib/Service/TopupService.php | 4 +-
lib/Service/TransferService.php | 2 +-
lib/Service/WebhookEndpointService.php | 2 +-
lib/SetupAttempt.php | 2 +-
lib/SetupIntent.php | 2 +-
lib/ShippingRate.php | 2 +-
lib/Sigma/ScheduledQueryRun.php | 2 +-
lib/Source.php | 2 +-
lib/StripeClient.php | 1 +
lib/Subscription.php | 3 +-
lib/SubscriptionItem.php | 2 +-
lib/SubscriptionSchedule.php | 2 +-
lib/TaxCode.php | 2 +-
lib/TaxId.php | 2 +-
lib/TaxRate.php | 2 +-
lib/Terminal/ConnectionToken.php | 2 +-
lib/Terminal/Location.php | 2 +-
lib/Terminal/Reader.php | 2 +-
lib/ThreeDSecure.php | 2 +-
lib/Token.php | 2 +-
lib/Topup.php | 2 +-
lib/Transfer.php | 2 +-
lib/TransferReversal.php | 3 +-
lib/UsageRecord.php | 3 +-
lib/UsageRecordSummary.php | 3 +-
lib/Util/ObjectTypes.php | 196 +-
lib/WebhookEndpoint.php | 2 +-
tests/Stripe/GeneratedExamplesTest.php | 5123 +++++++++--------
163 files changed, 3058 insertions(+), 2785 deletions(-)
diff --git a/init.php b/init.php
index 798bb586f..d4606acfb 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;
}
}
@@ -212,7 +213,6 @@ public function reject($params = null, $opts = null)
return $this;
}
-
/*
* Capabilities methods
* We can not add the capabilities() method today as the Account object already has a
diff --git a/lib/AccountLink.php b/lib/AccountLink.php
index 259588100..24a9e68aa 100644
--- a/lib/AccountLink.php
+++ b/lib/AccountLink.php
@@ -1,4 +1,5 @@
_save($opts);
}
-
}
diff --git a/lib/Balance.php b/lib/Balance.php
index 428cec866..0fdc2850c 100644
--- a/lib/Balance.php
+++ b/lib/Balance.php
@@ -1,4 +1,5 @@
instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom(['discount' => null], $opts, true);
+
return $this;
}
/**
* @param null|array $params
* @param null|array|string $opts
+ * @param mixed $id
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
@@ -96,7 +99,6 @@ public static function allPaymentMethods($id, $params = null, $opts = null)
return $obj;
}
-
const PATH_BALANCE_TRANSACTIONS = '/balance_transactions';
/**
diff --git a/lib/CustomerBalanceTransaction.php b/lib/CustomerBalanceTransaction.php
index 6d6181984..8c306760d 100644
--- a/lib/CustomerBalanceTransaction.php
+++ b/lib/CustomerBalanceTransaction.php
@@ -1,4 +1,5 @@
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\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Account|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
+ * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
* @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
* @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
* @property string $status Status of this PaymentIntent, one of requires_payment_method
, requires_confirmation
, requires_action
, processing
, requires_capture
, canceled
, or succeeded
. Read more about each PaymentIntent status.
@@ -123,5 +124,4 @@ public function confirm($params = null, $opts = null)
return $this;
}
-
}
diff --git a/lib/PaymentLink.php b/lib/PaymentLink.php
index 862cf922b..c0399fe2c 100644
--- a/lib/PaymentLink.php
+++ b/lib/PaymentLink.php
@@ -1,4 +1,5 @@
request('post', '/v1/account_links', $params, $opts);
}
-
}
diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php
index 1fea1e384..28d094ec2 100644
--- a/lib/Service/AccountService.php
+++ b/lib/Service/AccountService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/ApplePayDomainService.php b/lib/Service/ApplePayDomainService.php
index 84675d668..6577b6b62 100644
--- a/lib/Service/ApplePayDomainService.php
+++ b/lib/Service/ApplePayDomainService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/ApplicationFeeService.php b/lib/Service/ApplicationFeeService.php
index 55f4f0a5e..c05c3cd59 100644
--- a/lib/Service/ApplicationFeeService.php
+++ b/lib/Service/ApplicationFeeService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts);
}
-
}
diff --git a/lib/Service/BalanceService.php b/lib/Service/BalanceService.php
index 79da649b4..0f55385f1 100644
--- a/lib/Service/BalanceService.php
+++ b/lib/Service/BalanceService.php
@@ -1,4 +1,5 @@
request('get', '/v1/balance', $params, $opts);
}
-
}
diff --git a/lib/Service/BalanceTransactionService.php b/lib/Service/BalanceTransactionService.php
index 46d880200..fb1da5018 100644
--- a/lib/Service/BalanceTransactionService.php
+++ b/lib/Service/BalanceTransactionService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/BillingPortal/BillingPortalServiceFactory.php b/lib/Service/BillingPortal/BillingPortalServiceFactory.php
index 91e569288..23a4d30b2 100644
--- a/lib/Service/BillingPortal/BillingPortalServiceFactory.php
+++ b/lib/Service/BillingPortal/BillingPortalServiceFactory.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 e9f9a1fd9..5a0d70db7 100644
--- a/lib/Service/BillingPortal/ConfigurationService.php
+++ b/lib/Service/BillingPortal/ConfigurationService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/BillingPortal/SessionService.php b/lib/Service/BillingPortal/SessionService.php
index 588e78c66..6b3e60263 100644
--- a/lib/Service/BillingPortal/SessionService.php
+++ b/lib/Service/BillingPortal/SessionService.php
@@ -1,4 +1,5 @@
request('post', '/v1/billing_portal/sessions', $params, $opts);
}
-
}
diff --git a/lib/Service/ChargeService.php b/lib/Service/ChargeService.php
index 87ac426e8..f8960edfb 100644
--- a/lib/Service/ChargeService.php
+++ b/lib/Service/ChargeService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Checkout/CheckoutServiceFactory.php b/lib/Service/Checkout/CheckoutServiceFactory.php
index 64993f805..bb26a837f 100644
--- a/lib/Service/Checkout/CheckoutServiceFactory.php
+++ b/lib/Service/Checkout/CheckoutServiceFactory.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 daa3c5b6e..b42ab8a17 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.
@@ -88,5 +89,4 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/CoreServiceFactory.php b/lib/Service/CoreServiceFactory.php
index 036ca3ae7..edaadd3fa 100644
--- a/lib/Service/CoreServiceFactory.php
+++ b/lib/Service/CoreServiceFactory.php
@@ -1,4 +1,5 @@
*/
private static $classMap = [
- 'accountLinks' => AccountLinkService::class,
- 'accounts' => AccountService::class,
- 'applePayDomains' => ApplePayDomainService::class,
- 'applicationFees' => ApplicationFeeService::class,
- 'balance' => BalanceService::class,
- 'balanceTransactions' => BalanceTransactionService::class,
- 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class,
- 'charges' => ChargeService::class,
- 'checkout' => Checkout\CheckoutServiceFactory::class,
- 'countrySpecs' => CountrySpecService::class,
- 'coupons' => CouponService::class,
- 'creditNotes' => CreditNoteService::class,
- 'customers' => CustomerService::class,
- 'disputes' => DisputeService::class,
- 'ephemeralKeys' => EphemeralKeyService::class,
- 'events' => EventService::class,
- 'exchangeRates' => ExchangeRateService::class,
- 'fileLinks' => FileLinkService::class,
- 'files' => FileService::class,
- 'identity' => Identity\IdentityServiceFactory::class,
- 'invoiceItems' => InvoiceItemService::class,
- 'invoices' => InvoiceService::class,
- 'issuing' => Issuing\IssuingServiceFactory::class,
- 'mandates' => MandateService::class,
- 'oauth' => OAuthService::class,
- 'orderReturns' => OrderReturnService::class,
- 'orders' => OrderService::class,
- 'paymentIntents' => PaymentIntentService::class,
- 'paymentLinks' => PaymentLinkService::class,
- 'paymentMethods' => PaymentMethodService::class,
- 'payouts' => PayoutService::class,
- 'plans' => PlanService::class,
- 'prices' => PriceService::class,
- 'products' => ProductService::class,
- 'promotionCodes' => PromotionCodeService::class,
- 'quotes' => QuoteService::class,
- 'radar' => Radar\RadarServiceFactory::class,
- 'refunds' => RefundService::class,
- 'reporting' => Reporting\ReportingServiceFactory::class,
- 'reviews' => ReviewService::class,
- 'setupAttempts' => SetupAttemptService::class,
- 'setupIntents' => SetupIntentService::class,
- 'shippingRates' => ShippingRateService::class,
- 'sigma' => Sigma\SigmaServiceFactory::class,
- 'skus' => SkuService::class,
- 'sources' => SourceService::class,
- 'subscriptionItems' => SubscriptionItemService::class,
- 'subscriptions' => SubscriptionService::class,
- 'subscriptionSchedules' => SubscriptionScheduleService::class,
- 'taxCodes' => TaxCodeService::class,
- 'taxRates' => TaxRateService::class,
- 'terminal' => Terminal\TerminalServiceFactory::class,
- 'tokens' => TokenService::class,
- 'topups' => TopupService::class,
- 'transfers' => TransferService::class,
- 'webhookEndpoints' => WebhookEndpointService::class,
+ 'accountLinks' => AccountLinkService::class,
+ 'accounts' => AccountService::class,
+ 'applePayDomains' => ApplePayDomainService::class,
+ 'applicationFees' => ApplicationFeeService::class,
+ 'balance' => BalanceService::class,
+ 'balanceTransactions' => BalanceTransactionService::class,
+ 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class,
+ 'charges' => ChargeService::class,
+ 'checkout' => Checkout\CheckoutServiceFactory::class,
+ 'countrySpecs' => CountrySpecService::class,
+ 'coupons' => CouponService::class,
+ 'creditNotes' => CreditNoteService::class,
+ 'customers' => CustomerService::class,
+ 'disputes' => DisputeService::class,
+ 'ephemeralKeys' => EphemeralKeyService::class,
+ 'events' => EventService::class,
+ 'exchangeRates' => ExchangeRateService::class,
+ 'fileLinks' => FileLinkService::class,
+ 'files' => FileService::class,
+ 'identity' => Identity\IdentityServiceFactory::class,
+ 'invoiceItems' => InvoiceItemService::class,
+ 'invoices' => InvoiceService::class,
+ 'issuing' => Issuing\IssuingServiceFactory::class,
+ 'mandates' => MandateService::class,
+ 'oauth' => OAuthService::class,
+ 'orderReturns' => OrderReturnService::class,
+ 'orders' => OrderService::class,
+ 'paymentIntents' => PaymentIntentService::class,
+ 'paymentLinks' => PaymentLinkService::class,
+ 'paymentMethods' => PaymentMethodService::class,
+ 'payouts' => PayoutService::class,
+ 'plans' => PlanService::class,
+ 'prices' => PriceService::class,
+ 'products' => ProductService::class,
+ 'promotionCodes' => PromotionCodeService::class,
+ 'quotes' => QuoteService::class,
+ 'radar' => Radar\RadarServiceFactory::class,
+ 'refunds' => RefundService::class,
+ 'reporting' => Reporting\ReportingServiceFactory::class,
+ 'reviews' => ReviewService::class,
+ 'setupAttempts' => SetupAttemptService::class,
+ 'setupIntents' => SetupIntentService::class,
+ 'shippingRates' => ShippingRateService::class,
+ 'sigma' => Sigma\SigmaServiceFactory::class,
+ 'skus' => SkuService::class,
+ 'sources' => SourceService::class,
+ 'subscriptionItems' => SubscriptionItemService::class,
+ 'subscriptions' => SubscriptionService::class,
+ 'subscriptionSchedules' => SubscriptionScheduleService::class,
+ 'taxCodes' => TaxCodeService::class,
+ 'taxRates' => TaxRateService::class,
+ 'terminal' => Terminal\TerminalServiceFactory::class,
+ 'tokens' => TokenService::class,
+ 'topups' => TopupService::class,
+ 'transfers' => TransferService::class,
+ 'webhookEndpoints' => WebhookEndpointService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/CountrySpecService.php b/lib/Service/CountrySpecService.php
index 3b5d43fd5..573444fd3 100644
--- a/lib/Service/CountrySpecService.php
+++ b/lib/Service/CountrySpecService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/CouponService.php b/lib/Service/CouponService.php
index 76bf0a90d..82a880f53 100644
--- a/lib/Service/CouponService.php
+++ b/lib/Service/CouponService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/CreditNoteService.php b/lib/Service/CreditNoteService.php
index 1a3dd0998..23681402e 100644
--- a/lib/Service/CreditNoteService.php
+++ b/lib/Service/CreditNoteService.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
@@ -152,5 +153,4 @@ public function voidCreditNote($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php
index f9aa98b41..c05633cde 100644
--- a/lib/Service/CustomerService.php
+++ b/lib/Service/CustomerService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts);
}
-
}
diff --git a/lib/Service/DisputeService.php b/lib/Service/DisputeService.php
index 4dcbefc8a..4eb1542bf 100644
--- a/lib/Service/DisputeService.php
+++ b/lib/Service/DisputeService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/EphemeralKeyService.php b/lib/Service/EphemeralKeyService.php
index ab496fd3f..3ca14c904 100644
--- a/lib/Service/EphemeralKeyService.php
+++ b/lib/Service/EphemeralKeyService.php
@@ -1,4 +1,5 @@
request('post', '/v1/ephemeral_keys', $params, $opts);
}
-
}
diff --git a/lib/Service/EventService.php b/lib/Service/EventService.php
index c589717d6..430b35abf 100644
--- a/lib/Service/EventService.php
+++ b/lib/Service/EventService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/ExchangeRateService.php b/lib/Service/ExchangeRateService.php
index 543f55182..fc78410c7 100644
--- a/lib/Service/ExchangeRateService.php
+++ b/lib/Service/ExchangeRateService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/FileLinkService.php b/lib/Service/FileLinkService.php
index 238b016e4..7a3a435dd 100644
--- a/lib/Service/FileLinkService.php
+++ b/lib/Service/FileLinkService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php
index 5c59ab9f1..148428849 100644
--- a/lib/Service/FileService.php
+++ b/lib/Service/FileService.php
@@ -1,4 +1,5 @@
request('post', '/v1/files', $flatParams, $opts);
}
-
}
diff --git a/lib/Service/Identity/IdentityServiceFactory.php b/lib/Service/Identity/IdentityServiceFactory.php
index 86778ea1d..cf6314628 100644
--- a/lib/Service/Identity/IdentityServiceFactory.php
+++ b/lib/Service/Identity/IdentityServiceFactory.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 09a678a02..0393cd565 100644
--- a/lib/Service/Identity/VerificationReportService.php
+++ b/lib/Service/Identity/VerificationReportService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Identity/VerificationSessionService.php b/lib/Service/Identity/VerificationSessionService.php
index 793ceefbd..1a763bef3 100644
--- a/lib/Service/Identity/VerificationSessionService.php
+++ b/lib/Service/Identity/VerificationSessionService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/InvoiceItemService.php b/lib/Service/InvoiceItemService.php
index ada3b4c92..0f0b9e91f 100644
--- a/lib/Service/InvoiceItemService.php
+++ b/lib/Service/InvoiceItemService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/InvoiceService.php b/lib/Service/InvoiceService.php
index f15914b76..4e2efe696 100644
--- a/lib/Service/InvoiceService.php
+++ b/lib/Service/InvoiceService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Issuing/AuthorizationService.php b/lib/Service/Issuing/AuthorizationService.php
index 1ad04b32b..6fff70e7e 100644
--- a/lib/Service/Issuing/AuthorizationService.php
+++ b/lib/Service/Issuing/AuthorizationService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Issuing/CardService.php b/lib/Service/Issuing/CardService.php
index 2d9214664..346d54afa 100644
--- a/lib/Service/Issuing/CardService.php
+++ b/lib/Service/Issuing/CardService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Issuing/CardholderService.php b/lib/Service/Issuing/CardholderService.php
index e228463c7..5731b1bf1 100644
--- a/lib/Service/Issuing/CardholderService.php
+++ b/lib/Service/Issuing/CardholderService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Issuing/DisputeService.php b/lib/Service/Issuing/DisputeService.php
index 242292d0b..ab5df5f3e 100644
--- a/lib/Service/Issuing/DisputeService.php
+++ b/lib/Service/Issuing/DisputeService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Issuing/IssuingServiceFactory.php b/lib/Service/Issuing/IssuingServiceFactory.php
index f6cd75961..a8d5d0f81 100644
--- a/lib/Service/Issuing/IssuingServiceFactory.php
+++ b/lib/Service/Issuing/IssuingServiceFactory.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 15e024afa..8fb0ee2ac 100644
--- a/lib/Service/Issuing/TransactionService.php
+++ b/lib/Service/Issuing/TransactionService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/MandateService.php b/lib/Service/MandateService.php
index eea044d7e..156bff0a0 100644
--- a/lib/Service/MandateService.php
+++ b/lib/Service/MandateService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/OrderReturnService.php b/lib/Service/OrderReturnService.php
index c2dc541ff..6183166c5 100644
--- a/lib/Service/OrderReturnService.php
+++ b/lib/Service/OrderReturnService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/OrderService.php b/lib/Service/OrderService.php
index ff1dc397a..fa658fa7b 100644
--- a/lib/Service/OrderService.php
+++ b/lib/Service/OrderService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PaymentIntentService.php b/lib/Service/PaymentIntentService.php
index 6fb229232..912cec14d 100644
--- a/lib/Service/PaymentIntentService.php
+++ b/lib/Service/PaymentIntentService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PaymentLinkService.php b/lib/Service/PaymentLinkService.php
index ea92ada83..323d997b7 100644
--- a/lib/Service/PaymentLinkService.php
+++ b/lib/Service/PaymentLinkService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/payment_links/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PaymentMethodService.php b/lib/Service/PaymentMethodService.php
index 089f12bf7..e7f341a0b 100644
--- a/lib/Service/PaymentMethodService.php
+++ b/lib/Service/PaymentMethodService.php
@@ -1,4 +1,5 @@
List a Customer’s
- * PaymentMethods
+ * PaymentMethods.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
@@ -125,5 +126,4 @@ public function update($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PayoutService.php b/lib/Service/PayoutService.php
index 379110c6c..547e22da6 100644
--- a/lib/Service/PayoutService.php
+++ b/lib/Service/PayoutService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PlanService.php b/lib/Service/PlanService.php
index 0f9e5cd11..16625d27a 100644
--- a/lib/Service/PlanService.php
+++ b/lib/Service/PlanService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PriceService.php b/lib/Service/PriceService.php
index bc832e943..cc44f69c9 100644
--- a/lib/Service/PriceService.php
+++ b/lib/Service/PriceService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/ProductService.php b/lib/Service/ProductService.php
index f5362271c..850cea56f 100644
--- a/lib/Service/ProductService.php
+++ b/lib/Service/ProductService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/PromotionCodeService.php b/lib/Service/PromotionCodeService.php
index 1b6ec631c..e4c3d202a 100644
--- a/lib/Service/PromotionCodeService.php
+++ b/lib/Service/PromotionCodeService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/QuoteService.php b/lib/Service/QuoteService.php
index 280112cb2..96f12a5c3 100644
--- a/lib/Service/QuoteService.php
+++ b/lib/Service/QuoteService.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 bf27457a4..7b0973483 100644
--- a/lib/Service/Radar/EarlyFraudWarningService.php
+++ b/lib/Service/Radar/EarlyFraudWarningService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Radar/RadarServiceFactory.php b/lib/Service/Radar/RadarServiceFactory.php
index 2305ce475..b093c6717 100644
--- a/lib/Service/Radar/RadarServiceFactory.php
+++ b/lib/Service/Radar/RadarServiceFactory.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 1dff63e4a..89eba2a7a 100644
--- a/lib/Service/Radar/ValueListItemService.php
+++ b/lib/Service/Radar/ValueListItemService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Radar/ValueListService.php b/lib/Service/Radar/ValueListService.php
index ce21935e2..64ac2ee79 100644
--- a/lib/Service/Radar/ValueListService.php
+++ b/lib/Service/Radar/ValueListService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/RefundService.php b/lib/Service/RefundService.php
index 861220b3b..49b4267e4 100644
--- a/lib/Service/RefundService.php
+++ b/lib/Service/RefundService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Reporting/ReportRunService.php b/lib/Service/Reporting/ReportRunService.php
index f71fb9db4..692420cd4 100644
--- a/lib/Service/Reporting/ReportRunService.php
+++ b/lib/Service/Reporting/ReportRunService.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
@@ -51,5 +52,4 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Reporting/ReportTypeService.php b/lib/Service/Reporting/ReportTypeService.php
index 48b499673..e1b4ea521 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
@@ -36,5 +37,4 @@ public function retrieve($id, $params = null, $opts = null)
{
return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts);
}
-
}
diff --git a/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 99aa7fc3e..ea152f23e 100644
--- a/lib/Service/ReviewService.php
+++ b/lib/Service/ReviewService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/SetupAttemptService.php b/lib/Service/SetupAttemptService.php
index f8e6af81f..7376ea13e 100644
--- a/lib/Service/SetupAttemptService.php
+++ b/lib/Service/SetupAttemptService.php
@@ -1,4 +1,5 @@
requestCollection('get', '/v1/setup_attempts', $params, $opts);
}
-
}
diff --git a/lib/Service/SetupIntentService.php b/lib/Service/SetupIntentService.php
index caa0d83f8..3cbec506f 100644
--- a/lib/Service/SetupIntentService.php
+++ b/lib/Service/SetupIntentService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/ShippingRateService.php b/lib/Service/ShippingRateService.php
index d95b5106b..d7b55a8b3 100644
--- a/lib/Service/ShippingRateService.php
+++ b/lib/Service/ShippingRateService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/shipping_rates/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Sigma/ScheduledQueryRunService.php b/lib/Service/Sigma/ScheduledQueryRunService.php
index d39bd4dfd..92641751b 100644
--- a/lib/Service/Sigma/ScheduledQueryRunService.php
+++ b/lib/Service/Sigma/ScheduledQueryRunService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Sigma/SigmaServiceFactory.php b/lib/Service/Sigma/SigmaServiceFactory.php
index 0c7d5e582..356750f47 100644
--- a/lib/Service/Sigma/SigmaServiceFactory.php
+++ b/lib/Service/Sigma/SigmaServiceFactory.php
@@ -1,4 +1,5 @@
*/
private static $classMap = [
- 'scheduledQueryRuns' => ScheduledQueryRunService::class,
+ 'scheduledQueryRuns' => ScheduledQueryRunService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/SkuService.php b/lib/Service/SkuService.php
index d675d9446..8934f2064 100644
--- a/lib/Service/SkuService.php
+++ b/lib/Service/SkuService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/SourceService.php b/lib/Service/SourceService.php
index 177fc359e..c6cc05964 100644
--- a/lib/Service/SourceService.php
+++ b/lib/Service/SourceService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/SubscriptionItemService.php b/lib/Service/SubscriptionItemService.php
index fcd6245a3..3b2aa2b12 100644
--- a/lib/Service/SubscriptionItemService.php
+++ b/lib/Service/SubscriptionItemService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/SubscriptionScheduleService.php b/lib/Service/SubscriptionScheduleService.php
index a79829f49..9eed46060 100644
--- a/lib/Service/SubscriptionScheduleService.php
+++ b/lib/Service/SubscriptionScheduleService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php
index 2016500a7..f3ac768c8 100644
--- a/lib/Service/SubscriptionService.php
+++ b/lib/Service/SubscriptionService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/TaxCodeService.php b/lib/Service/TaxCodeService.php
index edea8514d..007b77136 100644
--- a/lib/Service/TaxCodeService.php
+++ b/lib/Service/TaxCodeService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/TaxRateService.php b/lib/Service/TaxRateService.php
index 3e2ba167b..7cee1fead 100644
--- a/lib/Service/TaxRateService.php
+++ b/lib/Service/TaxRateService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Terminal/ConnectionTokenService.php b/lib/Service/Terminal/ConnectionTokenService.php
index 6be12add5..7b25b2315 100644
--- a/lib/Service/Terminal/ConnectionTokenService.php
+++ b/lib/Service/Terminal/ConnectionTokenService.php
@@ -1,4 +1,5 @@
request('post', '/v1/terminal/connection_tokens', $params, $opts);
}
-
}
diff --git a/lib/Service/Terminal/LocationService.php b/lib/Service/Terminal/LocationService.php
index c1ae02631..5a217bea4 100644
--- a/lib/Service/Terminal/LocationService.php
+++ b/lib/Service/Terminal/LocationService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Terminal/ReaderService.php b/lib/Service/Terminal/ReaderService.php
index a36064fc6..765015c83 100644
--- a/lib/Service/Terminal/ReaderService.php
+++ b/lib/Service/Terminal/ReaderService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/Terminal/TerminalServiceFactory.php b/lib/Service/Terminal/TerminalServiceFactory.php
index 48aea405d..c70ac873b 100644
--- a/lib/Service/Terminal/TerminalServiceFactory.php
+++ b/lib/Service/Terminal/TerminalServiceFactory.php
@@ -1,4 +1,5 @@
*/
private static $classMap = [
- 'connectionTokens' => ConnectionTokenService::class,
- 'locations' => LocationService::class,
- 'readers' => ReaderService::class,
+ 'connectionTokens' => ConnectionTokenService::class,
+ 'locations' => LocationService::class,
+ 'readers' => ReaderService::class,
];
protected function getServiceClass($name)
diff --git a/lib/Service/TokenService.php b/lib/Service/TokenService.php
index f50c511a8..1c72759f6 100644
--- a/lib/Service/TokenService.php
+++ b/lib/Service/TokenService.php
@@ -1,4 +1,5 @@
request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/TopupService.php b/lib/Service/TopupService.php
index d71279129..059dc2090 100644
--- a/lib/Service/TopupService.php
+++ b/lib/Service/TopupService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/Service/TransferService.php b/lib/Service/TransferService.php
index 3a2f184e1..150bbf731 100644
--- a/lib/Service/TransferService.php
+++ b/lib/Service/TransferService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
}
-
}
diff --git a/lib/Service/WebhookEndpointService.php b/lib/Service/WebhookEndpointService.php
index ac7988461..01e642249 100644
--- a/lib/Service/WebhookEndpointService.php
+++ b/lib/Service/WebhookEndpointService.php
@@ -1,4 +1,5 @@
request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts);
}
-
}
diff --git a/lib/SetupAttempt.php b/lib/SetupAttempt.php
index e7dd51867..6c83b686c 100644
--- a/lib/SetupAttempt.php
+++ b/lib/SetupAttempt.php
@@ -1,4 +1,5 @@
instanceUrl() . '/discount';
list($response, $opts) = $this->_request('delete', $url, $params, $opts);
$this->refreshFrom(['discount' => null], $opts, true);
+
return $this;
}
-
}
diff --git a/lib/SubscriptionItem.php b/lib/SubscriptionItem.php
index 7aeb9eac7..5bd25b252 100644
--- a/lib/SubscriptionItem.php
+++ b/lib/SubscriptionItem.php
@@ -1,4 +1,5 @@
_save($opts);
}
-
}
diff --git a/lib/UsageRecord.php b/lib/UsageRecord.php
index 564dd8ecd..552298276 100644
--- a/lib/UsageRecord.php
+++ b/lib/UsageRecord.php
@@ -1,4 +1,5 @@
\Stripe\Account::class,
- \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class,
- \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class,
- \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class,
- \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class,
- \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class,
- \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class,
- \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class,
- \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class,
- \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class,
- \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class,
- \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class,
- \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class,
- \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class,
- \Stripe\Card::OBJECT_NAME => \Stripe\Card::class,
- \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class,
- \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class,
- \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class,
- \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class,
- \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class,
- \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class,
- \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class,
- \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class,
- \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class,
- \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class,
- \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class,
- \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class,
- \Stripe\Event::OBJECT_NAME => \Stripe\Event::class,
- \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class,
- \Stripe\File::OBJECT_NAME => \Stripe\File::class,
- \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class,
- \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class,
- \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class,
- \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class,
- \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class,
- \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class,
- \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class,
- \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class,
- \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class,
- \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class,
- \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class,
- \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,
- \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class,
- \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class,
- \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class,
- \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class,
- \Stripe\Order::OBJECT_NAME => \Stripe\Order::class,
- \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class,
- \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class,
- \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class,
- \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class,
- \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,
- \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
- \Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
- \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class,
- \Stripe\Price::OBJECT_NAME => \Stripe\Price::class,
- \Stripe\Product::OBJECT_NAME => \Stripe\Product::class,
- \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class,
- \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class,
- \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class,
- \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class,
- \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class,
- \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class,
- \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class,
- \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class,
- \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
- \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
- \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
- \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class,
- \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
- \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class,
- \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
- \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
- \Stripe\Source::OBJECT_NAME => \Stripe\Source::class,
- \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class,
- \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
- \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
- \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
- \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
- \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
- \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
- \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
- \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class,
- \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class,
- \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class,
- \Stripe\Token::OBJECT_NAME => \Stripe\Token::class,
- \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class,
- \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class,
- \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class,
- \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class,
- \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class,
- \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class,
- ];
+ /**
+ * @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\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class,
+ \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class,
+ \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class,
+ \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class,
+ \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class,
+ \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class,
+ \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class,
+ \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class,
+ \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class,
+ \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class,
+ \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class,
+ \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class,
+ \Stripe\Card::OBJECT_NAME => \Stripe\Card::class,
+ \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class,
+ \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class,
+ \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class,
+ \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class,
+ \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class,
+ \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class,
+ \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class,
+ \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class,
+ \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class,
+ \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class,
+ \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class,
+ \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class,
+ \Stripe\Event::OBJECT_NAME => \Stripe\Event::class,
+ \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class,
+ \Stripe\File::OBJECT_NAME => \Stripe\File::class,
+ \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class,
+ \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class,
+ \Stripe\Identity\VerificationReport::OBJECT_NAME => \Stripe\Identity\VerificationReport::class,
+ \Stripe\Identity\VerificationSession::OBJECT_NAME => \Stripe\Identity\VerificationSession::class,
+ \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class,
+ \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class,
+ \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class,
+ \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class,
+ \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class,
+ \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class,
+ \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class,
+ \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class,
+ \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class,
+ \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class,
+ \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class,
+ \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class,
+ \Stripe\Order::OBJECT_NAME => \Stripe\Order::class,
+ \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class,
+ \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class,
+ \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class,
+ \Stripe\PaymentLink::OBJECT_NAME => \Stripe\PaymentLink::class,
+ \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class,
+ \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class,
+ \Stripe\Person::OBJECT_NAME => \Stripe\Person::class,
+ \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class,
+ \Stripe\Price::OBJECT_NAME => \Stripe\Price::class,
+ \Stripe\Product::OBJECT_NAME => \Stripe\Product::class,
+ \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class,
+ \Stripe\Quote::OBJECT_NAME => \Stripe\Quote::class,
+ \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class,
+ \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class,
+ \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class,
+ \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class,
+ \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class,
+ \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class,
+ \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
+ \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
+ \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
+ \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class,
+ \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
+ \Stripe\ShippingRate::OBJECT_NAME => \Stripe\ShippingRate::class,
+ \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
+ \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
+ \Stripe\Source::OBJECT_NAME => \Stripe\Source::class,
+ \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class,
+ \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class,
+ \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class,
+ \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class,
+ \Stripe\TaxCode::OBJECT_NAME => \Stripe\TaxCode::class,
+ \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class,
+ \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class,
+ \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class,
+ \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class,
+ \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class,
+ \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class,
+ \Stripe\Token::OBJECT_NAME => \Stripe\Token::class,
+ \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class,
+ \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class,
+ \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class,
+ \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class,
+ \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class,
+ \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class,
+ ];
}
diff --git a/lib/WebhookEndpoint.php b/lib/WebhookEndpoint.php
index b7cf80c94..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 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 testRetrieveBalanceTransaction()
- {
- $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx');
- $result = $this->client->balanceTransactions->retrieve(
- 'txn_xxxxxxxxxxxxx',
- []
- );
- static::assertInstanceOf(\Stripe\BalanceTransaction::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 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 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 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 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 testDeleteCustomer()
- {
- $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx');
- $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Customer::class, $result);
- }
- 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 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 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 testRetrieveEvent()
- {
- $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx');
- $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Event::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 testRetrieveFile()
- {
- $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx');
- $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\File::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 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 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 testRetrieveMandate()
- {
- $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx');
- $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Mandate::class, $result);
- }
- public function testCreatePaymentIntent()
- {
- $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 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 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 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 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 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 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 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 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 testListSetupAttempt()
- {
- $this->expectsRequest('get', '/v1/setup_attempts');
- $result = $this->client->setupAttempts->all(
- ['setup_intent' => 'seti_xxxxxxxxxxxxx', 'limit' => 3]
- );
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\SetupAttempt::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 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 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 testCreateProduct()
- {
- $this->expectsRequest('post', '/v1/products');
- $result = $this->client->products->create(['name' => 'Gold Special']);
- 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 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 testDeleteProduct()
- {
- $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx');
- $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Product::class, $result);
- }
- public function testCreatePrice()
- {
- $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 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 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 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 testCreateToken()
- {
- $this->expectsRequest('post', '/v1/tokens');
- $result = $this->client->tokens->create(
- [
- 'card' => [
- 'number' => '4242424242424242',
- 'exp_month' => '5',
- 'exp_year' => '2022',
- 'cvc' => '314',
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Token::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 testCreatePaymentMethod()
- {
- $this->expectsRequest('post', '/v1/payment_methods');
- $result = $this->client->paymentMethods->create(
- [
- 'type' => 'card',
- 'card' => [
- 'number' => '4242424242424242',
- 'exp_month' => 5,
- 'exp_year' => 2022,
- '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 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 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 testRetrieveSource()
- {
- $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 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',
- 'payment_method_types' => ['card'],
- 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]],
- 'mode' => 'payment',
- ]
- );
- static::assertInstanceOf(\Stripe\Checkout\Session::class, $result);
- }
- public function testRetrieveSession()
- {
- $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 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 testCreateCoupon()
- {
- $this->expectsRequest('post', '/v1/coupons');
- $result = $this->client->coupons->create(
- [
- 'percent_off' => 25,
- 'duration' => 'repeating',
- 'duration_in_months' => 3,
- ]
- );
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
- public function testRetrieveCoupon()
- {
- $this->expectsRequest('get', '/v1/coupons/25_5OFF');
- $result = $this->client->coupons->retrieve('25_5OFF', []);
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
- public function testUpdateCoupon()
- {
- $this->expectsRequest('post', '/v1/coupons/co_xxxxxxxxxxxxx');
- $result = $this->client->coupons->update(
- 'co_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\Coupon::class, $result);
- }
- public function testDeleteCoupon()
- {
- $this->expectsRequest('delete', '/v1/coupons/co_xxxxxxxxxxxxx');
- $result = $this->client->coupons->delete('co_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Coupon::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 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 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 testRetrieveCreditNote()
- {
- $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
- $result = $this->client->creditNotes->retrieve('cn_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\CreditNote::class, $result);
- }
- public function testUpdateCreditNote()
- {
- $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
- $result = $this->client->creditNotes->update(
- 'cn_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- 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 testPreviewCreditNote2()
- {
- $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 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 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 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 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 testCreateSession2()
- {
- $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 testUpdateConfiguration()
- {
- $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 testRetrieveConfiguration()
- {
- $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 testListConfiguration()
- {
- $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 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 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 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 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 testCreateInvoice()
- {
- $this->expectsRequest('post', '/v1/invoices');
- $result = $this->client->invoices->create(
- ['customer' => 'cus_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 testDeleteInvoice()
- {
- $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx');
- $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []);
- 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 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 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 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 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 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 testDeleteInvoiceItem()
- {
- $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx');
- $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\InvoiceItem::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 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 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 testDeletePlan()
- {
- $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx');
- $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Plan::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 testCreatePromotionCode()
- {
- $this->expectsRequest('post', '/v1/promotion_codes');
- $result = $this->client->promotionCodes->create(['coupon' => '25_5OFF']);
- 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 testRetrievePromotionCode()
- {
- $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx');
- $result = $this->client->promotionCodes->retrieve(
- 'promo_xxxxxxxxxxxxx',
- []
- );
- static::assertInstanceOf(\Stripe\PromotionCode::class, $result);
- }
- 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 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 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 testCancelSubscription()
- {
- $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx');
- $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Subscription::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 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 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 testDeleteSubscriptionItem()
- {
- $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx');
- $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SubscriptionItem::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 testCreateSubscriptionSchedule()
- {
- $this->expectsRequest('post', '/v1/subscription_schedules');
- $result = $this->client->subscriptionSchedules->create(
- [
- 'customer' => 'cus_xxxxxxxxxxxxx',
- 'start_date' => 1620753115,
- '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 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 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 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 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 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 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 testRetrieveAccount()
- {
- $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 testDeleteAccount()
- {
- $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx');
- $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []);
- 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 testListAccount()
- {
- $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 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 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 testRetrieveApplicationFee()
- {
- $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx');
- $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\ApplicationFee::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 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 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 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 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 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 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 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 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 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 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 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 testCancelTopup()
- {
- $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel');
- $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Topup::class, $result);
- }
- 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 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 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 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 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 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 testApproveReview()
- {
- $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve');
- $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Review::class, $result);
- }
- 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 testUpdateDispute2()
- {
- $this->expectsRequest('post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx');
- $result = $this->client->issuing->disputes->update(
- 'idp_xxxxxxxxxxxxx',
- [
- 'evidence' => [
- 'reason' => 'not_received',
- 'not_received' => [
- 'expected_at' => 1590000000,
- 'explanation' => '',
- 'product_description' => 'Baseball cap',
- 'product_type' => 'merchandise',
- ],
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Issuing\Dispute::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 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 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 testCreateConnectionToken()
- {
- $this->expectsRequest('post', '/v1/terminal/connection_tokens');
- $result = $this->client->terminal->connectionTokens->create([]);
- static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result);
- }
- 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 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 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 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 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 testRetrieveReader()
- {
- $this->expectsRequest('get', '/v1/terminal/readers/tmr_P400-123-456-789');
- $result = $this->client->terminal->readers->retrieve(
- 'tmr_P400-123-456-789',
- []
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
- }
- public function testUpdateReader()
- {
- $this->expectsRequest('post', '/v1/terminal/readers/tmr_P400-123-456-789');
- $result = $this->client->terminal->readers->update(
- 'tmr_P400-123-456-789',
- ['label' => 'Blue Rabbit']
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
- }
- public function testDeleteReader()
- {
- $this->expectsRequest(
- 'delete',
- '/v1/terminal/readers/tmr_P400-123-456-789'
- );
- $result = $this->client->terminal->readers->delete(
- 'tmr_P400-123-456-789',
- []
- );
- static::assertInstanceOf(\Stripe\Terminal\Reader::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 testCreateOrder()
- {
- $this->expectsRequest('post', '/v1/orders');
- $result = $this->client->orders->create(
- [
- 'currency' => 'usd',
- 'email' => 'jenny.rosen@example.com',
- 'items' => [['type' => 'sku', 'parent' => 'sku_xxxxxxxxxxxxx']],
- 'shipping' => [
- 'name' => 'Jenny Rosen',
- 'address' => [
- 'line1' => '1234 Main Street',
- 'city' => 'San Francisco',
- 'state' => 'CA',
- 'country' => 'US',
- 'postal_code' => '94111',
- ],
- ],
- ]
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
- public function testRetrieveOrder()
- {
- $this->expectsRequest('get', '/v1/orders/or_xxxxxxxxxxxxx');
- $result = $this->client->orders->retrieve('or_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
- public function testUpdateOrder()
- {
- $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx');
- $result = $this->client->orders->update(
- 'or_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
- public function testPayOrder()
- {
- $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx/pay');
- $result = $this->client->orders->pay(
- 'or_xxxxxxxxxxxxx',
- ['source' => 'tok_xxxx']
- );
- static::assertInstanceOf(\Stripe\Order::class, $result);
- }
- public function testListOrder()
- {
- $this->expectsRequest('get', '/v1/orders');
- $result = $this->client->orders->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\Order::class, $result->data[0]);
- }
- public function testRetrieveOrderReturn()
- {
- $this->expectsRequest('get', '/v1/order_returns/orret_xxxxxxxxxxxxx');
- $result = $this->client->orderReturns->retrieve('orret_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\OrderReturn::class, $result);
- }
- public function testListOrderReturn()
- {
- $this->expectsRequest('get', '/v1/order_returns');
- $result = $this->client->orderReturns->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\OrderReturn::class, $result->data[0]);
- }
- public function testCreateSku()
- {
- $this->expectsRequest('post', '/v1/skus');
- $result = $this->client->skus->create(
- [
- 'attributes' => ['size' => 'Medium', 'gender' => 'Unisex'],
- 'price' => 1500,
- 'currency' => 'usd',
- 'inventory' => ['type' => 'finite', 'quantity' => 500],
- 'product' => 'prod_xxxxxxxxxxxxx',
- ]
- );
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
- public function testRetrieveSku()
- {
- $this->expectsRequest('get', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->retrieve('sku_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
- public function testUpdateSku()
- {
- $this->expectsRequest('post', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->update(
- 'sku_xxxxxxxxxxxxx',
- ['metadata' => ['order_id' => '6735']]
- );
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
- public function testListSku()
- {
- $this->expectsRequest('get', '/v1/skus');
- $result = $this->client->skus->all(['limit' => 3]);
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\SKU::class, $result->data[0]);
- }
- public function testDeleteSku()
- {
- $this->expectsRequest('delete', '/v1/skus/sku_xxxxxxxxxxxxx');
- $result = $this->client->skus->delete('sku_xxxxxxxxxxxxx', []);
- static::assertInstanceOf(\Stripe\SKU::class, $result);
- }
- 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 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 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 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 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 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 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);
- }
- 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 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 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 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 testCreateSession3()
- {
- $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 testCreatePaymentIntent2()
- {
- $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 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 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 testRetrievePaymentLink()
- {
- $this->expectsRequest('get', '/v1/payment_links/pl_xyz');
- $result = $this->client->paymentLinks->retrieve('pl_xyz', []);
- static::assertInstanceOf(\Stripe\PaymentLink::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 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 testRetrieveBalanceTransaction()
+ {
+ $this->expectsRequest('get', '/v1/balance_transactions/txn_xxxxxxxxxxxxx');
+ $result = $this->client->balanceTransactions->retrieve(
+ 'txn_xxxxxxxxxxxxx',
+ []
+ );
+ static::assertInstanceOf(\Stripe\BalanceTransaction::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 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 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 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 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 testDeleteCustomer()
+ {
+ $this->expectsRequest('delete', '/v1/customers/cus_xxxxxxxxxxxxx');
+ $result = $this->client->customers->delete('cus_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Customer::class, $result);
+ }
+
+ 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 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 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 testRetrieveEvent()
+ {
+ $this->expectsRequest('get', '/v1/events/evt_xxxxxxxxxxxxx');
+ $result = $this->client->events->retrieve('evt_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Event::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 testRetrieveFile()
+ {
+ $this->expectsRequest('get', '/v1/files/file_xxxxxxxxxxxxx');
+ $result = $this->client->files->retrieve('file_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\File::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 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 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 testRetrieveMandate()
+ {
+ $this->expectsRequest('get', '/v1/mandates/mandate_xxxxxxxxxxxxx');
+ $result = $this->client->mandates->retrieve('mandate_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Mandate::class, $result);
+ }
+
+ public function testCreatePaymentIntent()
+ {
+ $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 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 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 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 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 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 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 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 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 testListSetupAttempt()
+ {
+ $this->expectsRequest('get', '/v1/setup_attempts');
+ $result = $this->client->setupAttempts->all(
+ ['setup_intent' => 'seti_xxxxxxxxxxxxx', 'limit' => 3]
+ );
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\SetupAttempt::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 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 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 testCreateProduct()
+ {
+ $this->expectsRequest('post', '/v1/products');
+ $result = $this->client->products->create(['name' => 'Gold Special']);
+ 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 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 testDeleteProduct()
+ {
+ $this->expectsRequest('delete', '/v1/products/prod_xxxxxxxxxxxxx');
+ $result = $this->client->products->delete('prod_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Product::class, $result);
+ }
+
+ public function testCreatePrice()
+ {
+ $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 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 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 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 testCreateToken()
+ {
+ $this->expectsRequest('post', '/v1/tokens');
+ $result = $this->client->tokens->create(
+ [
+ 'card' => [
+ 'number' => '4242424242424242',
+ 'exp_month' => '5',
+ 'exp_year' => '2022',
+ 'cvc' => '314',
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Token::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 testCreatePaymentMethod()
+ {
+ $this->expectsRequest('post', '/v1/payment_methods');
+ $result = $this->client->paymentMethods->create(
+ [
+ 'type' => 'card',
+ 'card' => [
+ 'number' => '4242424242424242',
+ 'exp_month' => 5,
+ 'exp_year' => 2022,
+ '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 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 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 testRetrieveSource()
+ {
+ $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 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',
+ 'payment_method_types' => ['card'],
+ 'line_items' => [['price' => 'price_xxxxxxxxxxxxx', 'quantity' => 2]],
+ 'mode' => 'payment',
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Checkout\Session::class, $result);
+ }
+
+ public function testRetrieveSession()
+ {
+ $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 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 testCreateCoupon()
+ {
+ $this->expectsRequest('post', '/v1/coupons');
+ $result = $this->client->coupons->create(
+ [
+ 'percent_off' => 25,
+ 'duration' => 'repeating',
+ 'duration_in_months' => 3,
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+
+ public function testRetrieveCoupon()
+ {
+ $this->expectsRequest('get', '/v1/coupons/25_5OFF');
+ $result = $this->client->coupons->retrieve('25_5OFF', []);
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+
+ public function testUpdateCoupon()
+ {
+ $this->expectsRequest('post', '/v1/coupons/co_xxxxxxxxxxxxx');
+ $result = $this->client->coupons->update(
+ 'co_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\Coupon::class, $result);
+ }
+
+ public function testDeleteCoupon()
+ {
+ $this->expectsRequest('delete', '/v1/coupons/co_xxxxxxxxxxxxx');
+ $result = $this->client->coupons->delete('co_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Coupon::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 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 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 testRetrieveCreditNote()
+ {
+ $this->expectsRequest('get', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
+ $result = $this->client->creditNotes->retrieve('cn_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\CreditNote::class, $result);
+ }
+
+ public function testUpdateCreditNote()
+ {
+ $this->expectsRequest('post', '/v1/credit_notes/cn_xxxxxxxxxxxxx');
+ $result = $this->client->creditNotes->update(
+ 'cn_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ 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 testPreviewCreditNote2()
+ {
+ $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 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 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 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 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 testCreateSession2()
+ {
+ $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 testUpdateConfiguration()
+ {
+ $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 testRetrieveConfiguration()
+ {
+ $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 testListConfiguration()
+ {
+ $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 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 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 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 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 testCreateInvoice()
+ {
+ $this->expectsRequest('post', '/v1/invoices');
+ $result = $this->client->invoices->create(
+ ['customer' => 'cus_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 testDeleteInvoice()
+ {
+ $this->expectsRequest('delete', '/v1/invoices/in_xxxxxxxxxxxxx');
+ $result = $this->client->invoices->delete('in_xxxxxxxxxxxxx', []);
+ 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 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 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 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 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 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 testDeleteInvoiceItem()
+ {
+ $this->expectsRequest('delete', '/v1/invoiceitems/ii_xxxxxxxxxxxxx');
+ $result = $this->client->invoiceItems->delete('ii_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\InvoiceItem::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 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 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 testDeletePlan()
+ {
+ $this->expectsRequest('delete', '/v1/plans/price_xxxxxxxxxxxxx');
+ $result = $this->client->plans->delete('price_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Plan::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 testCreatePromotionCode()
+ {
+ $this->expectsRequest('post', '/v1/promotion_codes');
+ $result = $this->client->promotionCodes->create(['coupon' => '25_5OFF']);
+ 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 testRetrievePromotionCode()
+ {
+ $this->expectsRequest('get', '/v1/promotion_codes/promo_xxxxxxxxxxxxx');
+ $result = $this->client->promotionCodes->retrieve(
+ 'promo_xxxxxxxxxxxxx',
+ []
+ );
+ static::assertInstanceOf(\Stripe\PromotionCode::class, $result);
+ }
+
+ 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 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 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 testCancelSubscription()
+ {
+ $this->expectsRequest('delete', '/v1/subscriptions/sub_xxxxxxxxxxxxx');
+ $result = $this->client->subscriptions->cancel('sub_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Subscription::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 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 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 testDeleteSubscriptionItem()
+ {
+ $this->expectsRequest('delete', '/v1/subscription_items/si_xxxxxxxxxxxxx');
+ $result = $this->client->subscriptionItems->delete('si_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SubscriptionItem::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 testCreateSubscriptionSchedule()
+ {
+ $this->expectsRequest('post', '/v1/subscription_schedules');
+ $result = $this->client->subscriptionSchedules->create(
+ [
+ 'customer' => 'cus_xxxxxxxxxxxxx',
+ 'start_date' => 1620753115,
+ '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 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 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 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 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 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 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 testRetrieveAccount()
+ {
+ $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 testDeleteAccount()
+ {
+ $this->expectsRequest('delete', '/v1/accounts/acct_xxxxxxxxxxxxx');
+ $result = $this->client->accounts->delete('acct_xxxxxxxxxxxxx', []);
+ 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 testListAccount()
+ {
+ $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 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 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 testRetrieveApplicationFee()
+ {
+ $this->expectsRequest('get', '/v1/application_fees/fee_xxxxxxxxxxxxx');
+ $result = $this->client->applicationFees->retrieve('fee_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\ApplicationFee::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 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 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 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 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 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 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 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 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 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 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 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 testCancelTopup()
+ {
+ $this->expectsRequest('post', '/v1/topups/tu_xxxxxxxxxxxxx/cancel');
+ $result = $this->client->topups->cancel('tu_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Topup::class, $result);
+ }
+
+ 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 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 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 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 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 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 testApproveReview()
+ {
+ $this->expectsRequest('post', '/v1/reviews/prv_xxxxxxxxxxxxx/approve');
+ $result = $this->client->reviews->approve('prv_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Review::class, $result);
+ }
+
+ 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 testUpdateDispute2()
+ {
+ $this->expectsRequest('post', '/v1/issuing/disputes/idp_xxxxxxxxxxxxx');
+ $result = $this->client->issuing->disputes->update(
+ 'idp_xxxxxxxxxxxxx',
+ [
+ 'evidence' => [
+ 'reason' => 'not_received',
+ 'not_received' => [
+ 'expected_at' => 1590000000,
+ 'explanation' => '',
+ 'product_description' => 'Baseball cap',
+ 'product_type' => 'merchandise',
+ ],
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Dispute::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 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 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 testCreateConnectionToken()
+ {
+ $this->expectsRequest('post', '/v1/terminal/connection_tokens');
+ $result = $this->client->terminal->connectionTokens->create([]);
+ static::assertInstanceOf(\Stripe\Terminal\ConnectionToken::class, $result);
+ }
+
+ 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 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 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 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 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 testRetrieveReader()
+ {
+ $this->expectsRequest('get', '/v1/terminal/readers/tmr_P400-123-456-789');
+ $result = $this->client->terminal->readers->retrieve(
+ 'tmr_P400-123-456-789',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
+ }
+
+ public function testUpdateReader()
+ {
+ $this->expectsRequest('post', '/v1/terminal/readers/tmr_P400-123-456-789');
+ $result = $this->client->terminal->readers->update(
+ 'tmr_P400-123-456-789',
+ ['label' => 'Blue Rabbit']
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::class, $result);
+ }
+
+ public function testDeleteReader()
+ {
+ $this->expectsRequest(
+ 'delete',
+ '/v1/terminal/readers/tmr_P400-123-456-789'
+ );
+ $result = $this->client->terminal->readers->delete(
+ 'tmr_P400-123-456-789',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Terminal\Reader::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 testCreateOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders');
+ $result = $this->client->orders->create(
+ [
+ 'currency' => 'usd',
+ 'email' => 'jenny.rosen@example.com',
+ 'items' => [['type' => 'sku', 'parent' => 'sku_xxxxxxxxxxxxx']],
+ 'shipping' => [
+ 'name' => 'Jenny Rosen',
+ 'address' => [
+ 'line1' => '1234 Main Street',
+ 'city' => 'San Francisco',
+ 'state' => 'CA',
+ 'country' => 'US',
+ 'postal_code' => '94111',
+ ],
+ ],
+ ]
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+
+ public function testRetrieveOrder()
+ {
+ $this->expectsRequest('get', '/v1/orders/or_xxxxxxxxxxxxx');
+ $result = $this->client->orders->retrieve('or_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+
+ public function testUpdateOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx');
+ $result = $this->client->orders->update(
+ 'or_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+
+ public function testPayOrder()
+ {
+ $this->expectsRequest('post', '/v1/orders/or_xxxxxxxxxxxxx/pay');
+ $result = $this->client->orders->pay(
+ 'or_xxxxxxxxxxxxx',
+ ['source' => 'tok_xxxx']
+ );
+ static::assertInstanceOf(\Stripe\Order::class, $result);
+ }
+
+ public function testListOrder()
+ {
+ $this->expectsRequest('get', '/v1/orders');
+ $result = $this->client->orders->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\Order::class, $result->data[0]);
+ }
+
+ public function testRetrieveOrderReturn()
+ {
+ $this->expectsRequest('get', '/v1/order_returns/orret_xxxxxxxxxxxxx');
+ $result = $this->client->orderReturns->retrieve('orret_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\OrderReturn::class, $result);
+ }
+
+ public function testListOrderReturn()
+ {
+ $this->expectsRequest('get', '/v1/order_returns');
+ $result = $this->client->orderReturns->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\OrderReturn::class, $result->data[0]);
+ }
+
+ public function testCreateSku()
+ {
+ $this->expectsRequest('post', '/v1/skus');
+ $result = $this->client->skus->create(
+ [
+ 'attributes' => ['size' => 'Medium', 'gender' => 'Unisex'],
+ 'price' => 1500,
+ 'currency' => 'usd',
+ 'inventory' => ['type' => 'finite', 'quantity' => 500],
+ 'product' => 'prod_xxxxxxxxxxxxx',
+ ]
+ );
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+
+ public function testRetrieveSku()
+ {
+ $this->expectsRequest('get', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->retrieve('sku_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+
+ public function testUpdateSku()
+ {
+ $this->expectsRequest('post', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->update(
+ 'sku_xxxxxxxxxxxxx',
+ ['metadata' => ['order_id' => '6735']]
+ );
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+
+ public function testListSku()
+ {
+ $this->expectsRequest('get', '/v1/skus');
+ $result = $this->client->skus->all(['limit' => 3]);
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\SKU::class, $result->data[0]);
+ }
+
+ public function testDeleteSku()
+ {
+ $this->expectsRequest('delete', '/v1/skus/sku_xxxxxxxxxxxxx');
+ $result = $this->client->skus->delete('sku_xxxxxxxxxxxxx', []);
+ static::assertInstanceOf(\Stripe\SKU::class, $result);
+ }
+
+ 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 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 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 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 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 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 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);
+ }
+
+ 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 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 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 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 testCreateSession3()
+ {
+ $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 testCreatePaymentIntent2()
+ {
+ $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 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 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 testRetrievePaymentLink()
+ {
+ $this->expectsRequest('get', '/v1/payment_links/pl_xyz');
+ $result = $this->client->paymentLinks->retrieve('pl_xyz', []);
+ static::assertInstanceOf(\Stripe\PaymentLink::class, $result);
+ }
+}