From 19985dbb8c0aa66dc4bf7905abc1148de909097d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Tue, 11 Jan 2022 12:35:47 +0100 Subject: prvi-commit --- .../Service/Identity/IdentityServiceFactory.php | 27 ++++ .../Service/Identity/VerificationReportService.php | 39 ++++++ .../Identity/VerificationSessionService.php | 146 +++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php create mode 100644 vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php (limited to 'vendor/stripe/stripe-php/lib/Service/Identity') diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php new file mode 100644 index 0000000..cf63146 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/IdentityServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'verificationReports' => VerificationReportService::class, + 'verificationSessions' => VerificationSessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php new file mode 100644 index 0000000..0393cd5 --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationReportService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/identity/verification_reports', $params, $opts); + } + + /** + * Retrieves an existing VerificationReport. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationReport + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_reports/%s', $id), $params, $opts); + } +} diff --git a/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php new file mode 100644 index 0000000..1a763be --- /dev/null +++ b/vendor/stripe/stripe-php/lib/Service/Identity/VerificationSessionService.php @@ -0,0 +1,146 @@ +requestCollection('get', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * A VerificationSession object can be canceled when it is in + * requires_input status. + * + * Once canceled, future submission attempts are disabled. This cannot be undone. + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a VerificationSession object. + * + * After the VerificationSession is created, display a verification modal using the + * session client_secret or send your users to the session’s + * url. + * + * If your API key is in test mode, verification checks won’t actually process, + * though everything else will occur as if in live mode. + * + * Related guide: Verify your + * users’ identity documents. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/identity/verification_sessions', $params, $opts); + } + + /** + * Redact a VerificationSession to remove all collected information from Stripe. + * This will redact the VerificationSession and all objects related to it, + * including VerificationReports, Events, request logs, etc. + * + * A VerificationSession object can be redacted when it is in + * requires_input or verified status. Redacting a + * VerificationSession in requires_action state will automatically + * cancel it. + * + * The redaction process may take up to four days. When the redaction process is in + * progress, the VerificationSession’s redaction.status field will be + * set to processing; when the process is finished, it will change to + * redacted and an identity.verification_session.redacted + * event will be emitted. + * + * Redaction is irreversible. Redacted objects are still accessible in the Stripe + * API, but all the fields that contain personal data will be replaced by the + * string [redacted] or a similar placeholder. The + * metadata field will also be erased. Redacted objects cannot be + * updated or used for any purpose. + * + * Learn more. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function redact($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s/redact', $id), $params, $opts); + } + + /** + * Retrieves the details of a VerificationSession that was previously created. + * + * When the session status is requires_input, you can use this method + * to retrieve a valid client_secret or url to allow + * re-submission. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } + + /** + * Updates a VerificationSession object. + * + * When the session status is requires_input, you can use this method + * to update the verification check and options. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Identity\VerificationSession + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/identity/verification_sessions/%s', $id), $params, $opts); + } +} -- cgit v1.2.3