Skip to content

Commit

Permalink
Codegen for openapi v223
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Feb 2, 2023
1 parent cf0d9a8 commit 02416a2
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v221
v223
3 changes: 3 additions & 0 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
require __DIR__ . '/lib/FinancialConnections/Account.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwner.php';
require __DIR__ . '/lib/FinancialConnections/AccountOwnership.php';
require __DIR__ . '/lib/FinancialConnections/InferredBalance.php';
require __DIR__ . '/lib/FinancialConnections/Session.php';
require __DIR__ . '/lib/FinancialConnections/Transaction.php';
require __DIR__ . '/lib/FundingInstructions.php';
require __DIR__ . '/lib/GiftCards/Card.php';
require __DIR__ . '/lib/GiftCards/Transaction.php';
Expand Down Expand Up @@ -223,6 +225,7 @@
require __DIR__ . '/lib/Service/FileLinkService.php';
require __DIR__ . '/lib/Service/FinancialConnections/AccountService.php';
require __DIR__ . '/lib/Service/FinancialConnections/SessionService.php';
require __DIR__ . '/lib/Service/FinancialConnections/TransactionService.php';
require __DIR__ . '/lib/Service/GiftCards/CardService.php';
require __DIR__ . '/lib/Service/GiftCards/TransactionService.php';
require __DIR__ . '/lib/Service/Identity/VerificationReportService.php';
Expand Down
4 changes: 4 additions & 0 deletions lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ class Event extends ApiResource
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 FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_INFERRED_BALANCES = 'financial_connections.account.refreshed_inferred_balances';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_OWNERSHIP = 'financial_connections.account.refreshed_ownership';
const FINANCIAL_CONNECTIONS_ACCOUNT_REFRESHED_TRANSACTIONS = 'financial_connections.account.refreshed_transactions';
const FINANCIAL_CONNECTIONS_SESSION_UPDATED = 'financial_connections.session.updated';
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
20 changes: 20 additions & 0 deletions lib/FinancialConnections/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @property string $category The type of the account. Account category is further divided in <code>subcategory</code>.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|string $display_name A human-readable name that has been assigned to this account, either by the account holder or by the institution.
* @property null|\Stripe\StripeObject $inferred_balances_refresh The state of the most recent attempt to refresh the account's inferred balance history.
* @property string $institution_name The name of the institution that holds this account.
* @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters.
* @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
Expand All @@ -24,13 +25,16 @@
* @property null|string[] $permissions The list of permissions granted by this account.
* @property string $status The status of the link to the account.
* @property string $subcategory <p>If <code>category</code> is <code>cash</code>, one of:</p><p>- <code>checking</code> - <code>savings</code> - <code>other</code></p><p>If <code>category</code> is <code>credit</code>, one of:</p><p>- <code>mortgage</code> - <code>line_of_credit</code> - <code>credit_card</code> - <code>other</code></p><p>If <code>category</code> is <code>investment</code> or <code>other</code>, this will be <code>other</code>.</p>
* @property null|string[] $subscriptions The list of data refresh subscriptions requested on this account.
* @property string[] $supported_payment_method_types The <a href="https://stripe.com/docs/api/payment_methods/object#payment_method_object-type">PaymentMethod type</a>(s) that can be created from this account.
* @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions.
*/
class Account extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account';

use \Stripe\ApiOperations\All;
use \Stripe\ApiOperations\NestedResource;
use \Stripe\ApiOperations\Retrieve;

const CATEGORY_CASH = 'cash';
Expand Down Expand Up @@ -101,4 +105,20 @@ public function refreshAccount($params = null, $opts = null)

return $this;
}

const PATH_INFERRED_BALANCES = '/inferred_balances';

/**
* @param string $id the ID of the account on which to retrieve the financial connections account inferred balances
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\FinancialConnectionsAccountInferredBalance> the list of financial connections account inferred balances
*/
public static function allInferredBalances($id, $params = null, $opts = null)
{
return self::_allNestedResources($id, static::PATH_INFERRED_BALANCES, $params, $opts);
}
}
22 changes: 22 additions & 0 deletions lib/FinancialConnections/InferredBalance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\FinancialConnections;

/**
* A historical balance for the account on a particular day. It may be sourced from
* a balance snapshot provided by a financial institution, or inferred using
* transactions data.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $as_of The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC.
* @property \Stripe\StripeObject $current <p>The balances owed to (or by) the account holder.</p><p>Each key is a three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.</p><p>Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.</p>
*/
class InferredBalance extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.account_inferred_balance';

