From 6935728d87858c96c5d99ac858eab135ac2d4046 Mon Sep 17 00:00:00 2001
From: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
Date: Wed, 6 Jul 2022 12:31:58 -0700
Subject: [PATCH] Codegen for openapi v162 (#1318)
---
OPENAPI_VERSION | 2 +-
lib/CashBalance.php | 2 +-
lib/Event.php | 5 +
lib/Service/CustomerService.php | 2 +-
tests/Stripe/GeneratedExamplesTest.php | 133 +++++++++++++------------
5 files changed, 79 insertions(+), 65 deletions(-)
diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION
index 515f433c0..b164d836d 100644
--- a/OPENAPI_VERSION
+++ b/OPENAPI_VERSION
@@ -1 +1 @@
-v161
\ No newline at end of file
+v162
\ No newline at end of file
diff --git a/lib/CashBalance.php b/lib/CashBalance.php
index c63f272f1..3e7396157 100644
--- a/lib/CashBalance.php
+++ b/lib/CashBalance.php
@@ -10,7 +10,7 @@
* for payment and can eventually be paid out to your bank account.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
- * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0.
+ * @property null|\Stripe\StripeObject $available A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the smallest currency unit.
* @property string $customer The ID of the customer whose cash balance this object represents.
* @property bool $livemode Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
* @property \Stripe\StripeObject $settings
diff --git a/lib/Event.php b/lib/Event.php
index 91a39dd6c..e4c2ce3eb 100644
--- a/lib/Event.php
+++ b/lib/Event.php
@@ -118,6 +118,11 @@ class Event extends ApiResource
const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
const CUSTOMER_UPDATED = 'customer.updated';
const FILE_CREATED = 'file.created';
+ const FINANCIAL_CONNECTIONS_ACCOUNT_CREATED = 'financial_connections.account.created';
+ const FINANCIAL_CONNECTIONS_ACCOUNT_DEACTIVATED = 'financial_connections.account.deactivated';
+ const FINANCIAL_CONNECTIONS_ACCOUNT_DISCONNECTED = 'financial_connections.account.disconnected';
+ const FINANCIAL_CONNECTIONS_ACCOUNT_REACTIVATED = 'financial_connections.account.reactivated';
+ const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_BALANCE = 'financial_connections.account.refreshed_balance';
const IDENTITY_VERIFICATION_SESSION_CANCELED = 'identity.verification_session.canceled';
const IDENTITY_VERIFICATION_SESSION_CREATED = 'identity.verification_session.created';
const IDENTITY_VERIFICATION_SESSION_PROCESSING = 'identity.verification_session.processing';
diff --git a/lib/Service/CustomerService.php b/lib/Service/CustomerService.php
index 0b717130e..f7a9980f2 100644
--- a/lib/Service/CustomerService.php
+++ b/lib/Service/CustomerService.php
@@ -410,7 +410,7 @@ public function updateBalanceTransaction($parentId, $id, $params = null, $opts =
}
/**
- * Updates a customer’s cash balance.
+ * Changes the settings on a customer’s cash balance.
*
* @param string $parentId
* @param null|array $params
diff --git a/tests/Stripe/GeneratedExamplesTest.php b/tests/Stripe/GeneratedExamplesTest.php
index cd511e19b..6a7e825e5 100644
--- a/tests/Stripe/GeneratedExamplesTest.php
+++ b/tests/Stripe/GeneratedExamplesTest.php
@@ -211,6 +211,15 @@ public function testRetrieveSession()
static::assertInstanceOf(\Stripe\FinancialConnections\Session::class, $result);
}
+ public function testUpcomingInvoice()
+ {
+ $this->expectsRequest('get', '/v1/invoices/upcoming');
+ $result = $this->client->invoices->upcoming(
+ ['customer' => 'cus_9utnxg47pWjV1e']
+ );
+ static::assertInstanceOf(\Stripe\Invoice::class, $result);
+ }
+
public function testCreateOrder()
{
$this->expectsRequest('post', '/v1/orders');
@@ -320,6 +329,16 @@ public function testListLineItemsPaymentLink()
static::assertInstanceOf(\Stripe\LineItem::class, $result->data[0]);
}
+ public function testListSetupAttempt()
+ {
+ $this->expectsRequest('get', '/v1/setup_attempts');
+ $result = $this->client->setupAttempts->all(
+ ['limit' => 3, 'setup_intent' => 'si_xyz']
+ );
+ static::assertInstanceOf(\Stripe\Collection::class, $result);
+ static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]);
+ }
+
public function testVerifyMicrodepositsSetupIntent()
{
$this->expectsRequest(
@@ -399,6 +418,58 @@ public function testFundCashBalanceCustomer()
static::assertInstanceOf(\Stripe\CustomerBalanceTransaction::class, $result);
}
+ public function testDeliverCardCard()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/cards/card_123/shipping/deliver'
+ );
+ $result = $this->client->testHelpers->issuing->cards->deliverCard(
+ 'card_123',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
+ }
+
+ public function testFailCardCard()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/cards/card_123/shipping/fail'
+ );
+ $result = $this->client->testHelpers->issuing->cards->failCard(
+ 'card_123',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
+ }
+
+ public function testReturnCardCard()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/cards/card_123/shipping/return'
+ );
+ $result = $this->client->testHelpers->issuing->cards->returnCard(
+ 'card_123',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
+ }
+
+ public function testShipCardCard()
+ {
+ $this->expectsRequest(
+ 'post',
+ '/v1/test_helpers/issuing/cards/card_123/shipping/ship'
+ );
+ $result = $this->client->testHelpers->issuing->cards->shipCard(
+ 'card_123',
+ []
+ );
+ static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
+ }
+
public function testExpireRefund()
{
$this->expectsRequest('post', '/v1/test_helpers/refunds/re_123/expire');
@@ -572,68 +643,6 @@ public function testCreateToken()
static::assertInstanceOf(\Stripe\Token::class, $result);
}
- public function testListSetupAttempt()
- {
- $this->expectsRequest('get', '/v1/setup_attempts');
- $result = $this->client->setupAttempts->all(
- ['limit' => 3, 'setup_intent' => 'si_xyz']
- );
- static::assertInstanceOf(\Stripe\Collection::class, $result);
- static::assertInstanceOf(\Stripe\SetupAttempt::class, $result->data[0]);
- }
-
- public function testDeliverCardCard()
- {
- $this->expectsRequest(
- 'post',
- '/v1/test_helpers/issuing/cards/card_123/shipping/deliver'
- );
- $result = $this->client->testHelpers->issuing->cards->deliverCard(
- 'card_123',
- []
- );
- static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
- }
-
- public function testFailCardCard()
- {
- $this->expectsRequest(
- 'post',
- '/v1/test_helpers/issuing/cards/card_123/shipping/fail'
- );
- $result = $this->client->testHelpers->issuing->cards->failCard(
- 'card_123',
- []
- );
- static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
- }
-
- public function testReturnCardCard()
- {
- $this->expectsRequest(
- 'post',
- '/v1/test_helpers/issuing/cards/card_123/shipping/return'
- );
- $result = $this->client->testHelpers->issuing->cards->returnCard(
- 'card_123',
- []
- );
- static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
- }
-
- public function testShipCardCard()
- {
- $this->expectsRequest(
- 'post',
- '/v1/test_helpers/issuing/cards/card_123/shipping/ship'
- );
- $result = $this->client->testHelpers->issuing->cards->shipCard(
- 'card_123',
- []
- );
- static::assertInstanceOf(\Stripe\Issuing\Card::class, $result);
- }
-
public function testCreateAccountLink()
{
$this->expectsRequest('post', '/v1/account_links');