| 1 |
<?php |
| 2 |
|
| 3 |
// File generated from our OpenAPI spec |
| 4 |
|
| 5 |
namespace Stripe\FinancialConnections; |
| 6 |
|
| 7 |
/** |
| 8 |
* A Financial Connections Account represents an account that exists outside of |
| 9 |
* Stripe, to which you have been granted some degree of access. |
| 10 |
* |
| 11 |
* @property string $id Unique identifier for the object. |
| 12 |
* @property string $object String representing the object's type. Objects of the same type share the same value. |
| 13 |
* @property null|\Stripe\StripeObject $account_holder The account holder that this account belongs to. |
| 14 |
* @property null|\Stripe\StripeObject $balance The most recent information about the account's balance. |
| 15 |
* @property null|\Stripe\StripeObject $balance_refresh The state of the most recent attempt to refresh the account balance. |
| 16 |
* @property string $category The type of the account. Account category is further divided in <code>subcategory</code>. |
| 17 |
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. |
| 18 |
* @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. |
| 19 |
* @property string $institution_name The name of the institution that holds this account. |
| 20 |
* @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters. |
| 21 |
* @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. |
| 22 |
* @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners. |
| 23 |
* @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners. |
| 24 |
* @property null|string[] $permissions The list of permissions granted by this account. |
| 25 |
* @property string $status The status of the link to the account. |
| 26 |
* @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> |
| 27 |
* @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. |
| 28 |
*/ |
| 29 |
class Account extends \Stripe\ApiResource |
| 30 |
{ |
| 31 |
const OBJECT_NAME = 'financial_connections.account'; |
| 32 |
|
| 33 |
use \Stripe\ApiOperations\Retrieve; |
| 34 |
|
| 35 |
const CATEGORY_CASH = 'cash'; |
| 36 |
const CATEGORY_CREDIT = 'credit'; |
| 37 |
const CATEGORY_INVESTMENT = 'investment'; |
| 38 |
const CATEGORY_OTHER = 'other'; |
| 39 |
|
| 40 |
const STATUS_ACTIVE = 'active'; |
| 41 |
const STATUS_DISCONNECTED = 'disconnected'; |
| 42 |
const STATUS_INACTIVE = 'inactive'; |
| 43 |
|
| 44 |
const SUBCATEGORY_CHECKING = 'checking'; |
| 45 |
const SUBCATEGORY_CREDIT_CARD = 'credit_card'; |
| 46 |
const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit'; |
| 47 |
const SUBCATEGORY_MORTGAGE = 'mortgage'; |
| 48 |
const SUBCATEGORY_OTHER = 'other'; |
| 49 |
const SUBCATEGORY_SAVINGS = 'savings'; |
| 50 |
|
| 51 |
/** |
| 52 |
* @param null|array $params |
| 53 |
* @param null|array|string $opts |
| 54 |
* |
| 55 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 56 |
* |
| 57 |
* @return \Stripe\FinancialConnections\Account the disconnected account |
| 58 |
*/ |
| 59 |
public function disconnect($params = null, $opts = null) |
| 60 |
{ |
| 61 |
$url = $this->instanceUrl() . '/disconnect'; |
| 62 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 63 |
$this->refreshFrom($response, $opts); |
| 64 |
|
| 65 |
return $this; |
| 66 |
} |
| 67 |
|
| 68 |
/** |
| 69 |
* @param null|array $params |
| 70 |
* @param null|array|string $opts |
| 71 |
* |
| 72 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 73 |
* |
| 74 |
* @return \Stripe\FinancialConnections\Account the refreshed account |
| 75 |
*/ |
| 76 |
public function refresh($params = null, $opts = null) |
| 77 |
{ |
| 78 |
$url = $this->instanceUrl() . '/refresh'; |
| 79 |
list($response, $opts) = $this->_request('post', $url, $params, $opts); |
| 80 |
$this->refreshFrom($response, $opts); |
| 81 |
|
| 82 |
return $this; |
| 83 |
} |
| 84 |
} |
| 85 |
|