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

stripe / stripe-php / #7087

pending completion
#7087

push

php-coveralls

pakrym-stripe
Bump version to 10.14.0-beta.2

1831 of 2732 relevant lines covered (67.02%)

3.81 hits per line

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

77.27
/lib/Capability.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * This is an object representing a capability for a Stripe account.
9
 *
10
 * Related guide: <a href="https://stripe.com/docs/connect/account-capabilities">Account capabilities</a>
11
 *
12
 * @property string $id The identifier for the capability.
13
 * @property string $object String representing the object's type. Objects of the same type share the same value.
14
 * @property string|\Stripe\Account $account The account for which the capability enables functionality.
15
 * @property null|\Stripe\StripeObject $future_requirements
16
 * @property bool $requested Whether the capability has been requested.
17
 * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch.
18
 * @property null|\Stripe\StripeObject $requirements
19
 * @property string $status The status of the capability. Can be <code>active</code>, <code>inactive</code>, <code>pending</code>, or <code>unrequested</code>.
20
 */
21
class Capability extends ApiResource
22
{
23
    const OBJECT_NAME = 'capability';
24

25
    use ApiOperations\Update;
26

27
    const STATUS_ACTIVE = 'active';
28
    const STATUS_INACTIVE = 'inactive';
29
    const STATUS_PENDING = 'pending';
30
    const STATUS_UNREQUESTED = 'unrequested';
31

32
    /**
33
     * @return string the API URL for this Stripe account reversal
34
     */
35
    public function instanceUrl()
36
    {
37
        $id = $this['id'];
2✔
38
        $account = $this['account'];
2✔
39
        if (!$id) {
2✔
40
            throw new Exception\UnexpectedValueException(
×
41
                'Could not determine which URL to request: ' .
×
42
                "class instance has invalid ID: {$id}",
×
43
                null
×
44
            );
×
45
        }
46
        $id = Util\Util::utf8($id);
2✔
47
        $account = Util\Util::utf8($account);
2✔
48

49
        $base = Account::classUrl();
2✔
50
        $accountExtn = \urlencode($account);
2✔
51
        $extn = \urlencode($id);
2✔
52

53
        return "{$base}/{$accountExtn}/capabilities/{$extn}";
2✔
54
    }
55

56
    /**
57
     * @param array|string $_id
58
     * @param null|array|string $_opts
59
     *
60
     * @throws \Stripe\Exception\BadMethodCallException
61
     */
62
    public static function retrieve($_id, $_opts = null)
63
    {
64
        $msg = 'Capabilities cannot be retrieved without an account ID. ' .
1✔
65
               'Retrieve a capability using `Account::retrieveCapability(' .
1✔
66
               "'account_id', 'capability_id')`.";
1✔
67

68
        throw new Exception\BadMethodCallException($msg);
1✔
69
    }
70

71
    /**
72
     * @param string $_id
73
     * @param null|array $_params
74
     * @param null|array|string $_options
75
     *
76
     * @throws \Stripe\Exception\BadMethodCallException
77
     */
78
    public static function update($_id, $_params = null, $_options = null)
79
    {
80
        $msg = 'Capabilities cannot be updated without an account ID. ' .
1✔
81
               'Update a capability using `Account::updateCapability(' .
1✔
82
               "'account_id', 'capability_id', \$updateParams)`.";
1✔
83

84
        throw new Exception\BadMethodCallException($msg);
1✔
85
    }
86
}
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

© 2026 Coveralls, Inc