File Coverage

lib/Net/API/Stripe/Identity/VerificationSession.pm
Criterion Covered Total %
statement 7 21 33.3
branch n/a
condition n/a
subroutine 3 17 17.6
pod 14 14 100.0
total 24 52 46.1


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Stripe API - ~/lib/Net/API/Stripe/Identity/VerificationSession.pm
3             ## Version v0.1.0
4             ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/10/29
7             ## Modified 2022/10/29
8             ##
9             ##----------------------------------------------------------------------------
10             BEGIN
11             {
12             use strict;
13 2     2   24233487 use parent qw( Net::API::Stripe::Generic );
  2         13  
  2         68  
14 2     2   16 our( $VERSION ) = 'v0.1.0';
  2         4  
  2         10  
15 2     2   894 };
16              
17              
18 0     0 1    
19              
20 0     0 1    
21             { code => { type => "scalar" }, reason => { type => "scalar" } }, @_ ) ); }
22 0     0 1    
23              
24 0     0 1    
25              
26 0     0 1   {
27             document => {
28             definition => {
29 0     0 1   allowed_types => { type => "array" },
30             require_id_number => { type => "boolean" },
31 0     0 1   require_live_capture => { type => "boolean" },
32             require_matching_selfie => { type => "boolean" },
33 0     0 1   },
34             type => "class",
35 0     0 1   },
36             id_number => { type => "hash" },
37             }, @_ ) ); }
38              
39              
40              
41              
42              
43              
44             1;
45             # NOTE: POD
46              
47             =encoding utf8
48              
49 0     0 1   =head1 NAME
50              
51 0     0 1   Net::API::Stripe::Identity::VerificationSession - The VerificationSession object
52              
53 0     0 1   =head1 SYNOPSIS
54              
55 0     0 1   =head1 VERSION
56              
57 0     0 1   v0.1.0
58              
59             =head1 DESCRIPTION
60              
61             A VerificationSession guides you through the process of collecting and verifying the identities of your users. It contains details about the type of verification, such as what L<verification check|https://stripe.com/docs/identity/verification-checks> to perform. Only create one VerificationSession for each verification in your system.
62              
63             A VerificationSession transitions through L<multiple statuses|https://stripe.com/docs/identity/how-sessions-work> throughout its lifetime as it progresses through the verification flow. The VerificationSession contains the user's verified data after verification checks are complete.
64              
65             Related guide: L<The Verification Sessions API|https://stripe.com/docs/identity/verification-sessions>
66              
67             =head1 METHODS
68              
69             =head2 id string
70              
71             Unique identifier for the object.
72              
73             =head2 object string
74              
75             String representing the object's type. Objects of the same type share the same value.
76              
77             =head2 client_secret string
78              
79             The short-lived client secret used by Stripe.js to L<show a verification modal|https://stripe.com/docs/js/identity/modal> 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 L<passing the client secret to the frontend|https://stripe.com/docs/identity/verification-sessions#client-secret> to learn more.
80              
81             =head2 created timestamp
82              
83             Time at which the object was created. Measured in seconds since the Unix epoch.
84              
85             =head2 last_error hash
86              
87             If present, this property tells you the last error encountered when processing the verification.
88              
89             It has the following properties:
90              
91             =over 4
92              
93             =item C<code> string
94              
95             A short machine-readable string giving the reason for the verification or user-session failure.
96              
97             =item C<reason> string
98              
99             A message that explains the reason for verification or user-session failure.
100              
101             =back
102              
103             =head2 last_verification_report expandable
104              
105             ID of the most recent VerificationReport. L<Learn more about accessing detailed verification results.|https://stripe.com/docs/identity/verification-sessions#results>
106              
107             When expanded this is an L<Net::API::Stripe::Identity::VerificationReport> object.
108              
109             =head2 livemode boolean
110              
111             Has the value C<true> if the object exists in live mode or the value C<false> if the object exists in test mode.
112              
113             =head2 metadata hash
114              
115             Set of L<key-value pairs|https://stripe.com/docs/api/metadata> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
116              
117             =head2 options hash
118              
119             A set of options for the session’s verification checks.
120              
121             It has the following properties:
122              
123             =over 4
124              
125             =item C<document> hash
126              
127             Options that apply to the L<document check|https://stripe.com/docs/identity/verification-checks?type=document>.
128              
129             =over 8
130              
131             =item C<allowed_types> array
132              
133             Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a documentI<type>not_allowed error code.
134              
135             =item C<require_id_number> boolean
136              
137             Collect an ID number and perform an L<ID number check|https://stripe.com/docs/identity/verification-checks?type=id-number> with the document’s extracted name and date of birth.
138              
139             =item C<require_live_capture> boolean
140              
141             Disable image uploads, identity document images have to be captured using the device’s camera.
142              
143             =item C<require_matching_selfie> boolean
144              
145             Capture a face image and perform a L<selfie check|https://stripe.com/docs/identity/verification-checks?type=selfie> comparing a photo ID and a picture of your user’s face. L<Learn more|https://stripe.com/docs/identity/selfie>.
146              
147              
148             =back
149              
150             =item C<id_number> hash
151              
152             Options that apply to the L<id number check|https://stripe.com/docs/identity/verification-checks?type=id_number>.
153              
154             =over 8
155              
156             =item C<id_number>
157              
158             This is an empty hash.
159              
160              
161             =back
162              
163             =back
164              
165             =head2 redaction object
166              
167             Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
168              
169             This is a L<Net::API::Stripe::Balance::Transaction> object.
170              
171             =head2 status string
172              
173             Status of this VerificationSession. L<Learn more about the lifecycle of sessions|https://stripe.com/docs/identity/how-sessions-work>.
174              
175             =head2 type string
176              
177             The type of L<verification check|https://stripe.com/docs/identity/verification-checks> to be performed.
178              
179             =head2 url string
180              
181             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 L<verifying identity documents|https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect> to learn how to redirect users to Stripe.
182              
183             =head2 verified_outputs object
184              
185             The user’s verified data.
186              
187             This is a L<Net::API::Stripe::Connect::Person> object.
188              
189             =head1 API SAMPLE
190              
191             [
192             {
193             "client_secret" : null,
194             "created" : "1662261086",
195             "id" : "vs_1Le9F42eZvKYlo2Chf4NfVUc",
196             "last_error" : null,
197             "last_verification_report" : "vr_MMt18CcerTGCqLkvTzwaSqfw",
198             "livemode" : 0,
199             "metadata" : {},
200             "object" : "identity.verification_session",
201             "options" : {
202             "document" : {
203             "require_matching_selfie" : 1
204             }
205             },
206             "redaction" : null,
207             "status" : "verified",
208             "type" : "document",
209             "url" : null
210             }
211             ]
212              
213             =head1 HISTORY
214              
215             =head2 v0.1.0
216              
217             Initial version
218              
219             =head1 AUTHOR
220              
221             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
222              
223             =head1 SEE ALSO
224              
225             L<Stripe API documentation|https://stripe.com/docs/api/identity/verification_sessions>
226              
227             =head1 COPYRIGHT & LICENSE
228              
229             Copyright (c) 2019-2022 DEGUEST Pte. Ltd.
230              
231             You can use, copy, modify and redistribute this package and associated
232             files under the same terms as Perl itself.
233              
234             =cut