• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-php / 9294257831

29 May 2024 11:04PM UTC coverage: 65.24% (-0.9%) from 66.119%
9294257831

Pull #1701

github

web-flow
Merge 4279e3421 into 901f195e4
Pull Request #1701: Demagiced crudl operation

1088 of 1690 new or added lines in 106 files covered. (64.38%)

108 existing lines in 5 files now uncovered.

3444 of 5279 relevant lines covered (65.24%)

2.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Identity/VerificationSession.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Identity;
6

7
/**
8
 * A VerificationSession guides you through the process of collecting and verifying the identities
9
 * of your users. It contains details about the type of verification, such as what <a href="/docs/identity/verification-checks">verification
10
 * check</a> to perform. Only create one VerificationSession for
11
 * each verification in your system.
12
 *
13
 * A VerificationSession transitions through <a href="/docs/identity/how-sessions-work">multiple
14
 * statuses</a> throughout its lifetime as it progresses through
15
 * the verification flow. The VerificationSession contains the user's verified data after
16
 * verification checks are complete.
17
 *
18
 * Related guide: <a href="https://stripe.com/docs/identity/verification-sessions">The Verification Sessions API</a>
19
 *
20
 * @property string $id Unique identifier for the object.
21
 * @property string $object String representing the object's type. Objects of the same type share the same value.
22
 * @property null|string $client_reference_id A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
23
 * @property null|string $client_secret The short-lived client secret used by Stripe.js to <a href="https://stripe.com/docs/js/identity/modal">show a verification modal</a> inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on <a href="https://stripe.com/docs/identity/verification-sessions#client-secret">passing the client secret to the frontend</a> to learn more.
24
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
25
 * @property null|\Stripe\StripeObject $last_error If present, this property tells you the last error encountered when processing the verification.
26
 * @property null|string|\Stripe\Identity\VerificationReport $last_verification_report ID of the most recent VerificationReport. <a href="https://stripe.com/docs/identity/verification-sessions#results">Learn more about accessing detailed verification results.</a>
27
 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
28
 * @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.
29
 * @property null|\Stripe\StripeObject $options A set of options for the session’s verification checks.
30
 * @property null|\Stripe\StripeObject $provided_details Details provided about the user being verified. These details may be shown to the user.
31
 * @property null|\Stripe\StripeObject $redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
32
 * @property string $status Status of this VerificationSession. <a href="https://stripe.com/docs/identity/how-sessions-work">Learn more about the lifecycle of sessions</a>.
33
 * @property string $type The type of <a href="https://stripe.com/docs/identity/verification-checks">verification check</a> to be performed.
34
 * @property null|string $url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on <a href="https://stripe.com/docs/identity/verify-identity-documents?platform=web&amp;type=redirect">verifying identity documents</a> to learn how to redirect users to Stripe.
35
 * @property null|string $verification_flow The configuration token of a Verification Flow from the dashboard.
36
 * @property null|\Stripe\StripeObject $verified_outputs The user’s verified data.
37
 */
