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

stripe / stripe-php / 9308192295

30 May 2024 07:35PM UTC coverage: 65.24% (-0.9%) from 66.176%
9308192295

Pull #1701

github

web-flow
Merge cd30bb2f4 into 901f195e4
Pull Request #1701: Demagiced crudl operation

1080 of 1682 new or added lines in 106 files covered. (64.21%)

15 existing lines in 3 files now uncovered.

3444 of 5279 relevant lines covered (65.24%)

2.29 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 string $institution_name The name of the institution that holds this account.
19
 * @property null|string $last4 The last 4 digits of the account number. If present, this will be 4 numeric characters.
20
 * @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.
21
 * @property null|string|\Stripe\FinancialConnections\AccountOwnership $ownership The most recent information about the account's owners.
22
 * @property null|\Stripe\StripeObject $ownership_refresh The state of the most recent attempt to refresh the account owners.
23
 * @property null|string[] $permissions The list of permissions granted by this account.
24
 * @property string $status The status of the link to the account.
25
 * @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>
26
 * @property null|string[] $subscriptions The list of data refresh subscriptions requested on this account.
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
 * @property null|\Stripe\StripeObject $transaction_refresh The state of the most recent attempt to refresh the account transactions.
29
 */
30
class Account extends \Stripe\ApiResource
31
{
32
    const OBJECT_NAME = 'financial_connections.account';
33

34
    const CATEGORY_CASH = 'cash';
35
    const CATEGORY_CREDIT = 'credit';
36
    const CATEGORY_INVESTMENT = 'investment';
37
    const CATEGORY_OTHER = 'other';
38

39
    const STATUS_ACTIVE = 'active';
40
    const STATUS_DISCONNECTED = 'disconnected';
41
    const STATUS_INACTIVE = 'inactive';
42

43
    const SUBCATEGORY_CHECKING = 'checking';
44
    const SUBCATEGORY_CREDIT_CARD = 'credit_card';
45
    const SUBCATEGORY_LINE_OF_CREDIT = 'line_of_credit';
46
    const SUBCATEGORY_MORTGAGE = 'mortgage';
47
    const SUBCATEGORY_OTHER = 'other';
48
    const SUBCATEGORY_SAVINGS = 'savings';
49

50
    /**
51
     * Returns a list of Financial Connections <code>Account</code> objects.
52
     *
53
     * @param null|array $params
54
     * @param null|array|string $opts
55
     *
56
     * @throws \Stripe\Exception\ApiErrorException if the request fails
57
     *
58
     * @return \Stripe\Collection<\Stripe\FinancialConnections\Account> of ApiResources
59
     */
NEW
60
    public static function all($params = null, $opts = null)
×
61
    {
NEW
62
        $url = static::classUrl();
×
63

NEW
64
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
65
    }
66

67
    /**
68
     * Retrieves the details of an Financial Connections <code>Account</code>.
69
     *
70
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
71
     * @param null|array|string $opts
72
     *
73
     * @throws \Stripe\Exception\ApiErrorException if the request fails
74
     *
75
     * @return \Stripe\FinancialConnections\Account
76
     */
NEW
77
    public static function retrieve($id, $opts = null)
×
78
    {
NEW
79
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
80
        $instance = new static($id, $opts);
×
NEW
81
        $instance->refresh();
×
82

NEW
83
        return $instance;
×
84
    }
85

86
    /**
87
     * @param null|array $params
88
     * @param null|array|string $opts
89
     *
90
     * @throws \Stripe\Exception\ApiErrorException if the request fails
91
     *
92
     * @return \Stripe\FinancialConnections\Account the disconnected account
93
     */
94
    public function disconnect($params = null, $opts = null)
×
95
    {
96
        $url = $this->instanceUrl() . '/disconnect';
×
97
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
98
        $this->refreshFrom($response, $opts);
×
99

100
        return $this;
×
101
    }
102

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

119
        return $obj;
×
120
    }
121

122
    /**
123
     * @param null|array $params
124
     * @param null|array|string $opts
125
     *
126
     * @throws \Stripe\Exception\ApiErrorException if the request fails
127
     *
128
     * @return \Stripe\FinancialConnections\Account the refreshed account
129
     */
130
    public function refreshAccount($params = null, $opts = null)
×
131
    {
132
        $url = $this->instanceUrl() . '/refresh';
×
133
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
134
        $this->refreshFrom($response, $opts);
×
135

136
        return $this;
×
137
    }
138

139
    /**
140
     * @param null|array $params
141
     * @param null|array|string $opts
142
     *
143
     * @throws \Stripe\Exception\ApiErrorException if the request fails
144
     *
145
     * @return \Stripe\FinancialConnections\Account the subscribed account
146
     */
147
    public function subscribe($params = null, $opts = null)
×
148
    {
149
        $url = $this->instanceUrl() . '/subscribe';
×
150
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
151
        $this->refreshFrom($response, $opts);
×
152

153
        return $this;
×
154
    }
155

156
    /**
157
     * @param null|array $params
158
     * @param null|array|string $opts
159
     *
160
     * @throws \Stripe\Exception\ApiErrorException if the request fails
161
     *
162
     * @return \Stripe\FinancialConnections\Account the unsubscribed account
163
     */
164
    public function unsubscribe($params = null, $opts = null)
×
165
    {
166
        $url = $this->instanceUrl() . '/unsubscribe';
×
167
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
168
        $this->refreshFrom($response, $opts);
×
169

170
        return $this;
×
171
    }
172
}
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