Skip to content

Commit

Permalink
Codegen for openapi v162 (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe authored Jul 6, 2022
1 parent 55a8c0f commit 6935728
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 65 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v161
v162
2 changes: 1 addition & 1 deletion lib/CashBalance.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
* @property string $customer The ID of the customer whose cash balance this object represents.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
* @property \Stripe\StripeObject $settings
Expand Down
5 changes: 5 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
133 changes: 71 additions & 62 deletions tests/Stripe/GeneratedExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 6935728

Please sign in to comment.