use \Stripe\ApiOperations\All;
}
9 changes: 9 additions & 0 deletions lib/FinancialConnections/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@
* @property string $client_secret A value that will be passed to the client to launch the authentication flow.
* @property \Stripe\StripeObject $filters
* @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 $manual_entry
* @property string[] $permissions Permissions requested for accounts collected during this session.
* @property null|string[] $prefetch Data features requested to be retrieved upon account creation.
* @property string $return_url For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
* @property string $status The current state of the session.
* @property \Stripe\StripeObject $status_details
*/
class Session extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.session';

use \Stripe\ApiOperations\Create;
use \Stripe\ApiOperations\Retrieve;

const STATUS_CANCELLED = 'cancelled';
const STATUS_FAILED = 'failed';
const STATUS_PENDING = 'pending';
const STATUS_SUCCEEDED = 'succeeded';
}
33 changes: 33 additions & 0 deletions lib/FinancialConnections/Transaction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\FinancialConnections;

/**
* A Transaction represents a real transaction that affects a Financial Connections
* Account balance.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property string $account The ID of the Financial Connections Account this transaction belongs to.
* @property int $amount The amount of this transaction, in %s.
* @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
* @property string $description The description of this transaction.
* @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 string $status The status of the transaction.
* @property \Stripe\StripeObject $status_transitions
* @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch.
* @property string $transaction_refresh The transaction_refresh object that last updated or created this transaction.
* @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
*/
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'financial_connections.transaction';

use \Stripe\ApiOperations\All;

const STATUS_PENDING = 'pending';
const STATUS_POSTED = 'posted';
const STATUS_VOID = 'void';
}
17 changes: 17 additions & 0 deletions lib/Service/FinancialConnections/AccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ public function all($params = null, $opts = null)
return $this->requestCollection('get', '/v1/financial_connections/accounts', $params, $opts);
}

/**
* Lists the recorded inferred balances for a Financial Connections
* <code>Account</code>.
*
* @param string $parentId
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\InferredBalance>
*/
public function allInferredBalances($parentId, $params = null, $opts = null)
{
return $this->requestCollection('get', $this->buildPath('/v1/financial_connections/accounts/%s/inferred_balances', $parentId), $params, $opts);
}

/**
* Lists all owners for a given <code>Account</code>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
* @property AccountService $accounts
* @property SessionService $sessions
* @property TransactionService $transactions
*/
class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractServiceFactory
{
Expand All @@ -18,6 +19,7 @@ class FinancialConnectionsServiceFactory extends \Stripe\Service\AbstractService
private static $classMap = [
'accounts' => AccountService::class,
'sessions' => SessionService::class,
'transactions' => TransactionService::class,
];

protected function getServiceClass($name)
Expand Down
23 changes: 23 additions & 0 deletions lib/Service/FinancialConnections/TransactionService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

// File generated from our OpenAPI spec

namespace Stripe\Service\FinancialConnections;

class TransactionService extends \Stripe\Service\AbstractService
{
/**
* Returns a list of Financial Connections <code>Transaction</code> objects.
*
* @param null|array $params
* @param null|array|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction>
*/
public function all($params = null, $opts = null)
{
return $this->requestCollection('get', '/v1/financial_connections/transactions', $params, $opts);
}
}
2 changes: 2 additions & 0 deletions lib/Util/ObjectTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class ObjectTypes
\Stripe\FinancialConnections\Account::OBJECT_NAME => \Stripe\FinancialConnections\Account::class,
\Stripe\FinancialConnections\AccountOwner::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwner::class,
\Stripe\FinancialConnections\AccountOwnership::OBJECT_NAME => \Stripe\FinancialConnections\AccountOwnership::class,
\Stripe\FinancialConnections\InferredBalance::OBJECT_NAME => \Stripe\FinancialConnections\InferredBalance::class,
\Stripe\FinancialConnections\Session::OBJECT_NAME => \Stripe\FinancialConnections\Session::class,
\Stripe\FinancialConnections\Transaction::OBJECT_NAME => \Stripe\FinancialConnections\Transaction::class,
\Stripe\FundingInstructions::OBJECT_NAME => \Stripe\FundingInstructions::class,
\Stripe\GiftCards\Card::OBJECT_NAME => \Stripe\GiftCards\Card::class,
\Stripe\GiftCards\Transaction::OBJECT_NAME => \Stripe\GiftCards\Transaction::class,
Expand Down

0 comments on commit 02416a2

Please sign in to comment.