Skip to content

Commit

Permalink
Update generated code for v1414
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Dec 16, 2024
1 parent 7dae4c6 commit 7b75a78
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1410
v1414
18 changes: 18 additions & 0 deletions lib/Service/Treasury/FinancialAccountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ public function all($params = null, $opts = null)
return $this->requestCollection('get', '/v1/treasury/financial_accounts', $params, $opts);
}

/**
* Closes a FinancialAccount. A FinancialAccount can only be closed if it has a
* zero balance, has no pending InboundTransfers, and has canceled all attached
* Issuing cards.
*
* @param string $id
* @param null|array $params
* @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Treasury\FinancialAccount
*/
public function close($id, $params = null, $opts = null)
{
return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s/close', $id), $params, $opts);
}

/**
* Creates a new FinancialAccount. For now, each connected account can only have
* one FinancialAccount.
Expand Down
19 changes: 19 additions & 0 deletions lib/Treasury/FinancialAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
* @property null|string $display_name The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the <code>nickname</code> field, <code>display_name</code> is not internal metadata and will be exposed to connected accounts.
* @property null|\Stripe\Treasury\FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a <code>status</code> enum and associated <code>status_details</code>. Stripe or the platform can control Features via the requested field.
* @property \Stripe\StripeObject[] $financial_addresses The set of credentials that resolve to a FinancialAccount.
* @property null|bool $is_default
* @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 null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|string $nickname The nickname for the FinancialAccount.
* @property null|string[] $pending_features The array of paths to pending Features in the Features hash.
* @property null|\Stripe\StripeObject $platform_restrictions The set of functionalities that the platform can restrict on the FinancialAccount.
* @property null|string[] $restricted_features The array of paths to restricted Features in the Features hash.
Expand Down Expand Up @@ -117,6 +119,23 @@ public static function update($id, $params = null, $opts = null)
return $obj;
}

/**
* @param null|array $params
* @param null|array|string $opts
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*
* @return \Stripe\Treasury\FinancialAccount the closed financial account
*/
public function close($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/close';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);

return $this;
}

/**
* @param null|array $params
* @param null|array|string $opts
Expand Down

0 comments on commit 7b75a78

Please sign in to comment.