VerificationSessionService.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Identity;
  4. class VerificationSessionService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of VerificationSessions.
  8. *
  9. * @param null|array $params
  10. * @param null|array|\Stripe\Util\RequestOptions $opts
  11. *
  12. * @throws \Stripe\Exception\ApiErrorException if the request fails
  13. *
  14. * @return \Stripe\Collection<\Stripe\Identity\VerificationSession>
  15. */
  16. public function all($params = null, $opts = null)
  17. {
  18. return $this->requestCollection('get', '/v1/identity/verification_sessions', $params, $opts);
  19. }
  20. /**
  21. * A VerificationSession object can be canceled when it is in
  22. * <code>requires_input</code> <a
  23. * href="/docs/identity/how-sessions-work">status</a>.
  24. *
  25. * Once canceled, future submission attempts are disabled. This cannot be undone.
  26. * <a href="/docs/identity/verification-sessions#cancel">Learn more</a>.
  27. *
  28. * @param string $id
  29. * @param null|array $params
  30. * @param null|array|\Stripe\Util\RequestOptions $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Identity\VerificationSession
  35. */
  36. public function cancel($id, $params = null, $opts = null)
  37. {
  38. return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts);
  39. }
  40. /**
  41. * Creates a VerificationSession object.
  42. *
  43. * After the VerificationSession is created, display a verification modal using the
  44. * session <code>client_secret</code> or send your users to the session’s
  45. * <code>url</code>.
  46. *
  47. * If your API key is in test mode, verification checks won’t actually process,
  48. * though everything else will occur as if in live mode.
  49. *
  50. * Related guide: <a href="/docs/identity/verify-identity-documents">Verify your
  51. * users’ identity documents</a>.
  52. *
  53. * @param null|array $params
  54. * @param null|array|\Stripe\Util\RequestOptions $opts
  55. *
  56. * @throws \Stripe\Exception\ApiErrorException if the request fails
  57. *
  58. * @return \Stripe\Identity\VerificationSession
  59. */
  60. public function create($params = null, $opts = null)
  61. {
  62. return $this->request('post', '/v1/identity/verification_sessions', $params, $opts);
  63. }
  64. /**
  65. * Redact a VerificationSession to remove all collected information from Stripe.
  66. * This will redact the VerificationSession and all objects related to it,
  67. * including VerificationReports, Events, request logs, etc.
  68. *
  69. * A VerificationSession object can be redacted when it is in
  70. * <code>requires_input</code> or <code>verified</code> <a
  71. * href="/docs/identity/how-sessions-work">status</a>. Redacting a
  72. * VerificationSession in <code>requires_action</code> state will automatically
  73. * cancel it.
  74. *
  75. * The redaction process may take up to four days. When the redaction process is in
  76. * progress, the VerificationSession’s <code>redaction.status</code> field will be
  77. * set to <code>processing</code>; when the process is finished, it will change to
  78. * <code>redacted</code> and an <code>identity.verification_session.redacted</code>
  79. * event will be emitted.
  80. *
  81. * Redaction is irreversible. Redacted objects are still accessible in the Stripe
  82. * API, but all the fields that contain personal data will be replaced by the
  83. * string <code>[redacted]</code> or a similar placeholder. The
  84. * <code>metadata</code> field will also be erased. Redacted objects cannot be
  85. * updated or used for any purpose.
  86. *
  87. * <a href="/docs/identity/verification-sessions#redact">Learn more</a>.
  88. *
  89. * @param string $id
  90. * @param null|array $params
  91. * @param null|array|\Stripe\Util\RequestOptions $opts
  92. *
  93. * @throws \Stripe\Exception\ApiErrorException if the request fails
  94. *
  95. * @return \Stripe\Identity\VerificationSession
  96. */
  97. public function redact($id, $params = null, $opts = null)
  98. {
  99. return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts);
  100. }
  101. /**
  102. * Retrieves the details of a VerificationSession that was previously created.
  103. *
  104. * When the session status is <code>requires_input</code>, you can use this method
  105. * to retrieve a valid <code>client_secret</code> or <code>url</code> to allow
  106. * re-submission.
  107. *
  108. * @param string $id
  109. * @param null|array $params
  110. * @param null|array|\Stripe\Util\RequestOptions $opts
  111. *
  112. * @throws \Stripe\Exception\ApiErrorException if the request fails
  113. *
  114. * @return \Stripe\Identity\VerificationSession
  115. */
  116. public function retrieve($id, $params = null, $opts = null)
  117. {
  118. return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts);
  119. }
  120. /**
  121. * Updates a VerificationSession object.
  122. *
  123. * When the session status is <code>requires_input</code>, you can use this method
  124. * to update the verification check and options.
  125. *
  126. * @param string $id
  127. * @param null|array $params
  128. * @param null|array|\Stripe\Util\RequestOptions $opts
  129. *
  130. * @throws \Stripe\Exception\ApiErrorException if the request fails
  131. *
  132. * @return \Stripe\Identity\VerificationSession
  133. */
  134. public function update($id, $params = null, $opts = null)
  135. {
  136. return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts);
  137. }
  138. }