1<?php
2
3// File generated from our OpenAPI spec
4
5namespace Stripe;
6
7/**
8 * This is an object representing a person associated with a Stripe account.
9 *
10 * Related guide: <a
11 * href="https://stripe.com/docs/connect/identity-verification-api#person-information">Handling
12 * Identity Verification with the API</a>.
13 *
14 * @property string $id Unique identifier for the object.
15 * @property string $object String representing the object's type. Objects of the same type share the same value.
16 * @property string $account The account the person is associated with.
17 * @property \Stripe\StripeObject $address
18 * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only).
19 * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only).
20 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
21 * @property \Stripe\StripeObject $dob
22 * @property null|string $email The person's email address.
23 * @property null|string $first_name The person's first name.
24 * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only).
25 * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only).
26 * @property null|string $gender The person's gender (International regulations require either &quot;male&quot; or &quot;female&quot;).
27 * @property bool $id_number_provided Whether the person's <code>id_number</code> was provided.
28 * @property null|string $last_name The person's last name.
29 * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only).
30 * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only).
31 * @property null|string $maiden_name The person's maiden name.
32 * @property \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.
33 * @property null|string $phone The person's phone number.
34 * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.
35 * @property \Stripe\StripeObject $relationship
36 * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when.
37 * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only).
38 * @property \Stripe\StripeObject $verification
39 */
40class Person extends ApiResource
41{
42    const OBJECT_NAME = 'person';
43
44    use ApiOperations\Delete;
45    use ApiOperations\Update;
46
47    const GENDER_FEMALE = 'female';
48    const GENDER_MALE = 'male';
49
50    const POLITICAL_EXPOSURE_EXISTING = 'existing';
51    const POLITICAL_EXPOSURE_NONE = 'none';
52
53    const VERIFICATION_STATUS_PENDING = 'pending';
54    const VERIFICATION_STATUS_UNVERIFIED = 'unverified';
55    const VERIFICATION_STATUS_VERIFIED = 'verified';
56
57    /**
58     * @return string the API URL for this Stripe account reversal
59     */
60    public function instanceUrl()
61    {
62        $id = $this['id'];
63        $account = $this['account'];
64        if (!$id) {
65            throw new Exception\UnexpectedValueException(
66                'Could not determine which URL to request: ' .
67                "class instance has invalid ID: {$id}",
68                null
69            );
70        }
71        $id = Util\Util::utf8($id);
72        $account = Util\Util::utf8($account);
73
74        $base = Account::classUrl();
75        $accountExtn = \urlencode($account);
76        $extn = \urlencode($id);
77
78        return "{$base}/{$accountExtn}/persons/{$extn}";
79    }
80
81    /**
82     * @param array|string $_id
83     * @param null|array|string $_opts
84     *
85     * @throws \Stripe\Exception\BadMethodCallException
86     */
87    public static function retrieve($_id, $_opts = null)
88    {
89        $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' .
90               "a person using `Account::retrievePerson('account_id', " .
91               "'person_id')`.";
92
93        throw new Exception\BadMethodCallException($msg);
94    }
95
96    /**
97     * @param string $_id
98     * @param null|array $_params
99     * @param null|array|string $_options
100     *
101     * @throws \Stripe\Exception\BadMethodCallException
102     */
103    public static function update($_id, $_params = null, $_options = null)
104    {
105        $msg = 'Persons cannot be updated without an account ID. Update ' .
106               "a person using `Account::updatePerson('account_id', " .
107               "'person_id', \$updateParams)`.";
108
109        throw new Exception\BadMethodCallException($msg);
110    }
111}
112