Person.php 4.8 KB

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