38
class VerificationSession extends \Stripe\ApiResource
39
{
40
    const OBJECT_NAME = 'identity.verification_session';
41

42
    use \Stripe\ApiOperations\Update;
43

44
    const STATUS_CANCELED = 'canceled';
45
    const STATUS_PROCESSING = 'processing';
46
    const STATUS_REQUIRES_INPUT = 'requires_input';
47
    const STATUS_VERIFIED = 'verified';
48

49
    const TYPE_DOCUMENT = 'document';
50
    const TYPE_ID_NUMBER = 'id_number';
51
    const TYPE_VERIFICATION_FLOW = 'verification_flow';
52

53
    /**
54
     * Creates a VerificationSession object.
55
     *
56
     * After the VerificationSession is created, display a verification modal using the
57
     * session <code>client_secret</code> or send your users to the session’s
58
     * <code>url</code>.
59
     *
60
     * If your API key is in test mode, verification checks won’t actually process,
61
     * though everything else will occur as if in live mode.
62
     *
63
     * Related guide: <a href="/docs/identity/verify-identity-documents">Verify your
64
     * users’ identity documents</a>
65
     *
66
     * @param null|array $params
67
     * @param null|array|string $options
68
     *
69
     * @throws \Stripe\Exception\ApiErrorException if the request fails
70
     *
71
     * @return \Stripe\Identity\VerificationSession the created resource
72
     */
NEW
73
    public static function create($params = null, $options = null)
×
74
    {
NEW
75
        self::_validateParams($params);
×
NEW
76
        $url = static::classUrl();
×
77

NEW
78
        list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
×
NEW
79
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
80
        $obj->setLastResponse($response);
×
81

NEW
82
        return $obj;
×
83
    }
84

85
    /**
86
     * Returns a list of VerificationSessions.
87
     *
88
     * @param null|array $params
89
     * @param null|array|string $opts
90
     *
91
     * @throws \Stripe\Exception\ApiErrorException if the request fails
92
     *
93
     * @return \Stripe\Collection<\Stripe\Identity\VerificationSession> of ApiResources
94
     */
NEW
95
    public static function all($params = null, $opts = null)
×
96
    {
NEW
97
        $url = static::classUrl();
×
98

NEW
99
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
100
    }
101

102
    /**
103
     * Retrieves the details of a VerificationSession that was previously created.
104
     *
105
     * When the session status is <code>requires_input</code>, you can use this method
106
     * to retrieve a valid <code>client_secret</code> or <code>url</code> to allow
107
     * re-submission.
108
     *
109
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
110
     * @param null|array|string $opts
111
     *
112
     * @throws \Stripe\Exception\ApiErrorException if the request fails
113
     *
114
     * @return \Stripe\Identity\VerificationSession
115
     */
NEW
116
    public static function retrieve($id, $opts = null)
×
117
    {
NEW
118
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
119
        $instance = new static($id, $opts);
×
NEW
120
        $instance->refresh();
×
121

NEW
122
        return $instance;
×
123
    }
124

125
    /**
126
     * Updates a VerificationSession object.
127
     *
128
     * When the session status is <code>requires_input</code>, you can use this method
129
     * to update the verification check and options.
130
     *
131
     * @param string $id the ID of the resource to update
132
     * @param null|array $params
133
     * @param null|array|string $opts
134
     *
135
     * @throws \Stripe\Exception\ApiErrorException if the request fails
136
     *
137
     * @return \Stripe\Identity\VerificationSession the updated resource
138
     */
NEW
139
    public static function update($id, $params = null, $opts = null)
×
140
    {
NEW
141
        self::_validateParams($params);
×
NEW
142
        $url = static::resourceUrl($id);
×
143

NEW
144
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
NEW
145
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
146
        $obj->setLastResponse($response);
×
147

NEW
148
        return $obj;
×
149
    }
150

151
    /**
152
     * @param null|array $params
153
     * @param null|array|string $opts
154
     *
155
     * @throws \Stripe\Exception\ApiErrorException if the request fails
156
     *
157
     * @return \Stripe\Identity\VerificationSession the canceled verification session
158
     */
159
    public function cancel($params = null, $opts = null)
×
160
    {
161
        $url = $this->instanceUrl() . '/cancel';
×
162
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
163
        $this->refreshFrom($response, $opts);
×
164

165
        return $this;
×
166
    }
167

168
    /**
169
     * @param null|array $params
170
     * @param null|array|string $opts
171
     *
172
     * @throws \Stripe\Exception\ApiErrorException if the request fails
173
     *
174
     * @return \Stripe\Identity\VerificationSession the redacted verification session
175
     */
176
    public function redact($params = null, $opts = null)
×
177
    {
178
        $url = $this->instanceUrl() . '/redact';
×
179
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
180
        $this->refreshFrom($response, $opts);
×
181

182
        return $this;
×
183
    }
184
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc