• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / 9294314605

29 May 2024 11:10PM UTC coverage: 60.461% (-0.9%) from 61.377%
9294314605

Pull #1699

github

web-flow
Merge 5dab33188 into 3533dc330
Pull Request #1699: Update generated code for beta

1026 of 1732 new or added lines in 117 files covered. (59.24%)

15 existing lines in 3 files now uncovered.

3436 of 5683 relevant lines covered (60.46%)

2.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/FinancialConnections/Account.php
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 Stripe, to which you have been granted some degree of access.
9
 *
10
 * @property string $id Unique identifier for the object.
11
 * @property string $object String representing the object's type. Objects of the same type share the same value.
12
 * @property null|\Stripe\StripeObject $account_holder The account holder that this account belongs to.
13
 * @property null|\Stripe\StripeObject $balance The most recent information about the account's balance.
14
 * @property null|\Stripe\StripeObject $balance_refresh The state of the most recent attempt to refresh the account balance.
15
 * @property string $category The type of the account. Account category is further divided in <code>subcategory</code>.
16
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
17
 * @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.
18
 * @property null|\Stripe\StripeObject $inferred_balances_refresh The state of the most recent attempt to refresh the account's inferred balance history.
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 null|string[] $subscriptions The list of data refresh subscriptions requested on this account.
28
 * @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.
29
 * @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions.
30
 */
31
class Account extends \Stripe\ApiResource
32
{
33
    const OBJECT_NAME = 'financial_connections.account';
34

35
    use \Stripe\ApiOperations\NestedResource;
36

37
    const CATEGORY_CASH = 'cash';
38
    const CATEGORY_CREDIT = 'credit';
39
    const CATEGORY_INVESTMENT = 'investment';
40
    const CATEGORY_OTHER = 'other';
41

42
    const STATUS_ACTIVE = 'active';
43
    const STATUS_DISCONNECTED = 'disconnected';
44
    const STATUS_INACTIVE = 'inactive';
45

46
    const SUBCATEGORY_CHECKING = 'checking';
47
    const SUBCATEGORY_CREDIT_CARD = 'credit_card';
48
    const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit';
49
    const SUBCATEGORY_MORTGAGE = 'mortgage';
50
    const SUBCATEGORY_OTHER = 'other';
51
    const SUBCATEGORY_SAVINGS = 'savings';
52

53
    /**
54
     * Returns a list of Financial Connections <code>Account</code> objects.
55
     *
56
     * @param null|mixed $params
57
     * @param null|mixed $opts
58
     */
NEW
59
    public static function all($params = null, $opts = null)
×
60
    {
NEW
61
        return static::_requestPage('/v1/financial_connections/accounts', \Stripe\Collection::class, $params, $opts);
×
62
    }
63

64
    /**
65
     * Retrieves the details of an Financial Connections <code>Account</code>.
66
     *
67
     * @param mixed $id
68
     * @param null|mixed $opts
69
     */
NEW
70
    public static function retrieve($id, $opts = null)
×
71
    {
NEW
72
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
73
        $instance = new static($id, $opts);
×
NEW
74
        $instance->refresh();
×
75

NEW
76
        return $instance;
×
77
    }
78

79
    /**
80
     * @param null|array $params
81
     * @param null|array|string $opts
82
     *
83
     * @throws \Stripe\Exception\ApiErrorException if the request fails
84
     *
85
     * @return \Stripe\FinancialConnections\Account the disconnected account
86
     */
87
    public function disconnect($params = null, $opts = null)
×
88
    {
89
        $url = $this->instanceUrl() . '/disconnect';
×
90
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
91
        $this->refreshFrom($response, $opts);
×
92

93
        return $this;
×
94
    }
95

96
    /**
97
     * @param string $id
98
     * @param null|array $params
99
     * @param null|array|string $opts
100
     *
101
     * @throws \Stripe\Exception\ApiErrorException if the request fails
102
     *
103
     * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountOwner> list of account owners
104
     */
105
    public static function allOwners($id, $params = null, $opts = null)
×
106
    {
107
        $url = static::resourceUrl($id) . '/owners';
×
108
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
×
109
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
110
        $obj->setLastResponse($response);
×
111

112
        return $obj;
×
113
    }
114

115
    /**
116
     * @param null|array $params
117
     * @param null|array|string $opts
118
     *
119
     * @throws \Stripe\Exception\ApiErrorException if the request fails
120
     *
121
     * @return \Stripe\FinancialConnections\Account the refreshed account
122
     */
123
    public function refreshAccount($params = null, $opts = null)
×
124
    {
125
        $url = $this->instanceUrl() . '/refresh';
×
126
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
127
        $this->refreshFrom($response, $opts);
×
128

129
        return $this;
×
130
    }
131

132
    /**
133
     * @param null|array $params
134
     * @param null|array|string $opts
135
     *
136
     * @throws \Stripe\Exception\ApiErrorException if the request fails
137
     *
138
     * @return \Stripe\FinancialConnections\Account the subscribed account
139
     */
140
    public function subscribe($params = null, $opts = null)
×
141
    {
142
        $url = $this->instanceUrl() . '/subscribe';
×
143
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
144
        $this->refreshFrom($response, $opts);
×
145

146
        return $this;
×
147
    }
148

149
    /**
150
     * @param null|array $params
151
     * @param null|array|string $opts
152
     *
153
     * @throws \Stripe\Exception\ApiErrorException if the request fails
154
     *
155
     * @return \Stripe\FinancialConnections\Account the unsubscribed account
156
     */
157
    public function unsubscribe($params = null, $opts = null)
×
158
    {
159
        $url = $this->instanceUrl() . '/unsubscribe';
×
160
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
161
        $this->refreshFrom($response, $opts);
×
162

163
        return $this;
×
164
    }
165

166
    const PATH_INFERRED_BALANCES = '/inferred_balances';
167

168
    /**
169
     * @param string $id the ID of the account on which to retrieve the account inferred balances
170
     * @param null|array $params
171
     * @param null|array|string $opts
172
     *
173
     * @throws \Stripe\Exception\ApiErrorException if the request fails
174
     *
175
     * @return \Stripe\Collection<\Stripe\FinancialConnections\AccountInferredBalance> the list of account inferred balances
176
     */
177
    public static function allInferredBalances($id, $params = null, $opts = null)
×
178
    {
179
        return self::_allNestedResources($id, static::PATH_INFERRED_BALANCES, $params, $opts);
×
180
    }
181
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc