VerificationSessionService.php 5.8 KB

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